  
  function isRequiredValue(field, txt, dst) {
    if(Validator.isEmpty(txt)) {
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
    }
    else
    {
    	document.getElementById(dst).style.color = '';
  	    return true;
    }
  }

  
  function isRequiredValuePositive(field, txt, dst) {
    if(Validator.isEmpty(txt)) {
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
    }
    else
    {
  	    if(txt > 0)
  	    {
  	    	document.getElementById(dst).style.color = '';
  	    	return true;
  	    }
  	    else
  	    {
  	    	document.getElementById(dst).style.color = '#FF7546';
    		return false;
  	    }
    }
  }

  function isRequiredValueInRange(field, txt, dst, v1, v2) {
    if(Validator.isEmpty(txt)) {
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
    }
    else
    {
  	    if((txt >= v1) && (txt <= v2))
  	    {
  	    	document.getElementById(dst).style.color = '';
  	    	return true;
  	    }
  	    else
  	    {
  	    	document.getElementById(dst).style.color = '#FF7546';
    		return false;
  	    }
    }
  }

  function isValidLength(field, txt, dst, ln) {
    if(Validator.isEmpty(txt)) {
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
    }
    else
    {
    	if(txt.length < ln)
    	{
        	document.getElementById(dst).style.color = '#FF7546';
    		return false;
    	}
    	else
    	{
        	document.getElementById(dst).style.color = '';
  	    	return true;
  	    }
    }
  }
 
  function validateEmail(txt) {
	   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	   if(reg.test(txt) == false) {
	      return false;
	   }
	   else
	   {
		   return true;
	   }
	}
  
  function isValidEmail(field, txt, dst, req) {
    document.getElementById(dst).style.color = '';
  	if (req && Validator.isEmpty(txt)) {
    	document.getElementById(dst).style.color = '#FF7546';
  	    return false;
  	}
    else
    {
       if(!validateEmail(txt)) {
        	document.getElementById(dst).style.color = '#FF7546';
	    	return false;
	    }
	    else
	    {
	    	document.getElementById(dst).style.color = '';
	  	    return true;
	    }
  	}
  }

  function isValidUrl(field, txt, dst, req) {
  	if (req && Validator.isEmpty(txt)) {
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
  	}
  	else
  	{
	    if(!Validator.isAbsUrl(txt)) {
	    	document.getElementById(dst).style.color = '#FF7546';
	    	return false;
	    }
	    else
	    {
	    	document.getElementById(dst).style.color = '';
	  	    return true;
	    }
  	}
  }

  function isValidTel(field, txt, dst, req) {
  	if (req && Validator.isEmpty(txt)) {
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
  	}
  	else
  	{
	    if(!Validator.isTel(txt) || (txt.length < 6)) {
	    	document.getElementById(dst).style.color = '#FF7546';
	    	return false;
	    }
	    else
	    {
	    	document.getElementById(dst).style.color = '';
	  	    return true;
	    }
  	}
  }

  function isEqualValue(field, txt1, txt2, dst) {
    if(txt1 != txt2){
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
    }
    else
    {
    	document.getElementById(dst).style.color = '';
    	return true;
    }
  }
  
  function validateNumber(field, txt, dst, req)
  {
  	if (req && Validator.isEmpty(txt)) {
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
  	}
  	else
  	{
	    if(!Validator.isNumber(txt,dst)) {
	    	document.getElementById(dst).style.color = '#FF7546';
	    	return false;
	    }
	    else
	    {
	    	document.getElementById(dst).style.color = '';
	  	    return true;
	    }
  	}
  }
 
  function validateIntPositif(field, txt, dst, req)
  {
	if(req && (txt == ''))
	{
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
	}
	else
	{
	  	if (req && !(/^\d{0,9}?$/.test(txt))) {
	    	document.getElementById(dst).style.color = '#FF7546';
	    	return false;
	  	}
	  	else
	  	{
		    if(!(/^\d{0,9}?$/.test(txt)) && (txt!='')) {
		    	document.getElementById(dst).style.color = '#FF7546';
		    	return false;
		    }
		    else
		    {
		    	document.getElementById(dst).style.color = '';
		  	    return true;
		    }
	  	}
	}
  }
  
  function validateIntStrictPositif(field, txt, dst, req)
  {
  	if (req && !(/^\d{0,9}?$/.test(txt))) {
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
  	}
  	else
  	{
	    if((!(/^\d{0,9}?$/.test(txt)) && (txt!='')) || (txt == 0)) {
	    	document.getElementById(dst).style.color = '#FF7546';
	    	return false;
	    }
	    else
	    {
	    	document.getElementById(dst).style.color = '';
	  	    return true;
	    }
  	}
  }

  function validateFloat(field, txt, dst, req)
  {
  	if (req && !(/^\d+(\.\d{0,5})?$/.test(txt))) {
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
  	}
  	else
  	{
	    if(!(/^\d+(\.\d{0,5})?$/.test(txt)) && (txt!='')) {
	    	document.getElementById(dst).style.color = '#FF7546';
	    	return false;
	    }
	    else
	    {
	    	document.getElementById(dst).style.color = '';
	  	    return true;
	    }
  	}
  }

  function isValidFormat(field, txt, dst, req, format) {
  	if (req && Validator.isEmpty(txt)) {
    	document.getElementById(dst).style.color = '#FF7546';
    	return false;
  	}
  	else
  	{
	    if(!Validator.isFormat(txt, format)) {
	    	document.getElementById(dst).style.color = '#FF7546';
	    	return false;
	    }
	    else
	    {
	    	document.getElementById(dst).style.color = '';
	  	    return true;
	    }
  	}
  }

  function compareDate(field, date1, date2, dst)
  {
  	if (date1 == 'Today')
  	{
      date=new Date();
      y = date.getYear();
      m = date.getMonth()+1;
      strm = m+"";
      if(strm.length == 1)
      {
      	m = "0"+strm;
      }
      d = date.getDate();
      strd = d+"";
      if(strd.length == 1)
      {
      	d = "0"+strd;
      }
      
    var d1 = y+m+d;
  		
  	}
  	else
  	{
      var d1 = (date1.value).split('-').join('');
  	}
  	
    var d2 = (date2.value).split('-').join('');
    var diff = d1 - d2;
    if(diff > 0)
    {	
    	document.getElementById(dst).style.color = '#FF7546';
       return false;
    }
    else
    {
    	document.getElementById(dst).style.color = '';
    	return true;
    }
    
 } 
 
