function enlarge(image_loc,img)
{
	var x = 0, y = 0; // default values
	
	if (document.all) {
	  x = screen.width/2;
	  y = screen.height/2;
	}

  HTML = "<html><title>Photo Viewer</title><style>body{margin:0px 0px 0px 0px}</style><body onBlur='top.close()'><img src='"+ image_loc +"' border=0 name=load_image onLoad='window.resizeTo(document.load_image.width+10,document.load_image.height+30)'></body></html>";
  popupImage = window.open('','_blank','height=200, width=300,toolbar=no,scrollbars=no,top='+y+',screenY='+y+',left='+x+',screenX='+x);
  popupImage.document.open();
  popupImage.document.write(HTML);
  popupImage.document.close();
  obj_img = document.getElementById(img);
  obj_img.src= obj_img.src;
}

var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
preloadimages("/images/spacer.gif","/images/left_button_on.gif","/images/left_button_off.gif","/images/orange_bullet.gif"); 


	
function easy_CheckRequired(form,Action,formaction,formtarget,req1,req2,req3,req4,req5,req6,req7,req8,req9,req10,req11,req12,req13,req14,req15,req16,req17,req18,req19,req20,req21,req22,req23,req24,req25,req26,req27,req28,req29,req30,req31,req32,req33,req34,req35,req36,req37,req38,req39,req40){
	
	if (formtarget && formtarget!='')
	{
		document.forms[form].target=formtarget;				
	}
	if (formaction && formaction!='')
	{
		document.forms[form].action=formaction;						
	}
	
	var reqFieldsCaption="";
	var noOfParams=40;
	var i=0;
	var r=0;	
	var noOfRequired=0;
	
	// Pre-count required
	while (i < noOfParams)
    {
      i++;
	  if (eval("req"+i))
	  {		  
		  reqField=eval("req"+i);
		  if (eval("document.forms[form]."+reqField+".value")=='') 
		  {
			noOfRequired++;			
		  }
	  }   
    }
	
	var i=0;	
	
	while (i < noOfParams)
    {
      i++;
	  if (eval("req"+i))
	  {		  	  	 
		  reqField=eval("req"+i);
		  if (eval("document.forms[form]."+reqField+".value")=='')
		  {			  	
			r++;
			reqFieldCaption=eval("document.forms[form]."+reqField+"_caption.value");	
			if (r==noOfRequired && noOfRequired!=1) reqFieldsCaption=reqFieldsCaption+' and ';		
		  	reqFieldsCaption=reqFieldsCaption+' \"'+reqFieldCaption.toUpperCase()+'\"';			
		  }		 
		  if (eval("req"+i) && i<noOfRequired-1 && r>0) reqFieldsCaption=reqFieldsCaption+", ";
	  }   
    }
	
	if (reqFieldsCaption=='')
	{		
		document.forms[form].status.value=Action;			
		document.forms[form].submit();		
	}		
	else
	{
		if (r>1) 
		{
			plural="s";
			isAre="are";	
		}
		else
		{
			plural="";
			isAre="is";	
		}
		alert("Field"+plural+' '+reqFieldsCaption+" "+isAre+" required");			
	}	
}


// OPENS A POPUP RESIZED ACCORDING TO IMAGE SIZE
function imagePopup(path)
{
  if (path)
  {
	  TopDistance = (screen.height/2)-200;
	  LeftDistance = (screen.width/2)-20;
	
	  HTML = "<html><style>body{margin:0px 0px 0px 0px}</style><body onBlur='top.close()'><img src='"+path+"' border=0 name=load_image onLoad='window.resizeTo(document.load_image.width+10,document.load_image.height+30)'></body></html>";
	  popupImage = window.open('','_blank','left='+LeftDistance+',top='+TopDistance+',width=0,height=0,toolbar=no,scrollbars=no');
	  popupImage.document.open();
	  popupImage.document.write(HTML);
	  popupImage.document.close();
  }
  else
  {
  	alert("No Image Defined.");
  }
}

function doNothing() {}


function playGame(id,wd,ht) { 
	var x = 0, y = 0; // default values
	
	if (document.all) {
	  x = (screen.width/2)-250;
	  y = (screen.height/2)-300;
	}

	window.open('/easyconsole.cfm?page=gameplayer&id='+id,'newwindow', 'top='+y+',left='+x+',toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width='+wd+',height='+ht);
}
function goToPageCalendar(state) {
	/*var x=eval("document.forms["+id);
	var y=eval(x+"].year.value");*/
	var index= document.formCalendar.year.selectedIndex;
	var lastOption=document.formCalendar.year.length
	var y= (document.formCalendar.year.options[index].value);
	if (state == '-1'){
			if(document.formCalendar.year.options[index].value > document.formCalendar.year.options[0].value)
			{	
				document.formCalendar.year.options[index].value= document.formCalendar.year.options[index].value - 1;
				document.formCalendar.submit();
			}	
		}
	else
		{
			if(document.formCalendar.year.options[index].value < document.formCalendar.year.options[6].value)
			{	
				++document.formCalendar.year.options[index].value;
				document.formCalendar.submit();
			}	
		}		
}

function goToPageMonth(month){
	f=document.forms.formCalendar;
	
	if (f.month.value==1 && month==12 && f.year.value > 2004) f.year.value=parseInt(f.year.value)-1;
	if (f.month.value==12 && month==1 && f.year.value < 2010) f.year.value=parseInt(f.year.value)+1;
	f.month.value=month;
	f.submit();

}
function goToPage(page,id) {
	f=document.forms.formCalendar;
	alert(f.year.value)
	
}







