function popup()
{
	window.open("popupSurvey.asp",null,"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no,status=no,top=150,left=200");
}

function Hilite(name,over)
  {
	  if(window.document.images) 
	  {
		  if (over)
			  window.document.images[name].src = "images/" + name + "a.gif";
		  else
			  window.document.images[name].src =  "images/" + name + ".gif";
	  }
  }
  
	/*Returns the right portion of an input string of length n.*/
	function Right(str, n){
		if (n <= 0)
		   return "";
		else if (n > String(str).length)
		   return str;
		else {
		   var iLen = String(str).length;
		   return String(str).substring(iLen, iLen - n);
		}
	}

	/*regular expression email validator*/
	function chkForEmail(value){
		var objRegExp = /^([\w]+)(.[\w]+)*@([\w]+)(.[\w]{2,3}){1,2}$/;
		if (objRegExp.test(value)) return true;
		return false;
	}
	
	/*file type validator*/
	function filterFileType(value, ext){
		var flag = true;		
		if (value.indexOf('.' + ext) == -1){
			flag = false;
		}
		if (Right(value, 3) != ext){
			flag = false;
		}
		return flag;
	}

	<!--
	function validatejoborderform(theForm)
	{
		if (trim(theForm.FirstName.value) == "")
		{
			alert("Please enter your first name.");
			theForm.FirstName.focus();
			return false;
		}

		if (trim(theForm.LastName.value) == "")
		{
			alert("Please enter your last name.");
			theForm.LastName.focus();
			return false;
		}

		if (trim(theForm.Email.value) == "")
		{
			alert("Please enter your email address.");
			theForm.Email.focus();
			return false;
		}

		if (!chkForEmail(theForm.Email.value))
		{
			alert("Please enter a valid email address.");
			theForm.Email.focus();
			return false;
		}

		if (trim(theForm.CompanyName.value) == "")
		{
			alert("Please enter your company name.");
			theForm.CompanyName.focus();
			return false;
		}

		if (trim(theForm.PositionTitle.value) == "")
		{
			alert("Please enter the position title.");
			theForm.PositionTitle.focus();
			return false;
		}

		if (theForm.Region.value == "")
		{
			alert("Please enter the region.");
			theForm.Region.focus();
			return false;
		}
		if (trim(theForm.JobTerm.value) == "")
		{
			alert("Please enter the type of position.");
			theForm.JobTerm.focus();
			return false;
		}

		if (trim(theForm.JobTerm.value) == "")
		{
			alert("Please enter a start date.");
			theForm.JobTerm.focus();
			return false;
		}

		if (trim(theForm.StartDate.value) == "")
		{
			alert("Please enter a start date.");
			theForm.StartDate.focus();
			return false;
		}

		if (!IsDate(theForm.StartDate.value))
		{
			alert("Please enter a valid start date.");
			theForm.StartDate.focus();
			return false;
		}

		if (trim(theForm.EndDate.value) == "")
		{
			alert("Please enter an end date.");
			theForm.EndDate.focus();
			return false;
		}

		if (!IsDate(theForm.EndDate.value))
		{
			alert("Please enter a valid end date.");
			theForm.EndDate.focus();
			return false;
		}

		if (!CompareStartDateEndDate(theForm.StartDate, theForm.EndDate))
		{
			theForm.StartDate.focus();
			return false;
		}

		if (trim(theForm.Description.value) == "")
		{
			alert("Please enter a Description.");
			theForm.Description.focus();
			return false;
		}

		if (theForm.Description.value.length > 1000) 
		{
			alert('Please limit job description to 1000 characters or less. Please remove '+(theForm.Description.value.length - 1000)+ ' characters');
			theForm.Description.focus();
			return false;
		}
	}
	//-->
		
/******************* The code below is for Job Portal ***********************/
	<!--
	function validateJPPostJobs(theForm)
		{
		  if ((theForm.SystemID.value == "") || (theForm.JobTitle.value == "") || (theForm.JobDescription.value == "") || (theForm.Compensation.value == "") || (theForm.Notes.value == ""))
		    {
		      alert("Please complete all fields.");
			    return false;
		    }
		  if ((theForm.Region.value == "0") || (theForm.JobType.value == "0") || (theForm.JobTerm.value == "0"))
			{
			  alert("Please answer each question.");
				return false;
			}										
          if (theForm.Notes.value.length > 500) 
		    {
	          alert('Please limit notes to 500 characters or less. Please remove '+(theForm.Notes.value.length - 500)+ ' characters');
	            return false;
			}							
		}
	//-->
	
	<!--	
	function confirmClientAdminSubmit() 
		{
			var agree=confirm("Are you sure you would like to delete this order?");
			if (agree)
				return true;
			else
				return false;
		}	
	//-->
	
	function confirmDeleteCandAdmin() 
		{
			var agree=confirm("Are you sure you want to delete this candidate?");
			if (agree)
				return true ;
			else
				return false ;
		}
	
	function checkAllSearchJobs(field)
	{
		//if only one checkbox exists, it is not an array
		if(typeof(field.length) == "undefined")
		{
			field.checked = true;
		}
		else
		{
			for (i = 0; i < field.length; i++)
				field[i].checked = true ;
		}
	}

	function uncheckAllSearchJobs(field)
	{
		//if only one checkbox exists, it is not an array
		if(typeof(field.length) == "undefined")
		{
			field.checked = false;
		}
		else
		{
			for (i = 0; i < field.length; i++)
				field[i].checked = false ;
		}
	}
	
	function confirmJPSearchJobsUpdate(field) 
	{
		var checked = false;
		if(typeof(field.length) == "undefined")
		{
			if(field.checked == true)
			{
				checked = true;
			}
		}
		else
		{
			for (i = 0; i < field.length; i++)
				if(field[i].checked == true)
				{
					checked = true;
				}
		}
		
		if(checked)
		{
			return true;
		}
		else
		{
			alert("Please check at least one checkbox before updating.");
			return false;
		}
	}
	
	function confirmJPSearchJobsDelete(field) 
	{
		var checked = false;


		if(typeof(field.length) == "undefined")
		{
			if(field.checked == true)
			{
				checked = true;
			}
		}
		else
		{
			for (i = 0; i < field.length; i++)
				if(field[i].checked == true)
				{
					checked = true;
				}
		}
		
		if(checked)
		{
		var agree = confirm("Are you sure you would like to delete these jobs?");
		if (agree)
			return true;
		else
			return false;
		}
		else
		{
			alert("Please check at least one checkbox before deleting.");
			return false;
		}
	}
	<!--	
	function confirmDeleteSingleJob() 
		{
			var agree=confirm("Are you sure you would like to delete this job?");
			if (agree)
				return true;
			else
				return false;
		}	
		//-->
		
	function validateQCAdmin()
		{		
			if (document.QCEmail.tbCompany.value == "")
		  		{
			 		alert("Please enter a client company.");
					document.QCEmail.tbCompany.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbCompany.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbCompany.style.backgroundColor = '#F0F0F0';
				}
				
			if (document.QCEmail.tbReportsTo.value == "")
		  		{
			 		alert("Please enter who the contractor reports to.");
					document.QCEmail.tbReportsTo.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbReportsTo.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbReportsTo.style.backgroundColor = '#F0F0F0';
				}
			
			if (document.QCEmail.tbContractor.value == "")
		  		{
			 		alert("Please enter the contractor's name.");
					document.QCEmail.tbContractor.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbContractor.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbContractor.style.backgroundColor = '#F0F0F0';
				}
				
			if (document.QCEmail.tbAssignment.value == "")
		  		{
			 		alert("Please enter the assignment.");
					document.QCEmail.tbAssignment.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbAssignment.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbAssignment.style.backgroundColor = '#F0F0F0';
				}
				
			if (document.QCEmail.tbWorkOrder.value == "")
		  		{
			 		alert("Please enter the work order number.");
					document.QCEmail.tbWorkOrder.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbWorkOrder.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbWorkOrder.style.backgroundColor = '#F0F0F0';
				}
				
			if ((document.QCEmail.tbUserEmail.value==null)||(document.QCEmail.tbUserEmail.value==""))
				{
					alert("Please enter your email address")
					document.QCEmail.tbUserEmail.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbUserEmail.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbUserEmail.style.backgroundColor = '#F0F0F0';
				}
				
			if (echeck(document.QCEmail.tbUserEmail.value)==false)
				{
					document.QCEmail.tbUserEmail.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbUserEmail.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbUserEmail.style.backgroundColor = '#F0F0F0';
				}
				
			if (document.QCEmail.tbSenderName.value == "")
		  		{
			 		alert("Please enter the sender's name.");
					document.QCEmail.tbSenderName.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbSenderName.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbSenderName.style.backgroundColor = '#F0F0F0';
				}
				
				
			if (document.QCEmail.tbSenderTitle.value == "")
		  		{
			 		alert("Please enter the sender's title.");
					document.QCEmail.tbSenderTitle.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbSenderTitle.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbSenderTitle.style.backgroundColor = '#F0F0F0';
				}
				
			if ((document.QCEmail.tbSenderEmail.value==null)||(document.QCEmail.tbSenderEmail.value==""))
				{
					alert("Please enter your email address")
					document.QCEmail.tbSenderEmail.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbSenderEmail.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbSenderEmail.style.backgroundColor = '#F0F0F0';
				}
				
			if (echeck(document.QCEmail.tbSenderEmail.value)==false)
				{
					document.QCEmail.tbSenderEmail.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbSenderEmail.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbSenderEmail.style.backgroundColor = '#F0F0F0';
				}
				
			if (document.QCEmail.tbSenderPhone.value == "")
		  		{
			 		alert("Please enter the sender's phone number.");
					document.QCEmail.tbSenderPhone.style.backgroundColor = '#FFFFCC';
					document.QCEmail.tbSenderPhone.focus();
					return false;
				}
			else
				{
					document.QCEmail.tbSenderPhone.style.backgroundColor = '#F0F0F0';
				}
		}
//-->

//This function is used to validate email addresses.  It is called from the validateQCAdmin() directly above.
	function echeck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Please enter a valid email address.\n(johndoe@company.com)")
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please enter a valid email address.\n(johndoe@company.com)")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please enter a valid email address.\n(johndoe@company.com)")
		    return false
		}
		if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid email address.\n(johndoe@company.com)")
		    return false
		 }
		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid email address.\n(johndoe@company.com)")
		    return false
		 }
		if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid email address.\n(johndoe@company.com)")
		    return false
		 }	 
		return true					
	}
//-->