var newWindow = null
function makeWin(url,name,w,h) {
	newWindow = window.open(url,name,"scrollbars=yes,resizable=no,menubar=no,location=no,width=" + w + ",height=" + h );
}

function client(url) {
	window.open(url,"client","scrollbars=yes,resizable=no,menubar=no,location=no,width=550,height=500");
}

function getCookie(name){
var cname = name + "=";               
var dc = document.cookie;
if (dc.length > 0) {
begin = dc.indexOf(cname);
if (begin != -1) {           
begin += cname.length;
end = dc.indexOf(";", begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin, end));        }
}
return null;
}

function getLoginFromCookie() {
	value = getCookie("BHIUserData");
	if (value != null && value.indexOf(',') != -1) {
		document.login.userName.value = value.substring(0,value.indexOf(','));
		document.login.pass.value = value.substring(value.indexOf(',')+1);
		if (document.login.save) document.login.save.checked=true;
	}
}

function submitForm(name) {
	if (document.forms[name]) document.forms[name].submit();
}

function openMain(url) {
	if (opener) {
		opener.location.href = url;
		opener.focus();
	} else this.close();
}
