
if (document.layers)
{
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown = disableclickNS;
}
else if (document.all&&!document.getElementById)
{
	document.onmousedown = disableclick;
}

//document.onmousedown=disableclick;
status=charFromCharCode(169) + " 1997-2008 Globet";

function disableclick(e)
{
	if(event.button==2)
	{
		var date = new Date();
		
		alert(charFromCharCode(169)+ " 1996-" + date.getFullYear()  + " Globet");
		return false;	
	}
}

function disableclickNS(e)
{
	if (document.layers||document.getElementById&&!document.all)
	{
		if (e.which==2||e.which==3)
		{
			alert(charFromCharCode(169)+ " 1996-" + date.getFullYear()  + " Globet");
			return false;
		}
	}
}

function charFromCharCode (charCode) 
{
   return unescape('%' + charCode.toString(16));
}

function ChangeUserLevel() {

    var level = document.getElementById(Level).value;
	var href = window.location.href;
	document.location.href =  getApplicationUrl() + "/ChangeLevel.aspx?form=" + href + "&level=" + level;
}

function getApplicationUrl()
{	
	var location = window.location.pathname.substr(0,23).toLowerCase();

	if (location == "/globet_sportsbook_host")
	{
		if (window.location.port)
	    {
	        return window.location.protocol + "//" + window.location.host + "/GLOBET_SPORTSBOOK_HOST";
	    }
		return window.location.protocol + "//" + window.location.hostname + "/GLOBET_SPORTSBOOK_HOST";
	}
	else
	{
		return window.location.protocol + "//" + window.location.hostname;
	}
}

function EnterSite()
{
	var href = window.location.href;
	var clientId = document.getElementById("id").value;
	document.location.href =  getApplicationUrl() + "/SessionTransfer.aspx?site=1&page=" + href + "&ClientId=" + clientId;
}

function SubmitIDChange(event)
{
	var charCode = (event.charCode) ? event.charCode :
		((event.which) ? event.which : event.keyCode);
	if (charCode == 13 || charCode == 3)
	{	
		document.all.item(getClientID() + "_Go").focus();
		ChangeUserLevel();
	}
	
}

function SetFocus()
{
	
}

function showPassword(o)
{
	/* 
	Displays the invisible password form field, and 
	hides the "display" text form field.
	*/
	var oPWD = o.form.elements["_ctl0:Header1:pwd"];
	if (oPWD == undefined)
	{
	var oPWD = o.form.elements["Header1:pwd"];
	}
	o.style.display = "none";
	oPWD.style.display = "inline";
	oPWD.focus();
}

function clearInput(o, s)
{
	/*
	Clears the contents of the client id text form 
	field if the default value is applied. The default 
	value is passed in by the parameter s.
	*/
	if(o.value == s) o.value = '';
}

function checkID(o, s)
{
	/*
	Sets the value of the client id text form field to 
	the default if no other value has been specified.
	*/
	if(o.value == '') o.value = s;
}

function checkPWD(o, s)
{
	/*
	If the form password field has had no value 
	specified, then hide it and display the "fake" 
	password (text input) field.
	*/
	var oNoPWD = o.form.elements['nopwd'];
	if(o.value == '')
	{
		o.style.display = 'none';
		oNoPWD.style.display = 'inline';
	}
}

//This function opens window Modal dialog
function fnOpenModalDialog(pageUrl, arguments, modalWindowFeatures, normalWindowFeatures) 
{
    ///<param name="pageUrl">This is the page url including query string</param>
    ///<param name="arguments">This is the arguments passed to the modal window</param>
    ///<param name="modalWindowFeatures">Features for the modal window which is opened</param>
    ///<param name="normalWindowFeatures">Features for the normal window which is opened</param>
    
    var dialogResults = "";
    var windowName = "";
    
    //consider an alternative action if the user's browser doesn't support the desired method
    if (window.showModalDialog)
    {
        dialogResults = window.showModalDialog(pageUrl, arguments, modalWindowFeatures);
        if ((dialogResults != undefined) && (dialogResults != '') && (dialogResults.substring(0,6).toLowerCase() == "error:"))
        {
            window.location.href = dialogResults.substring(6);
        }
    }
    else
    {
        dialogResults = window.open(pageUrl, windowName, normalWindowFeatures);
    }

    return dialogResults;
}


function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter)
{ 
	if(window.screen)if(isCenter)if(isCenter=="true")
	{
		var myLeft = (screen.width - myWidth) / 2;
		var myTop = (screen.height - myHeight) / 2;
		features += (features != '') ? ',' : '';
		features += ',left=' + myLeft + ',top=' + myTop;
	}
	
	var newWindow = window.open(theURL, winName, features + ((features != '') ? ',' : '') + 'width=' + myWidth + ',height=' + myHeight);
	return newWindow;
	//window.open(theURL, winName);
}
					
					
   function ShowEventStats(url)
   {
		var h = 500;
		var w = 725;
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		var features = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + 'resizable=no,scrollbars=yes,status=no'
		
	    window.open(url ,"EventStats", features);
	    return false;
   }
   
   function SelectTheme(btnNum,theme)
   { 
   //alert(btnNum);
        for (i=1;i<=5;i++)
        { 
            tempBtnVal=document.getElementById(hdnTheme) 
            tempBtn=document.getElementById('btn'+i) 
            //tempBtn.style.backgroundColor=(i==btnNum?'#ff9900':'') 
            tempBtn.style.border=(i==btnNum?'2px solid #fff':'1px solid #fff') 
           // tempBtn.style= 'buttonDivGlobetSportselect';
        } 
//    alert(theme) ;   
    tempBtnVal.value=theme ;
}

// Added by Sabari on 01 Dec 08 to have expand and colpase Javascript panels

function ShowHidePanels(obj1) {
    obj = document.getElementById(obj1);
        if (obj.style.display == '') {
            obj.style.display = 'none';
        }
        else {
            obj.style.display = '';
        }
        var obj1;
        obj1 = obj.id.split("__");
        var ctrl = "sp_" + obj1[1];

        toggleChevronIcon(document.getElementById(ctrl).childNodes[0]);

}

function toggleChevronIcon(content) {

    var expand = (content.src.indexOf("expand_white.png") > 0);
    content.src = content.src
        .split(expand ? "expand_white.png" : "collapse_white.png")
        .join(expand ? "collapse_white.png" : "expand_white.png");
}