function validate_required(field)
{
	with (field)
	{
	if (value==null||value=="")
	  {
	  	return false;
	  }
	else {
		return true;
	}
	}
}


function validate_form(thisform)
{

	alerttxt="Portions of your Application Form are missing:";

	with (thisform)
	{
	ok = true; 
	
	if (validate_required(prq_payno)==false)
	{
		alerttxt = alerttxt + "\n    Please confirm your Payroll/Employee number";
		ok = false;
	}
	
	if (validate_required(prq_fname)==false)
	{
		alerttxt = alerttxt + "\n    Please confirm your First Name";
		ok = false;
	}
	if (validate_required(prq_lname)==false)
	{
		alerttxt = alerttxt + "\n    Please confirm your Last Name";
		ok = false;
	}
	
		
	
	if (validate_required(prq_email_me)==false)
	{
			alerttxt = alerttxt + "\n    Please confirm your Email Address";
			ok = false;
	}		
	
	
	if (ok==true){
		return true;
	}
	else{
		alert(alerttxt); 
		return false;
	}

}
}

//Function to limit the text box area on the anapays.asp page to a number of chars

var max=0;
function showChar(obj)
{
	var obj3=document.getElementById("char");
	if(max==0)
	{
		max=obj3.firstChild.nodeValue*1;
	}
	len=obj.value.length;
	var cur=max*1;
	cur=cur-len;
	if(cur<0)
	{
		var obj2=document.forms[0].elements['prq_query'];
		var str=obj2.value.substring(0,max*1);
		obj2.value=str;

		var lang = document.anapay.language.value;


			switch(lang){
				case "EN":				
					alert('Input limit has been reached.');
				break;
				default:
					alert('The maximum text limit has been reached..');
				break;				
			}
		showChar(obj2,max);					
		return false;
	}
	else
	{
		var obj2=document.getElementById('char');
		var str=document.createTextNode(cur);
		obj2.replaceChild(str,obj2.firstChild);
		return true;
	}
}		
