// javascript centralized functions and global javascript variables;

var register_page='https://secure.bingofriends.com/paas/bif/registeruser.action?C=TRACKING_ID@'+sourceid+'!SYSTEM_ID@BP_AFF01&amp;PHPSID='+phpsid+'&amp;REFPID='+pid+'.';
var login_page='https://secure.bingofriends.com/paas/bif/home.action?C=TRACKING_ID@'+sourceid+'!SYSTEM_ID@BP_AFF01&amp;PHPSID='+phpsid+'&amp;REFPID='+pid+'.';

function confirm_register(){
var pzone = (pzone == null) ? 4 : pzone; //Default value for pzone is 4
   if (confirm("Your are either not logged in or have not registered. \n Click OK to register or login from the top of the page"))
{document.location=register_page+pzone;}
else
{return false;}
}

function register(pzone) { //  leads to registry page

var pzone = (pzone == null) ? 0 : pzone;
document.location=register_page+pzone;
}

function redir(myurl) {
	document.location=myurl+'&amp;PHPSESSID='+sid;
}

function checklogin() {

	if(document.loginform.username.value==""){
		register();
	} else {
		document.loginform.submit();
	}

}

function bookmarksite(){
if (document.all)
window.external.AddFavorite(location.href, document.title);
else if (window.sidebar)
window.sidebar.addPanel(document.title, location.href, "")
}

var screen_x=screen.availWidth/2-380;
var screen_y=screen.height/2-285;

/*chequea formulario de login*/
function chequea_enter(e) {
  tecla = (document.all) ? e.keyCode : e.which;
  if (tecla==13) document.loginform.submit();
}
