
// disable fullscreen with F11 and Refresh F5 keys
document.onkeydown = function ()
{
	if (122 == event.keyCode)
	{
		event.keyCode = 0;
		return false;
	}
	// keycode for F5 function => 116 ; Backspace => 8
	if (window.event && window.event.keyCode == 116) {
		window.event.keyCode = 8;
	}
	// keycode for backspace
	if (window.event && window.event.keyCode == 8) {
		// try to cancel the backspace
		window.event.cancelBubble = true;
		window.event.returnValue = false;
		return false;
	}
}

function UpdateParent()
{
	if (window.opener != null)
	{
		window.opener.location.reload(1);
		window.opener.location.reload(1);
	}
}

function Check(){

	if (window.opener == null)
	{
		window.location.replace("index.aspx");
	}
	else
	{
		var tr = window.opener.location.pathname;
		len = tr.length;
		rs = 0;
		for (i = len-1; i >= 0; i--) {
			vb = tr.substring(i,i+1)
			if (vb == "/" && rs == 0) {
				var filename =	tr.substring(i+1,len);
				rs = 1;
				break;
			} 
		} 

		if ( (filename != "userhome.aspx") )
		{
			window.location.replace("index.aspx");
			window.close();
		}
		
		/*
		// additionally check domain
		//if (window.opener.location.hostname != "VT-XP-SP3") //Debugchanges
		if (window.opener.location.hostname != "www.pass-eu-concours.com") //Live
		{
		  window.location.replace("index.aspx");
			window.close();
		}
	  */
	}
}
