<!--
var loginWnd;

function Get_Cookie(name) {
	var cookies = document.cookie;
	if (cookies == "") return false;
	cookies = " " + cookies;

	var start = cookies.indexOf(" " + name + "=");
	if (start == -1) return false;
	start += name.length + 2;

	var end = cookies.indexOf(";", start);
	if (end == -1) end = cookies.length;

	var val = cookies.substring(start, end);
	return unescape(val);
}

function Set_Cookie(name,value,expires,path,domain,secure) {
	document.cookie = name + "=" +escape(value) +
		( (expires) ? ";expires=" + expires.toGMTString() : "") +
		( (path) ? ";path=" + path : "") +
		( (domain) ? ";domain=" + domain : "") +
		( (secure) ? ";secure" : "");
}

function Delete_Cookie(name) {
//	if (Get_Cookie(name))
		document.cookie = name + "=;expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function handleClick() {
	if (!loginWnd) {
		loginWnd = window.open( 'https://www.bitpass.com/control', '_bp_CTRL_', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=303,height=208,left=' + (screen.width - 303) / 2 + ',' + 'top=' + (screen.height - 208) / 2);
		loginWnd.focus();
	} else if (loginWnd.closed) {
		delete loginWnd;
		loginWnd = null;
		handleClick();
	} else {
		loginWnd.focus();
	}
}

//-->
