//HEADER JS

function ihshelppop(mode) {
      var ihsWin = window.open ('','ihs_window' ,'resizable=yes,scrollbars=yes,width=395,height=283');
      ihsWin.focus();
            if (mode != "") {
                document.helpForm.pageId.value=mode + "." + document.helpForm.gameId.value;
            }
      document.forms['helpForm'].target='ihs_window';
            document.forms['helpForm'].submit();
    }
    
    function ihshelppopNoSys(url) {
      remote = window.open(url,"IHSHelpWindow","width=420,height=225,screenX=50,screenY=50,top=50,left=50,scrollbars=no");
      if (remote != null) {
        remote.focus();
    	window.onunload = function(){
        	if (!remote.closed) {remote.close();}
        }
      }
}

//create URI
function createFlashVerLink(uriVar){
    	var newUri = uriVar;
        newUri = uriVar + flashVersion;
		newUri = newUri + "&shockwaveVersion=";
		newUri = newUri + shockwaveVersion;
    	window.location.href = newUri;
   	}

    function popWindowTC(url, height, width) {
            var optionListing = "HEIGHT="+height+",WIDTH="+width+",innerHeight="+height+",innerWidth="+width+",left=50,top=15,channelmode=0,dependent=no,directories=no,fullscreen=0,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,screenX=10,screenY=20,menubar=yes"
            remote = window.open(url,"PopupTC",optionListing);
            if (remote != null) {
                    remote.focus();
            }
    }

    function popWindowPP(url, height, width) {
            var optionListing = "HEIGHT="+height+",WIDTH="+width+",innerHeight="+height+",innerWidth="+width+",left=50,top=15,channelmode=0,dependent=no,directories=no,fullscreen=0,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,screenX=10,screenY=20,menubar=yes"
            remote = window.open(url,"PopupPP",optionListing);
            if (remote != null) {
                    remote.focus();
            }
    }
    
    var submitted = false;
    
    function submitonce() {
        if (submitted) {
            return false;
        } else {
            submitted = true;
            return true;
        }
    }
    
    function submitPrizesForm(drawType, drawNum, drawSeq){
            document.forms['prizesForm'].drawTypeID.value = drawType;
            document.forms['prizesForm'].drawNumber.value = drawNum;
            document.forms['prizesForm'].drawSequence.value = drawSeq;
            document.forms['prizesForm'].submit();
    }
    
    function queryString( key) {
		
		
		keyValuePairs = new Array();
		if(location.search.length > 1) {
			q = location.search.substring(1, location.search.length);
			for(var i=0; i < q.split("&").length; i++) {
				keyValuePairs[i] = q.split("&")[i];
			}
		}
		
		for(var j=0; j < keyValuePairs.length; j++) {
			if(keyValuePairs[j].split("=")[0] == key)
			return unescape(keyValuePairs[j].split("=")[1]);
		}
		
		return "";
	}
	
	function shiftToHash() {
	
	
	  return;
	}

	function helppop(url, content) {
	  helpContent = content;
	  remote = window.open(url,"HelpWindow","width=400,height=245,screenX=0,screenY=0,top=0,left=0,scrollbars=yes, modal=yes", true);
	  if (remote != null) {
	    remote.focus();
		window.onunload = function(){
		if (!remote.closed) {remote.close();}
	    }
	  }
	}
