function openwindowlink(url) {
  newwin = window.open(url, 'Game','scrollbars=0,resizable=1,height=475,width=600');
}

function openWindow(form, popName, widthVal, heightVal, resizeVal){
		//alert("form="+form+"\npopName="+popName+"\nwidthVal="+widthVal+"\nheightVal="+heightVal+"\nresizeVal="+resizeVal);
		var xx = null;
		// convert heightVal to integer to allow for addition of 50px for TopPosition
		heightVal = parseInt(heightVal);
		LeftPosition = (screen.width) ? (screen.width-widthVal)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-(heightVal+50))/2 : 0;
		if (LeftPosition < 0) {	LeftPosition = 0;}
		if (TopPosition < 0) {	TopPosition = 0;}
		windowprops = "left="+LeftPosition+",top="+TopPosition+",width="+widthVal+",height="+heightVal+",location=no,scrollbars=no,menubars=no,toolbars=no,resizable="+resizeVal+",fullscreen=no";
		xx = window.open("", popName, windowprops);
		form.target=popName;
		form.submit();
		xx.focus();
		return false;
	}
function submitForm(form){
		form.submit();
		return false;
	}

function popFreeGame(URL, popName){
		var xx = null;
		LeftPosition = (screen.width) ? (screen.width-600)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-525)/2 : 0;
		windowprops = "left="+LeftPosition+",top="+TopPosition+",height=475,width=600,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no,fullscreen=no";
		xx = window.open(URL, popName, windowprops);
		xx.focus();
	}

function calcPrizeStrings75(){
  var prize ='';

  //IF THERE ARE TWO FIXED PRIZES THIS SHOULD RUN
  if (document.forms[0].prizeString[0]!=null && document.forms[0].prizeString[1]!=null) {
	for (x=0; x < 75;x++) {
	  prize = prize + document.forms[0].call[x].value;
	  if(x < 74) {
		prize = prize + ',';
	  }
	}
	document.forms[0].prizeString[0].value=prize;
	prize='';
	for (x=75; x < 150;x++) {
	  prize = prize + document.forms[0].call[x].value;
	  if(x < 149) {
		prize = prize + ',';
	  }
	}
	document.forms[0].prizeString[1].value=prize;
  }

  //IF THERE IS JUST ONE THEN RUN THIS
  if (document.forms[0].prizeString !='undefined') {
	  for (x=0; x < 75;x++) {
		prize = prize + document.forms[0].call[x].value;
		if(x < 74) {
		  prize = prize + ',';
		}
	  }
	  document.forms[0].prizeString.value=prize;
  }

}


function calcPrizeStrings90(){
  var prize ='';

  //IF THERE ARE MORE THAN ONE FIXED PRIZES THIS SHOULD RUN
  if (document.forms[0].prizeString[0]!=null && document.forms[0].prizeString[1]!=null) {
	for (x=0; x < 90;x++) {
	  prize = prize + document.forms[0].call[x].value;
	  if(x < 89) {
		prize = prize + ',';
	  }
	}
	document.forms[0].prizeString[0].value=prize;
	prize='';
	for (x=90; x < 180;x++) {
	  prize = prize + document.forms[0].call[x].value;
	  if(x < 179) {
		prize = prize + ',';
	  }
	}
	document.forms[0].prizeString[1].value=prize;
	//IF THE THIRD ONE EXISTS THEN SET THAT PRIZE STRING AS WELL
	if(document.forms[0].prizeString[2]!=null) {
	  prize='';
	  for (x=180; x < 270;x++) {
	   prize = prize + document.forms[0].call[x].value;
		if(x < 269) {
	  prize = prize + ',';
		}
	  }
	  document.forms[0].prizeString[2].value=prize;
	}

  }

  //IF THERE IS JUST ONE THEN RUN THIS
  if (document.forms[0].prizeString !='undefined') {
	  for (x=0; x < 75;x++) {
		prize = prize + document.forms[0].call[x].value;
		if(x < 74) {
		  prize = prize + ',';
		}
	  }
	  document.forms[0].prizeString.value=prize;
  }
}

//Oct 14, 2003
//simple utility for notification, not refined, included for prototyping
//jr
function openMessageWindow(msg, height, width) {
  newwin = window.open('', 'Message','scrollbars=0,resizable=1,height=' + height + ',width=' + width);
  newwin.document.write(msg);
  newwin.document.close();

}

function showMessage(msg) {
  alert(msg);

}

var help = null;
function popHelp(URL, myWidth, myHeight){
	LeftPosition = (screen.width) ? (screen.width-myWidth)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-myHeight)/2 : 0;
	specs ='height='+myHeight+',width='+myWidth+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes,toolbar=no, menubar=no'
	help = window.open(URL,"BingoDownloadHelp",specs);
	help.focus();
}

function popDownload(){
	var tvbDL = null;
	var specs = null;
	specs = "left=100,top=150,width=380,height=200,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no,fullscreen=no";
	tvblDL = window.open("popbingodl.action","TVBDownload",specs)
	tvblDL.focus();
	return false;
}

function popDownloadFreeDotNet(){
	var tvbDL = null;
	var specs = null;
	specs = "left=100,top=150,width=380,height=200,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no,fullscreen=no";
	tvblDL = window.open("popbingodlFreeDotNet.action","TVBDownload",specs)
	tvblDL.focus();
	return false;
}

function showLayer(layerid){
	document.getElementById(layerid).style.visibility = "visible";
}

function hideLayer(layerid){
	document.getElementById(layerid).style.visibility = 'hidden';
}

function hideAll(){
	var arrImages =  new Array('ORANGE','BLUE','RED','GREEN','FREE');
	var intLength = arrImages.length;
	for (var i = 0; i < intLength; i++) {
	  document.getElementById(arrImages[i]).style.visibility = 'hidden';
   } 
}

function hideAllInfo(){
	var arrInfoDivs =  new Array('ORANGE','BLUE','RED','GREEN','FREE','default_info');
	var intInfoLength = arrInfoDivs.length;
	for (var i = 0; i < intInfoLength; i++) {
	  document.getElementById(arrInfoDivs[i]+'_info').style.visibility = 'hidden';
   }
}
	
function hideblock(layerName)
{
	var element = document.getElementById (layerName);
	element.style.display = "none";
	var element = document.getElementById ('default_info');
	element.style.display = "block";
}
function showblock(layerName2)
{
	var element = document.getElementById (layerName2);
	element.style.display = "block";
	var element = document.getElementById ('default_info');
	element.style.display = "none";
}



function showLayerInfo(layerid){
	hideAllInfo();
	document.getElementById(layerid).style.visibility = "visible";
}

function hideLayerInfo(layerid){
	document.getElementById(layerid).style.visibility = 'hidden';
	showLayer('default_info');
}

var help = null;
function popHelp(URL, myWidth, myHeight){
	LeftPosition = (screen.width) ? (screen.width-myWidth)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-myHeight)/2 : 0;
	specs ='height='+myHeight+',width='+myWidth+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes,toolbar=no, menubar=no'
	help = window.open(URL,"BingoDownloadHelp",specs);
	help.focus();
}

var pop = null;
function popWindow(URL, myWidth, myHeight){
	LeftPosition = (screen.width) ? (screen.width-myWidth)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-myHeight)/2 : 0;
	specs ='height='+myHeight+',width='+myWidth+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=yes,toolbar=no, menubar=no'
	pop = window.open(URL,"GroopzLiveHelp",specs);
	pop.focus();
}
function popmppoker(URL){
	var popEm = null;
	LeftPosition = (screen.width) ? (screen.width-700)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-500)/2 : 0;
	windowprops = "left="+LeftPosition+",top="+TopPosition+",height=300,width=500,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes,fullscreen=no";
	popEm = window.open(URL, "PopEm", windowprops);
	popEm.focus();
}

