  var strErrorMsg = ''
	  
	  function Validate(frmForm){
	  if (frmForm == 'login') {
		ValidateUsername();
		}
	  var tmpstr = new String(strErrorMsg);
	  if (tmpstr.length > 0){
			alert(tmpstr);
			tmpstr = ''
			strErrorMsg = ''
			return false;
			}
		else {
			return true;
			}
	}	
		


	function ValidateEmail(email){
			strErrorMsg='';
			var tmpstr = new String(email);
			if (tmpstr.indexOf('@',0) == -1){
				strErrorMsg = 'Incorrect email format. Please check you email address.\n';
				}
			else if (tmpstr.indexOf('.',0) == -1){
				strErrorMsg = 'Incorrect email format. Please check you email address.\n';
				}
			else if (tmpstr.indexOf(' ',0) != -1){
				strErrorMsg = 'Incorrect email format. Please check you email address.\n';
				}
				
		  if (strErrorMsg.length > 0){ return true ; }
		  else { return false ;}
		
		
		}



	function ValidateUsername(){
		if (document.LoginForm.user_email.value == '' || document.LoginForm.user_email.value == ' '){
			strErrorMsg = 'You did not fill in your Username.\n';
			}
		}



	function CheckSelection(){
	if (document.TopForm.Pos_Country.options[document.TopForm.Pos_Country.selectedIndex].value == 0){
		alert('Please select the country you wish to search.');
	return false;
	}
	else {
		return true;
		}
	}


  
	  




	
 	function PreviewSection(resid,usrid){
		var win = open("/consultants/ResumePreview.asp?ResumeID=" + resid + "&UserID=" + usrid + "&f=1%2F30%2F2003+3%3A31%3A23+PM", "", "menubar=1,resizable=1,scrollbars=1,width=600,height=450");
		return false;
		}
		

	function PreviewResume(){
		var win = open("interactive.asp", "", "menubar=0,resizable=0,scrollbars=1,width=600,height=450");
		return false;
		}


	function lookupCountry(inForm) {
		inForm.lookup_country.value = "Select";
		inForm.submit();
	}




function CheckDates(){
var StartDate = 0;
var FinishDate = 0;
var StartYear = document.SaveForm.yearStart.options[document.SaveForm.yearStart.selectedIndex].value;
var StartMonth = document.SaveForm.monthStart.options[document.SaveForm.monthStart.selectedIndex].value;
var StartDay = document.SaveForm.dayStart.options[document.SaveForm.dayStart.selectedIndex].value;
var FinishYear = document.SaveForm.yearFinished.options[document.SaveForm.yearFinished.selectedIndex].value;
var FinishMonth = document.SaveForm.monthFinished.options[document.SaveForm.monthFinished.selectedIndex].value;
var FinishDay = document.SaveForm.dayFinished.options[document.SaveForm.dayFinished.selectedIndex].value;
var blnGreaterErr;
var blnSameErr;

	if (FinishYear != '9999'){
		StartDate =  new Date(StartYear, StartMonth, StartDay);
		FinishDate = new Date(FinishYear, FinishMonth, FinishDay); 

		if (StartDate >= FinishDate) {
			alert('The finish date must be after the start date. Please enter the correct start and finish dates!');
			return false;
			}
		if (StartMonth == 4 || StartMonth == 6 || StartMonth == 9 || StartMonth == 11){
			if (StartDay == 31){
				alert('The selected start month only has 30 days!');
				return false;
				}
			}
		if (FinishMonth == 4 || FinishMonth == 6 || FinishMonth == 9 || FinishMonth == 11){
			if (FinishDay == 31){
				alert('The selected finish month only has 30 days!');
				return false;
				}
			}
		if (StartMonth == 2){
			if (LeapYear(StartYear)) {
				if (StartDay > 29) {
					alert('February in the selected year only has 29 days!');
					return false;
					}
				}
			else if (StartDay > 28) {
				alert('February in the selected year only has 28 days!');
				return false;
				}
			}
		if (FinishMonth == 2){
			if (LeapYear(FinishYear)) {
				if (FinishDay > 29) {
					alert('February in the selected year only has 29 days!');
					return false;
					}
				}
			else if (FinishDay > 28) {
				alert('February in the selected year only has 28 days!');
				return false;
				}
			}
		}
	return true;
	}


function LeapYear(intYear) {
	if (intYear % 100 == 0) {
	if (intYear % 400 == 0) { 
		return true; 
		}
	}
	else {
		if ((intYear % 4) == 0) { 
			return true; 
			}
		}
		return false;
	}
	
	
	
	
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ext.";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function ValidatePhone(Phone){
	if ((Phone==null)||(Phone=="")){
		return false
	}
	if (checkInternationalPhone(Phone)==false){
		return false
	}
	return true
 }