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);

}

//intertain added
function ssnCheck(formName, ssnMsg) {
     if (document.forms[formName].ssn.value == "")
     {
         alert(ssnMsg);
         return false;
     } else {
         form.submit();
         return true;
     }
}

