﻿  function open_window(url)
        {
                mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=495,height=450');
        }

        function nullCheck()
        {
                 if (document.pgJobSearch.tbxLastName.value =="")
                {
                   alert("Please enter your last name.");
                   return false;
                }

                if (document.pgJobSearch.tbxEmailAddress.value =="")
                {
                   alert("Please enter your email address.");
                   return false;
                }

                return true;
        }

        function checkCriteria()
        {
                var counter=0
                for (var i=0; i < document.pgSearch.lbxCategories.length; i++)
                {
                  if (document.pgSearch.lbxCategories.options[i].selected)
                  {
                    counter++
                  }
                }

                if(counter > 5)
                {
                   alert("Sorry, but 5 categories is the maximum allowed in a search.");
                   return false;
                }

                if(counter == 0
                   && document.pgSearch.tbxKeywords.value == ""
                   && document.pgSearch.cbxDuration.selectedIndex == 0
                   && document.pgSearch.tbxCity.value == ""
                   && document.pgSearch.cbxStates.selectedIndex == 0
                   && (document.pgSearch.tbxMinSalary.value == "0"
                       || document.pgSearch.tbxMinSalary.value ==""))
                {
                   alert("Please enter search criteria.");
                   return false;
                }

                return true;
        }

        function cancel()
        {
               return true;
        }
		
		function Candlogin(robjForm)
	{
	if (!isAlpha(robjForm.txtLogLastName_txt.value)) {
		alert('Last Name can only contain values between a/A and z/Z.') 
			return void(0);}

	if(!doValidation(robjForm)){
	return void(0);}

	return document.frmPrefCandLogin.submit();
	
	}		
