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 menuhover (row_id) {
	row_id.style.color='000000';
	row_id.style.backgroundColor='B4B4B4';
	row_id.style.cursor='Hand';	
}

function menuout (row_id) {
	row_id.style.backgroundColor='';
}

function visit(target_id) {
   location.href='/easyconsole.cfm?id='+target_id;
}
 
function ViewProject(id) { 
	window.open('/easyconsole.cfm?id='+id, 'newwindow', 'toolbar=no,status=no,scrollbars=yes,location=no,resizable=yes,menubar=no,directories=no,width=740,height=550');
}

function ViewApplication(id) { 
	window.open('/easyconsole.cfm?id='+id, 'newwindow', 'toolbar=no,status=no,scrollbars=yes,location=no,resizable=yes,menubar=no,directories=no,width=740,height=550');
}

function enlarge(image_loc,img) {
  HTML = "<html><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');
  popupImage.document.open();
  popupImage.document.write(HTML);
  popupImage.document.close();
  obj_img = document.getElementById(img);
  obj_img.src= obj_img.src;
}

function openImage(imagelink,width,height){
	if(!width) width=709;
	if(!height) height=539;
	 popupwindow=window.open('/easyconsole.cfm?page=image_preview&image='+imagelink,'imagePreview','width='+width+',height='+height+',scrollbars=no,resizable=no');
	 popupwindow.focus();
}

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","","","");