function preloadImages(){
	Image01 = new Image
	Image01.src = "images/shadow_topright.gif"
	Image02 = new Image
	Image02.src = "images/shadow_topleft.gif"
	Image03 = new Image
	Image03.src = "images/shadow_top.gif"
	Image04 = new Image
	Image04.src = "images/shadow_bottomright.gif"
	Image05 = new Image
	Image05.src = "images/shadow_bottomleft.gif"
	Image06 = new Image
	Image06.src = "images/shadow_bottom.gif"
	Image07 = new Image
	Image07.src = "images/spacer.gif"
	Image08 = new Image
	Image08.src = "images/shadow_topright.gif"
	Image09 = new Image
	Image09.src = "images/shadow_topright.gif"
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function SurveyWindow(mypage,myname,w,h,scroll){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=no';
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function CenterShot(link,windowname){
  var winl = (screen.width-640)/2;
  var wint = (screen.height-520)/2;
  var settings  ='height='+520+',';
      settings +='width='+640+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars=no,resizable=no';
  win=window.open(link, windowname, settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function NonThumbnail(link, windowname, size) {
	ImageWindow=window.open (link, windowname, 'left=0,top=0,width=640,height=560')
}

function VariableThumbnail(link, windowname, size) {
	ImageWindow=window.open (link, windowname, size)
}

function ValidateForm(form){

	var digits = "0123456789";

	if (form.FirstName.value == ""){
  	   	alert("Registration can not be processed without your first name.");
  	   	form.FirstName.focus();
  	   	return;
  	}
	if (form.LastName.value == ""){
  	   	alert("Registration can not be processed without your last name.");
  	   	form.LastName.focus();
  	   	return;
  	}
	if (form.Handle.value == ""){
  	  	alert("Registration can not be processed without your gaming handle.");
  	   	form.Handle.focus();
  	   	return;
  	}
	if (form.Pwd.value == ""){
  	  	alert("You must supply a password for editing and security purposes.");
  	   	form.Pwd.focus();
  	   	return;
  	}
	if (form.Email.value == ""){
  	   	alert("Registration can not be processed without a valid e-mail address.");
  	   	form.Email.focus();
  	   	return;
  	}
	if ((form.Email.value.indexOf ('@',0) == -1 || form.Email.value.indexOf ('.',0) == -1) && form.Email.value != ""){
	    alert("You must enter a valid e-mail address.");
  	   	form.Email.focus();
  	   	return;
	} 
	if (form.Age.value == ""){
  	   	alert("Registration can not be processed without your age.");
  	   	form.Age.focus();
  	   	return;
  	}
    for (var i = 0; i < form.Age.value.length; i++){
	    temp = form.Age.value.substring(i, i+1)
	    if (digits.indexOf(temp) == -1 && form.Age.value != ""){
	      alert("Your age can not contain any letters or symbols.");
		  form.Age.focus();
		  return;
		}
	}
	if (form.Region.value == ""){
  	   	alert("Please give us an idea of where you're coming from!");
  	   	form.Region.focus();
  	   	return;
  	}
	/*
	if (form.Participate[0].checked == true && form.TeamName.value == ""){
  	   	alert("If you want to join a pre-existing team, please select a team from the list.");
  	   	form.TeamName.focus();
    	return;
  	}
	if (form.Participate[1].checked == true && form.NewName.value == ""){
  	   	alert("You must specify a team name when creating a new team!");
  	   	form.NewName.focus();
		return;
  	}
	*/
	if (form.Agree.checked != true){
  	   	alert("You must agree to the Release of Liability statements to attend a party.  Thanks for your cooperation!");
  	   	form.Agree.focus();
  	   	return;
    }
	if (form.Pwd.value != form.PwdConfirm.value){
  	  	alert("Passwords do not match. Please enter them again.");
  	   	form.Pwd.value = "";
		form.PwdConfirm.value = "";
		form.Pwd.focus();
  	   	return;
  	}

	//setField(RegisterForm);
	form.submit();
}

function ValidateSmallForm(form){

	var digits = "0123456789";

	if (form.NewHandle.value == ""){
  	  	alert("You must supply your gaming handle.");
  	   	form.NewHandle.focus();
  	   	return;
  	}
	if (form.EmailUpdate.value == ""){
  	   	alert("You must supply a valid e-mail address.");
  	   	form.EmailUpdate.focus();
  	   	return;
  	}
	if ((form.EmailUpdate.value.indexOf ('@',0) == -1 || form.EmailUpdate.value.indexOf ('.',0) == -1) && form.EmailUpdate.value != ""){
	    alert("You must enter a valid e-mail address.");
  	   	form.EmailUpdate.focus();
  	   	return;
	}
	if (form.RegionUpdate.value == ""){
  	   	alert("Please give us an idea of where you're coming from!");
  	   	form.RegionUpdate.focus();
  	   	return;
  	}	
	form.submit();
}

/*
function setField(form) {
	if (form.Participate[0].checked == true) {
		form.NewName.value = "";
		return;
	}
	if (form.Participate[1].checked == true) {
		form.TeamName.value = "";
		return;
	}
	if (form.Participate[2].checked == true) {
		form.NewName.value = "";
		form.TeamName.value = "";
		return;
	}
}
*/