
	
function Move_Focus(obj,e,evt,len,next_field)
{
	var code;
	if (!e) var e = window.event;
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;

    // if user pressed tab key, just return
    if (code == 9) return;

    var phone_field_length;
    if (evt == 'down') {
       phone_field_length=obj.value.length;
    }
    else if (evt == 'up') 
    {
       if (obj.value.length != phone_field_length) 
       {
          phone_field_length=obj.value.length;
          if (phone_field_length == len) 
          {
            document.getElementById(next_field).focus();
          }
       }
    }
 }

function toggleLayer( whichLayer )
{
	var elem, vis;
	if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById( whichLayer );
	else if( document.all ) // this is the way old msie versions work
		elem = document.all[whichLayer];
	else if( document.layers ) // this is the way nn4 works
		elem = document.layers[whichLayer];
	vis = elem.style;
	// if the style.display value is blank we try to figure it out here
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function setLayerVis( whichLayer, state )
{
	var elem, vis;
	if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById( whichLayer );
	else if( document.all ) // this is the way old msie versions work
		elem = document.all[whichLayer];
	else if( document.layers ) // this is the way nn4 works
		elem = document.layers[whichLayer];
	vis = elem.style;
	
	if (state==1) 
	    vis.display = 'block';
	else
	    vis.display = 'none';
}




var RegisterHelpWindow;
function RegisterHelp(){
	var h = 240;
	var w = 400;
	var nTop = (screen.height - h) / 2;
	var nLeft = (screen.width - w) / 2;
	var features = "height=" + h +",width=" + w + ",top=" + nTop + ",left=" + nLeft + ",status=no,directories=no,menubar=no,location=no";
	RegisterHelpWindow = window.open("RegisterHelp.htm","RegisterHelp",features);
	RegisterHelpWindow.focus();
	return;
}


function siteOwner(){
            var siteOwnerWindow;
			var w = 400;
		    var h = 240;
			var nTop = (screen.height - h) / 2;
			var nLeft = (screen.width - w) / 2;
			var features = "height=" + h + ",width=" + w + ",top=" + nTop + ",left=" + nLeft + ",status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no,directories=no,location=no";
			//siteOwnerWindow=window.open("http://www.snickers.com/site_owner_popup.html","SiteOwner",features);
			//siteOwnerWindow=window.open("http://mms.com/us/siteowner.jsp","SiteOwner",features);
			siteOwnerWindow=window.open("SiteOwner.aspx","SiteOwner",features);
            siteOwnerWindow.focus();
            //return siteOwnerWindow;
}

//var musicWindow;
//function musicPop(playid){
//		    var h = 378;
//			var w = 448;
//			var nTop = (screen.height - h) / 2;
//			var nLeft = (screen.width - w) / 2;
//			var features = "height=" + h + ",width=" + w + ",top=" + nTop + ",left=" + nLeft + ",resizable=no,scrollbars=no,status=no";
//			musicWindow=window.open("official_rules_pop.html?p="+playid,"MusicCash",features);
//            musicWindow.focus();
//}

var musicWindow;
function musicPop(serial,pin){
		    var h = 250;
			var w = 500;
			var nTop = (screen.height - h) / 2;
			var nLeft = (screen.width - w) / 2;
			var features = "height=" + h + ",width=" + w + ",top=" + nTop + ",left=" + nLeft + ",resizable=no,scrollbars=no,status=no";
			musicWindow=window.open("MusicPopUp.aspx?s=" + serial + "&p=" + pin ,"MusicDownload",features);
            musicWindow.focus();
}

var rulesWindow;
function rulesPop(){
		    var h = 750;
			var w = 1000;
			var nTop = (screen.height - h) / 2;
			var nLeft = (screen.width - w) / 2;
			var features = "height=" + h + ",width=" + w + ",top=" + nTop + ",left=" + nLeft + ",resizable,scrollbars=yes,status=no";
			rulesWindow=window.open("Rules.aspx","Rules",features);
            rulesWindow.focus();
        }

function openShadowbox(content, player, height, width) {
            Shadowbox.open({
                content: content,
                player: player,
                height: height,
                width: width
            });
        }


        