    
	var sPasswordValue = "";
	
	function Conditions_Popup(sUrl)
	{
		window.open(sUrl, "conditions", "location=0,status=1,scrollbars=1,width=450,height=300");
	}

	function HiddenPanelCandidateInfo()
	{
		if (document.getElementById("DivPNLCandidateInfo"))
		{
			document.getElementById("DivPNLCandidateInfo").style.display = "none";	
		}
		if (document.getElementById("DivPNLVacancyInfo"))
		{
			document.getElementById("DivPNLVacancyInfo").style.display = "none";	
		}
	}

	function rblCV_onclick(source, arguments)
	{
		var sValue = arguments.Value;
		var oPanel = document.getElementById(source.getAttribute("pnlAttachCV"));
		//alert(sValue);
		//debugger;

		if(oPanel)
		{
			if(sValue == "Yes") oPanel.style.display = "block";         
			else oPanel.style.display = "none";
		}
		arguments.IsValid = true;
	}

    function Form_Reset()
	{	    
        document.forms[0].reset();
	}
	
	function IsMail(source, arguments)
	{
		var sValue = arguments.Value;

		//HiddenPanelCandidateInfo();
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(sValue))
		{
			arguments.IsValid = true;
		} 
		else 
		{
			arguments.IsValid = false;
		}
	}

	function IsValidPassWord(source, arguments)
	{
		var sValue = arguments.Value;

		//HiddenPanelCandidateInfo();
		sPasswordValue = sValue;		
		// /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,15}$/ Oblihga un caracter MAY/Min y un numero
		if (/^([0-9]*)([a-z]*)([A-Z]*).{8,15}$/.test(sValue))
		{			
			arguments.IsValid = true;
		} 
		else 
		{
			arguments.IsValid = false;
		}
	}
	
	function RepeatPassWord(source, arguments)
	{
		var sValue = arguments.Value;
		
		HiddenPanelCandidateInfo();
		if ((sPasswordValue != "") && (sPasswordValue == sValue))
		{
			arguments.IsValid = true;
		}
		else
		{
			arguments.IsValid = false;
		}
		
	}

	function isDigits(source, arguments){
		/* 
			Esta función comprueba si la fecha(es un string)
			con formato (dd/mm/aaaa) es correcta.
		*/
		var sValue = arguments.Value;
		
		if (/^[0-9]$/.test(sValue))
		{			
			arguments.IsValid = true;
		} 
		else 
		{
			arguments.IsValid = false;
		}
	}

	function isDigitsPhone(source, arguments){
		/* 
			Format: +3412312312 ó 3412312312
		*/
		var sValue = arguments.Value;
		
		if (/^\+?([0-9])*([0-9])$/.test(sValue))
		{			
			arguments.IsValid = true;
		} 
		else 
		{
			arguments.IsValid = false;
		}
	}
	
	function ExactDigits(source, arguments){
		/* 
			Esta función comprueba si la fecha(es un string)
			con formato (dd/mm/aaaa) es correcta.
		*/
		var sValue = arguments.Value;
		var iDigits = parseFloat(source.getAttribute("Digits"));

		if ((/^[0-9]+$/.test(sValue)) && (sValue.length == iDigits))
		{			
			arguments.IsValid = true;
		} 
		else 
		{
			arguments.IsValid = false;
		}
	}

	function MaxCharacters(source, arguments){
		/* 
			Esta función comprueba si la fecha(es un string)
			con formato (dd/mm/aaaa) es correcta.
		*/
		var sValue = arguments.Value;
		var iTotCharacters = parseFloat(source.getAttribute("TotCharacters"));

		if (sValue.length <= iTotCharacters)
		{			
			arguments.IsValid = true;
		} 
		else 
		{
			arguments.IsValid = false;
		}
	}	
	function isPhoneNumber(source, arguments){
		/* 
			Esta función comprueba si la fecha(es un string)
			con formato (dd/mm/aaaa) es correcta.
		*/
		var sValue = arguments.Value;
		
		if (/^[0-9]{14}$/.test(sValue))
		{			
			arguments.IsValid = true;
		} 
		else 
		{
			arguments.IsValid = false;
		}
	}	
	
	function isDate(source, arguments){
		/* 
			Esta función comprueba si la fecha(es un string)
			con formato (dd/mm/aaaa) es correcta.
		*/
		var intDay, intMonth, intYear;
		var dtmDate = arguments.Value;
		var charDate = ".";
		
		arguments.IsValid = false;						
		if (dtmDate == ""){return false;}
		if (parseFloat(dtmDate.length) != 10){return false;}
		if (dtmDate.slice(2,3) != charDate || dtmDate.slice(5,6) != charDate){return false;}

		intDay = dtmDate.slice(0,2);		
		intMonth = dtmDate.slice(3,5);
		intYear = dtmDate.slice(6,10);
							
		if(isNaN(intDay)){return false;}			
		if(isNaN(intMonth)){return false;}			
		if(isNaN(intYear)){return false;}			
				
		if(intYear.length < 4 || parseFloat(intYear) < 1901){return false;}
		if(parseFloat(intMonth) < 1 || parseFloat(intMonth) > 12){return false;}
				
		if(parseFloat(intDay) >= 1 && parseFloat(intDay) <= 31)
		{ 
			switch (parseFloat(intDay)) {
				case 31:
					if(parseFloat(intMonth) == 2 || parseFloat(intMonth) == 4 || parseFloat(intMonth) == 6 || parseFloat(intMonth) == 9 || parseFloat(intMonth) == 11){
						return false;
					}
				case 30:
					if(parseFloat(intMonth) == 2){return false;}
				case 29:
					if(parseFloat(intMonth) == 2){													
						if (!(parseFloat(intYear)%4 == 0 && (parseFloat(intYear)%100 != 0 || parseFloat(intYear)%400 == 0))){								
							return false;
						}
					}
			}//switch
		}//if
		else 
		{
			return false;
		}
		arguments.IsValid = true;
	}

	function isDateCompare(source, arguments)
	{				
		var sNameFROM = document.getElementById(source.getAttribute("NameFROM"));
		var sNameTO = document.getElementById(source.getAttribute("NameTO"));
		
		arguments.IsValid = true;
		
		if ((sNameFROM.value != "") && (sNameTO.value != ""))
		{
			arguments.IsValid = CompareDates(sNameFROM.value, sNameTO.value);
		}
		//alert(arguments.IsValid);
	}
	
	function CompareDates(dtmDateIni, dtmDateFin){
		var strDateIni, strDateFin;
						
		strDateIni = dtmDateIni.slice(6,10) + dtmDateIni.slice(3,5) + dtmDateIni.slice(0,2);
		strDateFin = dtmDateFin.slice(6,10) + dtmDateFin.slice(3,5) + dtmDateFin.slice(0,2);
		
		if (isNaN(strDateIni) == true && isNaN(strDateFin) == true){return false;}		
		if (parseFloat(strDateIni) < parseFloat(strDateFin)){return true;}
		
		return false;
	}