// JScript File
    var FTRSEP = ';';
    var PRICESEP = ',';
    var LANGSEP = ':';
    var TITLESEP = '#'; 
    var iChars = ";#,:";
    var reg = /^\d+(\.\d+)?$/;
    var bln;
// Function to check mail address: requires object as parameter 

function IsValidEmail(txtEmailId)
{
   var tomatch= new RegExp("\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"); 
   
    if (tomatch.test(txtEmailId.value)==false)
    {       
		return false;
	}
    return true;
}


function isInteger (s)
{
    var i;
    //alert(s);
    if (isEmpty(s))
    if (isInteger.arguments.length == 1) return 0;
    else return (isInteger.arguments[1] == true);

    for (i = 0; i < s.length; i++)
    {
        var c = s.charAt(i);
        if (!isDigit(c)) return false;
    }
    return true;
}

function isEmpty(s)
{
    return ((s == null) || (s.length == 0))  
}

function isDigit (c)
{
    return ((c >= "0") && (c <= "9"))
}

//function checkMail(x)
//{
//	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
//	if (!filter.test(x))
//	{
//	    return false;
//	}
//	return true;
//}
function emailCheck (emailStr)
{
    var emailPat=/^(.+)@(.+)$/
    var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
    var validChars="\[^\\s" + specialChars + "\]"
    var quotedUser="(\"[^\"]*\")"
    var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
    var atom=validChars + '+'
    var word="(" + atom + "|" + quotedUser + ")"
    var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
    var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

    var matchArray=emailStr.match(emailPat)
    if (matchArray==null)
    {
	    return false;
    }
    var user=matchArray[1]
    var domain=matchArray[2]

    // See if "user" is valid 
    if (user.match(userPat)==null)
    {
        // user is not valid
        return false;
    }
    var IPArray=domain.match(ipDomainPat)
    if (IPArray!=null)
    {
        // this is an IP address
	      for (var i=1;i<=4;i++)
	      {
	        if (IPArray[i]>255)
	        {
		        return false;
	        }
        }
        return true
    }

    // Domain is symbolic name
    var domainArray=domain.match(domainPat)
    if (domainArray==null)
    {
        return false;
    }
    var atomPat=new RegExp(atom,"g")
    var domArr=domain.match(atomPat)
    var len=domArr.length
    if (domArr[domArr.length-1].length < 2 || domArr[domArr.length-1].length > 3)
    {
       // the address must end in a two letter or three letter word.
       return false;
    }
    // Make sure there's a host name preceding the domain.
    if (len<2)
    {
       return false;
    }
// If we've gotten this far, everything's valid!
return true;
}
//Website Url Validation checking
function IsValidUrl(FieldValue)
{
    var theurl=FieldValue.value;
    var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/;
    if (tomatch.test(theurl))
    {
       return true;
    }
    else
    {
       return false; 
    }
}
//us phone validation
function IsValidUSPhone(strFieldName)
{
    var strValue = strFieldName.value;     
    var objRegExp  =/^((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}$/;
     if(!objRegExp.test(strValue))
      {
          alert("Invalid phone number.");
          return false;
      }
      else
      {
          return true;
      }
}
//Validate US Zip checking
function IsValidUSZip(strFieldName)
{
    var strValue = strFieldName.value;     
     var objRegExp  =/^\d{5}(-\d{4})?$/;
     if(!objRegExp.test(strValue))
	  {
	      alert("Invalid zip code.");
	      return false;
	  }
	  else
	  {
	      return true;
	  }  
}
//check blank
function isblank(strval)
{
    var found=false;
    var str=strval.value;
    var len = str.length;
    for (var i = 0; i < len; i++)
    {
        if (str.charAt(i)!=" ")
        {
	        found=true;
	       	break;	            // If the is any non-space character, isblank() returns false
        }
    }
    if(found==true)
    {
        return true;
    }
    else
    {
        return false;
    }    
}

function IsPureInteger(ParamTxtobj)
{
	var makename=ParamTxtobj;
	var ascCode,i,strRet;
	var isError,makenameval;
	makenameval=makename.value.toLowerCase();
	strRet="";
	for(i=0;i<makenameval.length;i++)
	{   
		ascCode=makenameval.charCodeAt(i);	
		//10 - end		
		//47-57 - numeric(0-9)			
		//96-123 - small letter
		if(ascCode==10 || ascCode>47 && ascCode<58)
		{	
			isError=false; 
		}
		else
		{
			isError=true;
		}		
		if(isError==true) 
		    break;
	}
	if (isError==true) 
	{
		return false;
	}
	else
	{
		return true;
	}
}

function ValidateFieldsForCustomer(var1,var2,var3,var4,var5,var6,var7,var8,var9,var10,var11,var12)
{
    var VarCustName=document.getElementById(var1);
    var VarPhone=document.getElementById(var2);
    var VarMobile=document.getElementById(var3);
    var VarEmail=document.getElementById(var4);
    var VarWebUrl=document.getElementById(var5);
    var VarStreet=document.getElementById(var6);
    var VarCity=document.getElementById(var7);
    var VarState=document.getElementById(var8);
    var VarZip=document.getElementById( var9);
    var VarPassword=document.getElementById(var10);
    var VarConfirmPassword=document.getElementById(var11);
    var VarAffiliateUrl=document.getElementById(var12);

    //checking for Customer name    
    if(VarCustName.disabled==false)
    {
        if(VarCustName.value == '')
        {
            alert('Please enter customer name.');
            VarCustName.focus();
            return false;
        }
        else if(isblank(VarCustName)==false)
        {    
            alert('Blank space is not allowed.');
            VarCustName.focus();
            //VarCustName.value="";
            return false;
        }
    }
    //checking US phone number
    if(VarPhone.disabled==false)
    {
        if(VarPhone.value!='')
        {
            if(isblank(VarPhone)==false)
            {    
                alert('Blank space is not allowed.');
                VarPhone.focus();
                //VarPhone.value="";
                return false;
            }
//            else if(IsValidUSPhone(VarPhone)==false)
//            {
//                VarPhone.focus();
//                VarPhone.value="";
//                return false;
//            }
        }
        else
        {
            alert('Please enter phone number.');
            VarPhone.focus();
            return false;
        }
     }
     
    //checking mobile no.
    if(VarMobile.disabled==false)
    {
        if(VarMobile.value!='')
        {
            if(isblank(VarMobile)==false)
            {    
                alert('Blank space is not allowed.');
                VarMobile.focus();
                //VarMobile.value="";
                return false;
            }
//            else if(isNaN(VarMobile.value))
//            {
//                alert('Mobile number should be numeric.');
//                VarMobile.focus();
//                //VarMobile.value="";
//                return false; 
//            }
//            else if(VarMobile.value.length!=11)
//            {
//                alert('Mobile number should have 11 digits.');
//                VarMobile.focus();
//                return false; 
//            }
        }        
    }
    //checking for EmailId
    if(VarEmail.disabled==false)
    {
        if(VarEmail.value == '')
        {
           alert('Please enter customer email id.');
           VarEmail.focus();
           return false;
        }
        else if(isblank(VarEmail)==false)
        {    
            alert('Blank space is not allowed.');
            VarEmail.focus();
            //VarEmail.value="";
            return false;
        }
        else if(IsValidEmail(VarEmail) == false)
        {
        alert('Please enter valid customer email id.');
        VarEmail.focus();
        //VarEmail.value="";
        return false;
        }
    }
   //checking for Url
//   if(VarWebUrl.disabled==false)
//    {
//        if(VarWebUrl.value!='')
//        {
//            if(IsValidUrl(VarWebUrl)==false)
//            {
//                alert('Please enter valid Url.');
//                VarWebUrl.focus();
//                //VarWebUrl.value="";
//                return false;
//            }
//        }
//   }
 //checking for Street 
    if(VarStreet.disabled==false)
    { 
       if(VarStreet.value == '')
        {
           alert('Please enter street.');
           VarStreet.focus();
           return false;
        }
        else if(isblank(VarStreet)==false)
        {    
            alert('Blank space is not allowed.');
            VarStreet.focus();
            //VarStreet.value="";
            return false;
        }
    }
//checking for city 
    if(VarCity.disabled==false)
    {
       if(VarCity.value == '')
        {
           alert('Please enter city.');
           VarCity.focus();
           return false;
        }
        else if(isblank(VarCity)==false)
        {    
            alert('Blank space is not allowed.');
            VarCity.focus();
            //VarCity.value="";
            return false;
        }
    }
   //checking for State
   if(VarState.disabled==false)
    {
       if(VarState.value == '')
        {
           alert('Please enter state.');
           VarState.focus();
           return false;
        }
        else if(isblank(VarState)==false)
        {    
            alert('Blank space is not allowed.');
            VarState.focus();
            //VarState.value="";
            return false;
        }
    }
     //checking for zip
    if(VarZip.disabled==false)
    {
       if(VarZip.value == '')
        {
           alert('Please enter zip.');
           VarZip.focus();
           return false;
        }
        else if(isblank(VarZip)==false)
        {    
            alert('Blank space is not allowed.');
            VarZip.focus();
            //VarZip.value="";
            return false;
        }
//        else if(IsValidUSZip(VarZip)==false)
//        {
//            VarZip.focus();
//            VarZip.value="";
//            return false;   
//        }
    }
//    if(isblank(VarAffiliateUrl)==true)
//    {  
//         if(IsValidUrl(VarAffiliateUrl)==false)
//         {
//            alert('Please enter valid Url.');
//            VarAffiliateUrl.focus();
//            //VarAffiliateUrl.value="";
//            return false;
//         }
//    }
    //checking for password
   if(VarPassword.disabled==false)
    { 
       if(VarPassword.value == '')
        {
           alert('Please enter password.');
           VarPassword.focus();
           return false;
        }
        else if(isblank(VarPassword)==false)
        {    
            alert('Blank space is not allowed.');
            VarPassword.focus();
            //VarPassword.value="";
            return false;
        }
        else if((VarPassword.value.length<6) || (VarPassword.value.length>20))
        {
           alert('Please enter password between 6 to 20 character.');
           VarPassword.focus();
           //VarPassword.value="";
           return false;
        }
    }
  //checking for confirm password
  if(VarConfirmPassword.disabled==false)
    { 
       if(VarConfirmPassword.value == '')
        {
           alert('Please enter confirm password.');
           VarConfirmPassword.focus();
           return false;
        }
        else if(isblank(VarConfirmPassword)==false)
        {    
            alert('Blank space is not allowed.');
            VarConfirmPassword.focus();
            VarConfirmPassword.value="";
            return false;
        }
        else if((VarConfirmPassword.value.length<6) || (VarConfirmPassword.value.length>20))
        {
           alert('Please enter confirm password between 6 to 20 character.');
           VarConfirmPassword.focus();
           VarConfirmPassword.value="";
           return false;
        }
    }
    //checking same confirm password with password field
    if(VarConfirmPassword.value != VarPassword.value)
    {
       alert('password and confirm password should be same.');
       VarConfirmPassword.focus();
       VarConfirmPassword.value="";
       return false;
    }
 return true;     
}

function ValidateFieldsForCustomerAdmin(var1,var2,var3,var4,var5,var6,var7,var8,var9,var10,var11,var12,bksUserName,bksPassword)
{
    var VarCustName=document.getElementById(var1);
    var VarPhone=document.getElementById(var2);
    var VarMobile=document.getElementById(var3);
    var VarEmail=document.getElementById(var4);
    var VarWebUrl=document.getElementById(var5);
    var VarStreet=document.getElementById(var6);
    var VarCity=document.getElementById(var7);
    var VarState=document.getElementById(var8);
    var VarZip=document.getElementById( var9);
    var VarPassword=document.getElementById(var10);
    var VarConfirmPassword=document.getElementById(var11);
    var VarAffiliateUrl=document.getElementById(var12);
    var bksUserName1=document.getElementById(bksUserName);
    var bksPassword1=document.getElementById(bksPassword);

    //checking for Customer name    
    if(VarCustName.disabled==false)
    {
        if(VarCustName.value == '')
        {
            alert('Please enter customer name.');
            VarCustName.focus();
            return false;
        }
        else if(isblank(VarCustName)==false)
        {    
            alert('Blank space is not allowed.');
            VarCustName.focus();
            //VarCustName.value="";
            return false;
        }
     }
    //checking US phone number
    if(VarPhone.disabled==false)
    {
        if(VarPhone.value!='')
        {
            if(isblank(VarPhone)==false)
            {    
                alert('Blank space is not allowed.');
                VarPhone.focus();
                //VarPhone.value="";
                return false;
            }
//            else if(IsValidUSPhone(VarPhone)==false)
//            {
//                VarPhone.focus();
//                VarPhone.value="";
//                return false;
//            }
        }
        else
        {
            alert('Please enter phone number.');
            VarPhone.focus();
            return false;
        }
     }
     
    //checking mobile no.
    if(VarMobile.disabled==false)
    {
        if(VarMobile.value!='')
        {
            if(isblank(VarMobile)==false)
            {    
            alert('Blank space is not allowed.');
            VarMobile.focus();
            //VarMobile.value="";
            return false;
            }
            else if(isNaN(VarMobile.value))
            {
                alert('Mobile number should be numeric.');
                VarMobile.focus();
                //VarMobile.value="";
                return false; 
            }
            else if(VarMobile.value.length!=11)
            {
                alert('Mobile number should have 11 digits.');
                VarMobile.focus();
                return false; 
            }
        }
        
    }
    //checking for EmailId
    if(VarEmail.disabled==false)
    {
        if(VarEmail.value == '')
        {
           alert('Please enter customer email id.');
           VarEmail.focus();
           return false;
        }
        else if(isblank(VarEmail)==false)
        {    
            alert('Blank space is not allowed.');
            VarEmail.focus();
            //VarEmail.value="";
            return false;
        }
        else if(IsValidEmail(VarEmail) == false)
        {
        alert('Please enter valid customer email id.');
        VarEmail.focus();
        //VarEmail.value="";
        return false;
        }
    }
   //checking for Url
   if(VarWebUrl.disabled==false)
    {
      
       if(VarWebUrl.value!='')
       {
       if(IsValidUrl(VarWebUrl)==false)
        {
            alert('Please enter valid Url.');
            VarWebUrl.focus();
            //VarWebUrl.value="";
            return false;
        }
       }
   }
 //checking for Street 
    if(VarStreet.disabled==false)
    { 
       if(VarStreet.value == '')
        {
           alert('Please enter street.');
           VarStreet.focus();
           return false;
        }
        else if(isblank(VarStreet)==false)
        {    
            alert('Blank space is not allowed.');
            VarStreet.focus();
            //VarStreet.value="";
            return false;
        }
    }
//checking for city 
    if(VarCity.disabled==false)
    {
       if(VarCity.value == '')
        {
           alert('Please enter city.');
           VarCity.focus();
           return false;
        }
        else if(isblank(VarCity)==false)
        {    
            alert('Blank space is not allowed.');
            VarCity.focus();
            //VarCity.value="";
            return false;
        }
    }
   //checking for State
   if(VarState.disabled==false)
    {
       if(VarState.value == '')
        {
           alert('Please enter state.');
           VarState.focus();
           return false;
        }
        else if(isblank(VarState)==false)
        {    
            alert('Blank space is not allowed.');
            VarState.focus();
            //VarState.value="";
            return false;
        }
    }
     //checking for zip
    if(VarZip.disabled==false)
    {
       if(VarZip.value == '')
        {
           alert('Please enter zip.');
           VarZip.focus();
           return false;
        }
        else if(isblank(VarZip)==false)
        {    
            alert('Blank space is not allowed.');
            VarZip.focus();
            //VarZip.value="";
            return false;
        }
//        else if(IsValidUSZip(VarZip)==false)
//        {
//            VarZip.focus();
//            VarZip.value="";
//            return false;   
//        }
    }
    if(isblank(VarAffiliateUrl)==true)
    {  
         if(IsValidUrl(VarAffiliateUrl)==false)
         {
            alert('Please enter valid Url.');
            VarAffiliateUrl.focus();
            //VarAffiliateUrl.value="";
            return false;
         }
    }
    //checking for password
   if(VarPassword.disabled==false)
    { 
       if(VarPassword.value == '')
        {
           alert('Please enter password.');
           VarPassword.focus();
           return false;
        }
        else if(isblank(VarPassword)==false)
        {    
            alert('Blank space is not allowed.');
            VarPassword.focus();
            //VarPassword.value="";
            return false;
        }
        else if((VarPassword.value.length<6) || (VarPassword.value.length>20))
        {
           alert('Please enter password between 6 to 20 character.');
           VarPassword.focus();
           //VarPassword.value="";
           return false;
        }
    }
  //checking for confirm password
  if(VarConfirmPassword.disabled==false)
    { 
       if(VarConfirmPassword.value == '')
        {
           alert('Please enter confirm password.');
           VarConfirmPassword.focus();
           return false;
        }
        else if(isblank(VarConfirmPassword)==false)
        {    
            alert('Blank space is not allowed.');
            VarConfirmPassword.focus();
            VarConfirmPassword.value="";
            return false;
        }
        else if((VarConfirmPassword.value.length<6) || (VarConfirmPassword.value.length>20))
        {
           alert('Please enter confirm password between 6 to 20 character.');
           VarConfirmPassword.focus();
           VarConfirmPassword.value="";
           return false;
        }
    }
    //checking same confirm password with password field
    if(VarConfirmPassword.value != VarPassword.value)
    {
       alert('password and confirm password should be same.');
       VarConfirmPassword.focus();
       VarConfirmPassword.value="";
       return false;
    }
    
    //check backup server name...
    if(bksUserName1.disabled==false)
    {
        if(bksUserName1.value == '')
        {
            alert('Please enter backup server user name.');
            bksUserName1.focus();
            return false;
        }
        else if(isblank(bksUserName1)==false)
        {    
            alert('Blank space is not allowed.');
            bksUserName1.focus();
            //VarCustName.value="";
            return false;
        }
     }
     
    //check backup server password...
    if(bksPassword1.disabled==false)
    {
        if(bksPassword1.value == '')
        {
            alert('Please enter backup server user name.');
            bksPassword1.focus();
            return false;
        }
        else if(isblank(bksPassword1)==false)
        {    
            alert('Blank space is not allowed.');
            bksPassword1.focus();
            //VarCustName.value="";
            return false;
        }
     }
    
 return true;     
}
function ValidateFieldsPackage(ServiceType,PkgTitleUs,PkgTitleUk,PkgTitleHeb,MonthUsd,
    MonthGbp,MonthShekel,QtrUsd,QtrGbp,QtrShekel,AnnumUsd,AnnumGbp,AnnumShekel)
{
    var ServiceType1=document.getElementById(ServiceType);
    var PkgTitleUs1=document.getElementById(PkgTitleUs);
    var PkgTitleUk1=document.getElementById(PkgTitleUk);
    var PkgTitleHeb1=document.getElementById(PkgTitleHeb);
    var MonthUsd1=document.getElementById(MonthUsd);
    var MonthGbp1=document.getElementById(MonthGbp);
    var MonthShekel1=document.getElementById(MonthShekel);
    var QtrUsd1=document.getElementById(QtrUsd);
    var QtrGbp1=document.getElementById(QtrGbp);
    var QtrShekel1=document.getElementById(QtrShekel);
    var AnnumUsd1=document.getElementById(AnnumUsd);
    var AnnumGbp1=document.getElementById(AnnumGbp);
    var AnnumShekel1=document.getElementById(AnnumShekel);
    
    //check service type...
    if (ServiceType1.selectedIndex == 0)
    {
        alert('Please select a service.');
        ServiceType1.focus();
        return false;
    }
    //check titles for us
    if(PkgTitleUs1.value=='')
    {
        alert('Title can not be blank.');
        PkgTitleUs1.focus();
        return false;
    }
    if(isblank(PkgTitleUs1)==false)
    {    
        alert('Blank space is not allowed.');
        PkgTitleUs1.focus();
        PkgTitleUs1.value="";
        return false;
    }
    if(isNaN(PkgTitleUs1.value)==false)
    {
        alert('Title can not be numeric.');
        PkgTitleUs1.focus();
        return false;
    }
    for (var i = 0; i < PkgTitleUs1.value.length; i++)
    {
  	    if (iChars.indexOf(PkgTitleUs1.value.charAt(i)) != -1)
  	    {
  	    alert ("You can not insert special character.");
  	    PkgTitleUs1.focus();
  	    return false;
  	    }
    }
    //check title for uk
    if(PkgTitleUk1.value=='')
    {
        alert('Title can not be blank.');
        PkgTitleUk1.focus();
        return false;
    }
    if(isblank(PkgTitleUk1)==false)
    {    
        alert('Blank space is not allowed.');
        PkgTitleUk1.focus();
        PkgTitleUk1.value="";
        return false;
    }
    if(isNaN(PkgTitleUk1.value)==false)
    {
        alert('Title can not be numeric.');
        PkgTitleUk1.focus();
        return false;
    }
    for (var i = 0; i < PkgTitleUk1.value.length; i++)
    {
  	    if (iChars.indexOf(PkgTitleUk1.value.charAt(i)) != -1)
  	    {
  	    alert ("You can not insert special character.");
  	    PkgTitleUk1.focus();
  	    return false;
  	    }
    }
    //check title for hebrew
    if(PkgTitleHeb1.value=='')
    {
        alert('Title can not be blank.');
        PkgTitleHeb1.focus();
        return false;
    }
    if(isblank(PkgTitleHeb1)==false)
    {    
        alert('Blank space is not allowed.');
        PkgTitleHeb1.focus();
        PkgTitleHeb1.value="";
        return false;
    }
    if(isNaN(PkgTitleHeb1.value)==false)
    {
        alert('Title can not be numeric.');
        PkgTitleHeb1.focus();
        return false;
    }
    for (var i = 0; i < PkgTitleHeb1.value.length; i++)
    {
  	    if (iChars.indexOf(PkgTitleHeb1.value.charAt(i)) != -1)
  	    {
  	    alert ("You can not insert special character.");
  	    PkgTitleHeb1.focus();
  	    return false;
  	    }
    }
    //check features
    var tag=false;
    elm=document.forms[0].elements;
    for(i=0;i<elm.length;i++)
    {
         if(elm[i].type=="checkbox")
         {
               if(elm[i].checked==true)
               tag=true;
         }
         if(tag==false)
         {
              alert("Please select atleast one feature.");
              return false; 
         }
    }
    //check monthly us price
    if(MonthUsd1.value=='')
    {
        alert('Monthly US price can not be blank.');
        MonthUsd1.focus();
        return false;
    }
    if(reg.test(MonthUsd1.value)==false)
    {
        alert('Please enter decimal value.');
        MonthUsd1.focus();
        return false;
    }
    //check monthly uk price
    if(MonthGbp1.value=='')
    {
        alert('Monthly UK price can not be blank.');
        MonthGbp1.focus();
        return false;
    }
    if(reg.test(MonthGbp1.value)==false)
    {
        alert('Please enter decimal value.');
        MonthGbp1.focus();
        return false;
    }
    //check monthly hebrew price
    if(MonthShekel1.value=='')
    {
        alert('Monthly Israelishekel price can not be blank.');
        MonthShekel1.focus();
        return false;
    }
    if(reg.test(MonthShekel1.value)==false)
    {
        alert('Please enter decimal value.');
        MonthShekel1.focus();
        return false;
    }
    //check quaterly us price
    if(QtrUsd1.value=='')
    {
        alert('Quarterly US price can not be blank.');
        QtrUsd1.focus();
        return false;
    }
    if(reg.test(QtrUsd1.value)==false)
    {
        alert('Please enter decimal value.');
        QtrUsd1.focus();
        return false;
    }
    //check quaterly uk price
    if(QtrGbp1.value=='')
    {
        alert('Quarterly UK price can not be blank.');
        QtrGbp1.focus();
        return false;
    }
    if(reg.test(QtrGbp1.value)==false)
    {
        alert('Please enter decimal value.');
        QtrGbp1.focus();
        return false;
    }
    //check quaterly israell price
    if(QtrShekel1.value=='')
    {
        alert('Quarterly Israelishekel price can not be blank.');
        QtrShekel1.focus();
        return false;
    }
    if(reg.test(QtrShekel1.value)==false)
    {
        alert('Please enter decimal value.');
        QtrShekel1.focus();
        return false;
    }
    //check annualy US price
    if(AnnumUsd1.value=='')
    {
        alert('Annualy US price can not be blank.');
        AnnumUsd1.focus();
        return false;
    }
    if(reg.test(AnnumUsd1.value)==false)
    {
        alert('Please enter decimal value.');
        AnnumUsd1.focus();
        return false;
    }
    //check annualy UK price
    if(AnnumGbp1.value=='')
    {
        alert('Annualy UK price can not be blank.');
        AnnumGbp1.focus();
        return false;
    }
    if(reg.test(AnnumGbp1.value)==false)
    {
        alert('Please enter decimal value.');
        AnnumGbp1.focus();
        return false;
    }
    //check annualy israell price
    if(AnnumShekel1.value=='')
    {
        alert('Annualy Israelishekel price can not be blank.');
        AnnumShekel1.focus();
        return false;
    }
    if(reg.test(AnnumShekel1.value)==false)
    {
        alert('Please enter decimal value.');
        AnnumShekel1.focus();
        return false;
    }
    return true;
}

function ValidateFieldsSupportPackage(TitleUs,TitleUk,TitleHebrew,PriceUS,PriceUk,PriceHebrew)
{
    var TitleUs1=document.getElementById(TitleUs);
    var TitleUk1=document.getElementById(TitleUk);
    var TitleHebrew1=document.getElementById(TitleHebrew);
    var PriceUS1=document.getElementById(PriceUS);
    var PriceUk1=document.getElementById(PriceUk);
    var PriceHebrew1=document.getElementById(PriceHebrew);
    
    //check titles for us
    if(TitleUs1.value=='')
    {
        alert('Please enter US title.');
        TitleUs1.focus();
        return false;
    }
    if(isblank(TitleUs1)==false)
    {    
        alert('Blank space is not allowed.');
        TitleUs1.focus();
        TitleUs1.value="";
        return false;
    }
    if(isNaN(TitleUs1.value)==false)
    {
        alert('Title can not be numeric.');
        TitleUs1.focus();
        return false;
    }
    for (var i = 0; i < TitleUs1.value.length; i++)
    {
  	    if (iChars.indexOf(TitleUs1.value.charAt(i)) != -1)
  	    {
  	    alert ("You can not insert special character in the US title.");
  	    TitleUs1.focus();
  	    return false;
  	    }
    }
    //check monthly us price
    if(PriceUS1.value=='')
    {
        alert('US Price can not be blank.');
        PriceUS1.focus();
         return false;
    }
    if(reg.test(PriceUS1.value)==false)
    {
        alert('Please enter decimal value.');
        PriceUS1.focus();
        return false;
    }
    //check title for uk
    if(TitleUk1.value=='')
    {
        alert('Please enter UK title.');
        TitleUk1.focus();
        return false;
    }
    if(isblank(TitleUk1)==false)
    {    
        alert('Blank space is not allowed.');
        TitleUk1.focus();
        TitleUk1.value="";
        return false;
    }
    if(isNaN(TitleUk1.value)==false)
    {
        alert('Title can not be numeric.');
        TitleUk1.focus();
        return false;
    }
    for (var i = 0; i < TitleUk1.value.length; i++)
    {
  	    if (iChars.indexOf(TitleUk1.value.charAt(i)) != -1)
  	    {
  	    alert ("You can not insert special character in the UK title.");
  	    TitleUk1.focus();
  	    return false;
  	    }
    }
    //check monthly uk price
    if(PriceUk1.value=='')
    {
        alert('UK price can not be blank.');
        PriceUk1.focus();
        return false;
    }
    if(reg.test(PriceUk1.value)==false)
    {
        alert('Please enter decimal value.');
        PriceUk1.focus();
        return false;
    }
    //check title for hebrew
    if(TitleHebrew1.value=='')
    {
        alert('Please enter Hebrew title.');
        TitleHebrew1.focus();
        return false;
    }
    if(isblank(TitleHebrew1)==false)
    {    
        alert('Blank space is not allowed.');
        TitleHebrew1.focus();
        TitleHebrew1.value="";
        return false;
    }
    if(isNaN(TitleHebrew1.value)==false)
    {
        alert('Title can not be numeric.');
        TitleHebrew1.focus();
        return false;
    }
    for (var i = 0; i < TitleHebrew1.value.length; i++)
    {
  	    if (iChars.indexOf(TitleHebrew1.value.charAt(i)) != -1)
  	    {
  	    alert ("You can not insert special character in the Hebrew title.");
  	    TitleHebrew1.focus();
  	    return false;
  	    }
    }
    //check monthly hebrew price
    if(PriceHebrew1.value=='')
    {
        alert('Israelshekel price can not be blank.');
        PriceHebrew1.focus();
        return false;
    }
    if(reg.test(PriceHebrew1.value)==false)
    {
        alert('Please enter decimal value.');
        PriceHebrew1.focus();
        return false;
    }
    return true;     
}

function ValidateFieldsTestimonial(ClientName,Message)
{
    var ClientName1=document.getElementById(ClientName);
    var Message1=document.getElementById(Message);   
   
    if(ClientName1.value=='')
    {
        alert('Please enter client name.');
        ClientName1.focus();
        return false;
    }
    if(isblank(ClientName1)==false)
    {    
        alert('Blank space is not allowed.');
        ClientName1.focus();        
        return false;
    }
    if(isNaN(ClientName1.value)==false)
    {
        alert('Client name can not be numeric.');
        ClientName1.focus();
        return false;
    }  
    if(Message1.value=='')
    {
        alert('Please enter message.');
        Message1.focus();
        return false;
    }
    if(isblank(Message1)==false)
    {    
        alert('Blank space is not allowed.');
        Message1.focus();        
        return false;
    }
    else if(Message1.value.length > 2000)
    {
        alert('Can not enter more than 2048 characters.');
        Message1.focus();        
        return false;
    }  
    return true;     
}
function validateFieldsFeature()
{
    var TitleUs1=document.getElementById("txtTitleUs");
    var TitleUk1=document.getElementById("txtTitleUk");
    var TitleHebrew1=document.getElementById("txtTitleHebrew");
    var storageSpace=document.getElementById("txtSpace");
    var unit=document.getElementById("ddlUnit");

    if(TitleUs1.value == '')
    {
        alert('This field can\'t be left blank.');
        TitleUs1.focus();
        return false;
    }
    else if(isblank(TitleUs1)==false)
    {    
        alert('Blank space is not allowed.');
        TitleUs1.focus();
        TitleUs1.value="";
        return false;
    }
    for (var i = 0; i < TitleUs1.value.length; i++)
    {
  	    if (iChars.indexOf(TitleUs1.value.charAt(i)) != -1)
  	    {
  	    alert ("You can not insert special character.");
  	    TitleUs1.focus();
  	    return false;
  	    }
    }
    if(TitleUk1.value == '')
    {
        alert('This field can\'t be left blank.');
        TitleUk1.focus();
        return false;
    }
    else if(isblank(TitleUk1)==false)
    {    
        alert('Blank space is not allowed.');
        TitleUk1.focus();
        TitleUk1.value="";
        return false;
    }
    for (var i = 0; i < TitleUk1.value.length; i++)
    {
  	    if (iChars.indexOf(TitleUk1.value.charAt(i)) != -1)
  	    {
  	    alert ("You can not insert special character.");
  	    TitleUk1.focus();
  	    return false;
  	    }
    }
   if(TitleHebrew1.value == '')
    {
        alert('This field can\'t be left blank.');
        TitleHebrew1.focus();
        return false;
    }
    else if(isblank(TitleHebrew1)==false)
    {    
        alert('Blank space is not allowed.');
        TitleHebrew1.focus();
        TitleHebrew1.value="";
        return false;
    }
    for (var i = 0; i < TitleHebrew1.value.length; i++)
    {
  	    if (iChars.indexOf(TitleHebrew1.value.charAt(i)) != -1)
  	    {
  	    alert ("You can not insert special character.");
  	    TitleHebrew1.focus();
  	    return false;
  	    }
    }
    if(storageSpace.value=='')
    {
        alert('Storage space can not be blank.');
        storageSpace.focus();
        return false;
    }
    if(reg.test(storageSpace.value)==false)
    {
        alert('Please enter decimal value.');
        storageSpace.focus();
        return false;
    }
    if (unit.selectedIndex == 0)
    {
        alert('Please select unit.');
        unit.focus();
        return false;
    }
    return true;
}


function validateFieldsContactUs(Name,Email,Remarks)
{
    var Name1=document.getElementById(Name);
    var Email1=document.getElementById(Email);
    var Remarks1=document.getElementById(Remarks);
    if(Name1.value=='')
    {
        alert('Please enter your name.');
        Name1.focus();
        return false;
    }
    if(isblank(Name1)==false)
    {    
        alert('Blank space is not allowed.');
        Name1.focus();
        Name1.value="";
        return false;
    }
    if(Email1.value=='')
    {
        alert('Please enter your email address.');
        Email1.focus();
        return false;
    }
    if(isblank(Email1)==false)
    {    
        alert('Blank space is not allowed.');
        Email1.focus();
        Email1.value="";
        return false;
    }
    if(emailCheck(Email1.value)==false)
    {
        alert('Please enter valid email address.');
        Email1.focus();
        return false;
    }
    if(Remarks1.value=='')
    {
        alert('Please enter your remark.');
        Remarks1.focus();
        return false;
    }
    if(isblank(Remarks1)==false)
    {    
        alert('Blank space is not allowed.');
        Remarks1.focus();
        Remarks1.value="";
        return false;
    }
    return true;
}
function validateFieldsAdminLogIn(UserName,Password)
{
    var UserName1=document.getElementById(UserName);
    var Password1=document.getElementById(Password);
    if(UserName1.value=='')
    {
        alert('Please enter username.');
        UserName1.focus();
        return false;
    }
    else if(isblank(UserName1)==false)
    {    
        alert('Blank space is not allowed.');
        UserName1.focus();
        UserName1.value="";
        return false;
    }
    else if(emailCheck(UserName1.value)==false)
    {
        alert('Please enter valid username.(e.g.user@user.com)');
        UserName1.focus();
        return false;
    }
    if(Password1.value=='')
    {
        alert('Please enter password.');
        Password1.focus();
        return false;
    }
    else if(isblank(Password1)==false)
    {    
        alert('Blank space is not allowed.');
        Password1.focus();
        Password1.value="";
        return false;
    }
    else if((Password1.value.length<6) || (Password1.value.length>20))
    {
       alert('Please enter password between 6 to 20 character.');
       Password1.focus();
       Password1.value="";
       return false;
    }
    return true;
}
function validateFieldsAdminProfile(OldPassword,NewPassword,ConfirmPassword)
{
    var OldPassword1=document.getElementById(OldPassword);
    var NewPassword1=document.getElementById(NewPassword);
    var ConfirmPassword1=document.getElementById(ConfirmPassword);
    if(OldPassword1.value=='')
    {
        alert('Please enter old password.');
        OldPassword1.focus();
        return false;
    }
    if(isblank(OldPassword1)==false)
    {    
        alert('Blank space is not allowed.');
        OldPassword1.focus();
        OldPassword1.value="";
        return false;
    }
    if((OldPassword1.value.length<6) || (OldPassword1.value.length>20))
    {
       alert('Please enter password between 6 to 20 character.');
       OldPassword1.focus();
       OldPassword1.value="";
       return false;
    }
    if(NewPassword1.value=='')
    {
        alert('Please enter new password.');
        NewPassword1.focus();
        return false;
    }
    if(isblank(NewPassword1)==false)
    {    
        alert('Blank space is not allowed.');
        NewPassword1.focus();
        NewPassword1.value="";
        return false;
    }
    if((NewPassword1.value.length<6) || (NewPassword1.value.length>20))
    {
       alert('Please enter password between 6 to 20 character.');
       NewPassword1.focus();
       NewPassword1.value="";
       return false;
    }
    if(ConfirmPassword1.value=='')
    {
        alert('Please enter confirm password.');
        ConfirmPassword1.focus();
        return false;
    }
    if(isblank(ConfirmPassword1)==false)
    {    
        alert('Blank space is not allowed.');
        ConfirmPassword1.focus();
        ConfirmPassword1.value="";
        return false;
    }
    if((ConfirmPassword1.value.length<6) || (ConfirmPassword1.value.length>20))
    {
       alert('Please enter password between 6 to 20 character.');
       ConfirmPassword1.focus();
       ConfirmPassword1.value="";
       return false;
    }
    if(ConfirmPassword1.value != NewPassword1.value)
    {
       alert('password and confirm password should be same.');
       ConfirmPassword1.focus();
       ConfirmPassword1.value="";
       return false;
    }
    return true;
}

function KeyCheck(strContrtolId,e) 
{ 
    var KeyID = (window.event) ? event.keyCode : e.which; 
    var txtMask1=document.getElementById(strContrtolId); 
    alert(KeyID); 
    if(txtMask1.value.length < 8) 
    { 
       if((KeyID < 48 && KeyID>8) || KeyID > 57) 
       { 
          if(document.all) 
          { 
            event.keyCode=0; 
          } 
          if(Array.every) 
          { 
            e.preventDefault(); 
          } 
       } 
    } 
    else if(txtMask1.value.length > 7) 
    { 
      if(KeyID!=97 && KeyID!=65 && KeyID!=112 && KeyID!=80 && KeyID!=8) 
      { 
          if(document.all) 
          { 
            event.keyCode=0; 
          } 
          if(Array.every) 
          { 
            e.preventDefault(); 
          } 
      } 
    } 
 } 
 
 function keyblock(txtSubtotal,e)
 {
    var KeyID = (window.event) ? event.keyCode : e.which;
    var txtSubtotal1=document.getElementById(txtSubtotal);
    //alert(KeyID); 
    
    if(document.all) 
    { 
        event.keyCode=0; 
    } 
    if(Array.every) 
    { 
        e.preventDefault(); 
    }   
 }
 
 
function ValidateFieldsForCmsPage(var1,var2,var3)
{
    var Varcmbpage=document.getElementById(var1);
    var Varcmbsection=document.getElementById(var2);
    var Varcmblanguage=document.getElementById(var3);
    //checking page name
    if(Varcmbpage.disabled==false)
    {
        if(Varcmbpage.selectedindex<=0)
        {
            alert('Please select a page name from the dropdown list.');
            Varcmbpage.focus();
            return false;
        }
     }
    //checking section name
    if(Varcmbsection.disabled==false)
    {
        if(Varcmbsection.selectedindex<=0)
        {
            alert('Please select a section name from the dropdown list.');
            Varcmbsection.focus();
            return false;
        }
     }
     //checking language
    if(Varcmblanguage.disabled==false)
    {
        if(Varcmblanguage.selectedindex<=0)
        {
            alert('Please select a language from the dropdown list.');
            Varcmblanguage.focus();
            return false;
        }
     }
     return true;
}
function ValidateFieldsPriceChart(ddlPrice)
{
   var ddlPrice1=document.getElementById(ddlPrice);
   
   if(ddlPrice1.selectedIndex==0)
   {
        var answer=confirm("Please select a pricing option to add the item in the cart.")
            
        if(answer==true)
        {
            //alert(answer);
            return false;
        }
        else
        {
            //alert(answer);
//            location.href='http://localhost:2351/OffsiteBackupVault/Business-Service-Pricing-Options.aspx';
            //alert("ddd");
        }
   }
   return true;
}

function  CheckCardNumber(cardnum)
{
    var cardnum1=document.getElementById(cardnum);
    if(!isblank(cardnum1))
    {
        alert('Please enter card number.');
        cardnum1.focus();
        return false;
    }
    else if(isNaN(cardnum1.value))
    {
        alert('Please enter only numeric value.');
        cardnum1.focus();
        return false;
    }
    else if(cardnum1.value.length < 16)
    {
        alert('Credit card number should be in 16 digits.');
        cardnum1.focus();
        return false;
    }
 }
 function ValidateFieldsForCallMeBack(txtName,txtEmail,txtPhone,txtMessage)
 {
    var txtName1=document.getElementById(txtName);
    var txtEmail1=document.getElementById(txtEmail);
    var txtPhone1=document.getElementById(txtPhone);
    var txtMessage1=document.getElementById(txtMessage);
    
    //checking for Customer name......    
    if(txtName1.value == '')
    {
        alert('Please enter your name.');
        txtName1.focus();
        return false;
    }
    else if(isblank(txtName1)==false)
    {    
        alert('Blank space is not allowed.');
        txtName1.focus();
        return false;
    }
    //check email address.......
    if(txtEmail1.value == '')
    {
        alert('Please enter your email id.');
        txtEmail1.focus();
        return false;
    }
    else if(isblank(txtEmail1)==false)
    {    
        alert('Blank space is not allowed.');
        txtEmail1.focus();
        return false;
    }
    else if(IsValidEmail(txtEmail1) == false)
    {
        alert('Please enter valid email id.');
        txtEmail1.focus();
        return false;
    }
    //check phone number......
    if(txtPhone1.value!='')
    {
        if(isblank(txtPhone1)==false)
        {    
            alert('Blank space is not allowed.');
            txtPhone1.focus();
            return false;
        }
        else if(IsValidUSPhone(txtPhone1)==false)
        {
            txtPhone1.focus();
            return false;
        }
    }
    else
    {
        alert('Please enter your phone number.');
        txtPhone1.focus();
        return false;
    }
    //ckeck message.......
    if(txtMessage1.value == '')
    {
        alert('Please enter your message.');
        txtMessage1.focus();
        return false;
    }
    else if(isblank(txtMessage1)==false)
    {    
        alert('Blank space is not allowed.');
        txtMessage1.focus();
        return false;
    }
    else if(txtMessage1.value.length > 500)
    {    
        alert('You can enter maximum 500 characters..');
        txtMessage1.focus();
        return false;
    }
    return true;
 }
 function ValidateFieldsPriceChartForNext(ddlPricingOption,btnAddtocart)
 {
    var ddlPricingOption1=document.getElementById(ddlPricingOption);
    var btnAddtocart1=document.getElementById(btnAddtocart);
    if(ddlPricingOption1.selectedIndex > 0)
    {
        alert('Please \'Add To Cart\'.');
        btnAddtocart1.focus();
        return false;
    }
    return true;
 }
 function ValidateFieldForManagebill(txtFromDate,txtToDate)
 {
    var txtFromDate1=document.getElementById(txtFromDate);
    var txtToDate1=document.getElementById(txtToDate);
    
    if(txtFromDate1.value=='')
    {
        alert('Please enter \'From Date\'.');
        txtFromDate1.focus();
        return false;
    }
    else if(ScanDate(txtFromDate1.value)==false)
    {
        txtFromDate1.value='';
        txtFromDate1.focus();
        return false;
    }
    if(txtToDate1.value=='')
    {
        alert('Please enter \'To Date\'.');
        txtToDate.focus();
        return false;
    }
    else if(ScanDate(txtToDate1.value)==false)
    {
        txtToDate1.value='';
        txtToDate1.focus();
        return false;
    }
    var dtToday = new Date();
    var dtFromDay=new Date();
    var dtCurDate=new Date();
    var arrFromDate=txtFromDate1.value.split('-');
    var arrToDate=txtToDate1.value.split('-');
    dtFromDay.setFullYear(arrFromDate[2],arrFromDate[0]-1,arrFromDate[1]);
    dtToday.setFullYear(arrToDate[2],arrToDate[0]-1,arrToDate[1]);
    dtCurDate.setFullYear(dtCurDate.getFullYear(),dtCurDate.getMonth(),dtCurDate.getDate());
    if(dtToday > dtCurDate)
    {
       alert('\'To Date\' can not be greater than current date.');
       txtFromDate1.focus();
       return false;
    }
    if(dtFromDay > dtToday)
    {
       alert('\'From Date\' can not be greater than \'To Date\'.');
       txtFromDate1.focus();
       return false;
    }
 }
function ScanDate(ParamTxtobj)
{    	
	var vartxt1;
	vartxt1=ParamTxtobj;		
		
	//DATE SHOULD BE OF MAX 10 CHARACTERS
	if(vartxt1.length > 10 || vartxt1.length < 10)
	{
		alert("Please enter date in 'MM-DD-YYYY' format.");
		return false;	
	}
	else
	{		
		var vdate,vs1,vmonth,vs2,vyear;
		var fsindex1,fsindex2,leapyear;
		
		fsindex1=vartxt1.indexOf('-') //GETTING INDEX OF 1 ST OCCURENCE OF "/"
		fsindex2=vartxt1.lastIndexOf('-') //GETTING INDEX OF 2ND OCCURENCE OF "/"
		vmonth=vartxt1.substring(0,fsindex1);
        vdate=vartxt1.substring(fsindex1+1,fsindex2);
		vyear=vartxt1.substring(fsindex2+1,vartxt1.length);					
		//alert(vyear);		
		if(vyear %4==0)
		{
		    leapyear='true';			
		}
			
		if(vyear %100==0)
		{
		    if(vyear %400==0)
		    {
		        leapyear='true';
		    }
		    else
		    {
		        leapyear='false';
		    }			    
		}			
				
		if(isNaN(vdate) ||isNaN(vmonth)|| isNaN(vyear))
		{
		    alert("Please enter date in 'MM-DD-YYYY' format.");
	    	return false;		
		}
		//MONTH CAN'T BE LESS THAN 0 OR GREATER THAN 12
		if(vmonth > 12 || vmonth < 1)
	    {
		    alert("Please enter a valid month.");
			return false;
	    }			 
		// CHECKING IF DATE IS ENTERED FOR MOTHH OF FEBRYARY			
		if( vmonth == 02)
		{
		    if(leapyear=='true')
		    {
		        if(vdate>29 || vdate <1)
			    {
				    alert("Please enter a date between 1 to 29.");
				    return false;
			    }			    
		    }
		    else
		    {
		        if(vdate>28 || vdate <1)
			    {
				    alert("Please enter a date between 1 to 28.");
				    return false;
			    }			    
		    }						
		}
		if(vmonth =="01" || vmonth =="03" || vmonth =="05" || vmonth =="07" || vmonth =="08" || vmonth =="10" || vmonth =="12")
		{
			if(vdate < 1 || vdate > 31)
			{
				alert("Please enter a valid date.");
				return false;
			}			
		}
		else
		{
			if(vdate < 1 || vdate > 30)
			{
				alert("Please enter a valid date.");
				return false;
			}			
		}
	}	
    return true;
}
function KeyCheck(strContrtolId,e)
{
   var KeyID = (window.event) ? event.keyCode : e.which;
   var txtMask1=document.getElementById(strContrtolId);
   //alert(KeyID);
   if(txtMask1.value.length < 10)
   {
       if(KeyID >=65 && KeyID<=122)
       {
          if(document.all)
          {
            event.keyCode=0;
          }
          if(Array.every)
          {
            e.preventDefault();
          }
       }
   }
//   else if(txtMask1.value.length > 7)
//   {
//      if(KeyID!=97 && KeyID!=65 && KeyID!=112 && KeyID!=80 && KeyID!=8)
//      {
//          if(document.all)
//          {
//            event.keyCode=0;
//          }
//          if(Array.every)
//          {
//            e.preventDefault();
//          }
//      }
//   }
} 		  
 // FUNCTION FOR MANAGE BILL FOR USER SECTION 
 
 function ValidateManagebillForAdmin(txtFromDate,txtToDate,ddlClient)
 {
     //alert('pankaj');
     var txtFromDate1=document.getElementById(txtFromDate);
     var txtToDate1=document.getElementById(txtToDate);
     var ddlClient1=document.getElementById(ddlClient);
    //alert(ddlClient1.selectedIndex);
    
    if(txtFromDate1.value=='')
    {
        alert('Please enter \'FromDate\'.');
        txtFromDate1.focus();
        return false;
    }
    else if(ScanDate(txtFromDate1.value)==false)
    {
        txtFromDate1.value='';
        txtFromDate1.focus();
        return false;
    }
    if(txtToDate1.value=='')
    {
        alert('Please enter \'To Date\'.');
        txtToDate.focus();
        return false;
    }
    else if(ScanDate(txtToDate1.value)==false)
    {
        txtToDate1.value='';
        txtToDate1.focus();
        return false;
    }
    var dtToday = new Date();
    var dtFromDay=new Date();
    var dtCurDate=new Date();
    var arrFromDate=txtFromDate1.value.split('-');
    var arrToDate=txtToDate1.value.split('-');
    dtFromDay.setFullYear(arrFromDate[2],arrFromDate[0]-1,arrFromDate[1]);
    dtToday.setFullYear(arrToDate[2],arrToDate[0]-1,arrToDate[1]);
    dtCurDate.setFullYear(dtCurDate.getFullYear(),dtCurDate.getMonth(),dtCurDate.getDate());
   
    if(dtToday > dtCurDate)
    {
       alert('\'To Date\' can not be greater than current date.');
       txtFromDate1.focus();
       return false;
    }
    if(dtFromDay >dtToday)
    {
       alert('\'From Date\' can not be greater than \'To Date\'.');
       txtFromDate1.focus();
       return false;
    }      
 }

 //CHECKING FOR THE PRESENCE OF USER NAME && PASSWORD
function validateForgotPwd()
{
    var emailId=document.getElementById("txtName");
    if(emailId.value  == '')
    {
        alert('Please enter User Name.');
        emailId.focus();
        return false;
    }
    else if(emailCheck(emailId.value)==false)
    {
        alert('Please enter proper Email Id.');
        emailId.focus();
        return false;
    }
    else
    {
        return true;
    }
} 
function validExist()
{
    alert('This package can\'t be deleted.');
    return false;
} 	
function validExistCustomer()
{
    alert('This customer can\'t be deleted.');
    return false;
}
function validExistCoupon()
{
    alert('This coupon can\'t be deleted.');
    return false;
}
   
function RemoveText(ctrlId)
{   
    if(document.getElementById(ctrlId).value == 'User name')
    {
        document.getElementById(ctrlId).value='';
    }
}

function ValidatePackagePrice(objPrice,objHdn)
{
    var obj= document.getElementById(objPrice);
    var objHdn1= document.getElementById(objHdn);
  
     if(objHdn1.value=='true')
     {      
        if(obj.value=='')
        {
            alert('Price can not be blank.');
            obj.focus();
            objHdn1.value='false';
            //alert(objHdn1.value);
            return false;
        }
        else if(reg.test(obj.value)==false)
        {
            alert('Please enter decimal value.');
            obj.focus();
            objHdn1.value='false';
            return false;            
        }
    }
    objHdn1.value='true';
    return true;
} 

function ValidationForCouponDetails(ddlCoupon)
{
   var ddlCoupon1= document.getElementById(ddlCoupon);
   if(ddlCoupon1.selectedIndex==0)
   {
        alert(ddlCoupon1.selectedIndex);
        alert('Please select a coupon code.');
        return false;
   }  
   return true;
}


//function isValidDate(cntrl) 
//{
//    var obj= document.getElementById(cntrl);
//    str=obj.value;
//    
//	var dateStr=str;
//	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2})$/; // requires 4 digit year
//    var matchArray = dateStr.match(datePat); // is the format ok?
//	
//	if (matchArray == true) 
//	{
//	    alert(str);
//		return false;
//	}
//	month = matchArray[1]; // parse date into variables
//	day = matchArray[3];
//	year = matchArray[4];
//	if (month < 1 || month > 12) 
//	{
//		return false;
//	}
//	if (day < 1 || day > 31) 
//	{
//		return false;
//	}
//	if ((month==4 || month==6 || month==9 || month==11) && day==31) 
//	{
//		return false;
//	}
//	if (month == 2)
//	{ // check for february 29th
//		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
//		if (day>29 || (day==29 && !isleap)) 
//		{
//			return false;
//   		}
//	}
//	return true;
//}  
 
 
 function isValidDate(ParamTxtobj)
{    	
	var vartxt1;
	vartxt1=ParamTxtobj;		
		
	//DATE SHOULD BE OF MAX 10 CHARACTERS
	if(vartxt1.length > 10 || vartxt1.length < 10)
	{
		alert("Please enter date in 'MM/DD/YYYY' format.");
		return false;	
	}
	else
	{		
		var vdate,vs1,vmonth,vs2,vyear;
		var fsindex1,fsindex2,leapyear;
		
		fsindex1=vartxt1.indexOf('/') //GETTING INDEX OF 1 ST OCCURENCE OF "/"
		fsindex2=vartxt1.lastIndexOf('/') //GETTING INDEX OF 2ND OCCURENCE OF "/"
		vmonth=vartxt1.substring(0,fsindex1);
        vdate=vartxt1.substring(fsindex1+1,fsindex2);
		vyear=vartxt1.substring(fsindex2+1,vartxt1.length);					
		//alert(vyear);		
		if(vyear %4==0)
		{
		    leapyear='true';			
		}
			
		if(vyear %100==0)
		{
		    if(vyear %400==0)
		    {
		        leapyear='true';
		    }
		    else
		    {
		        leapyear='false';
		    }			    
		}			
				
		if(isNaN(vdate) ||isNaN(vmonth)|| isNaN(vyear))
		{
		    alert("Please enter date in 'MM/DD/YYYY' format.");
	    	return false;		
		}
		//MONTH CAN'T BE LESS THAN 0 OR GREATER THAN 12
		if(vmonth > 12 || vmonth < 1)
	    {
		    alert("Please enter a valid month.");
			return false;
	    }			 
		// CHECKING IF DATE IS ENTERED FOR MOTHH OF FEBRYARY			
		if( vmonth == 02)
		{
		    if(leapyear=='true')
		    {
		        if(vdate>29 || vdate <1)
			    {
				    alert("Please enter a date between 1 to 29.");
				    return false;
			    }			    
		    }
		    else
		    {
		        if(vdate>28 || vdate <1)
			    {
				    alert("Please enter a date between 1 to 28.");
				    return false;
			    }			    
		    }						
		}
		if(vmonth =="01" || vmonth =="03" || vmonth =="05" || vmonth =="07" || vmonth =="08" || vmonth =="10" || vmonth =="12")
		{
			if(vdate < 1 || vdate > 31)
			{
				alert("Please enter a valid date.");
				return false;
			}			
		}
		else
		{
			if(vdate < 1 || vdate > 30)
			{
				alert("Please enter a valid date.");
				return false;
			}			
		}
	}	
    return true;
}
 
 function ValidateFieldsForTrialSignUp(txtTrUserName,txtPhone,txtTrUserEmail,txtTrUserPassword,txtTrUserConfirmPassword,ddlTimeZone)
 {
   var txtTrUserName1=document.getElementById(txtTrUserName); 
   var txtPhone1=document.getElementById(txtPhone); 
   var txtTrUserEmail1=document.getElementById(txtTrUserEmail);
   var txtTrUserPassword1=document.getElementById(txtTrUserPassword);
   var txtTrUserConfirmPassword1=document.getElementById(txtTrUserConfirmPassword);
   var ddlTimeZone1=document.getElementById(ddlTimeZone);

   //checking for trial user name     
    if(txtTrUserName1.value == '')
    {
        alert('Please enter your name.');
        txtTrUserName1.focus();
        return false;
    }
    else if(isblank(txtTrUserName1)==false)
    {    
        alert('Blank space is not allowed.');
        txtTrUserName1.focus();        
        return false;
    }
    
    //check phone number...
    if(txtPhone1.value!='')
    {
        if(isblank(txtPhone1)==false)
        {    
            alert('Blank space is not allowed.');
            txtPhone1.focus();
            return false;
        }        
    }
    else
    {
        alert('Please enter your phone number.');
        txtPhone1.focus();
        return false;
    }
    
    //checking for EmailId...   
    if(txtTrUserEmail1.value == '')
    {
       alert('Please enter email id.');
       txtTrUserEmail1.focus();
       return false;
    }
    else if(isblank(txtTrUserEmail1)==false)
    {    
        alert('Blank space is not allowed.');
        txtTrUserEmail1.focus();
        return false;
    }
    else if(IsValidEmail(txtTrUserEmail1) == false)
    {
        alert('Please enter valid customer email id.');
        txtTrUserEmail1.focus();
        return false;
    }
    
    //chkecking password....
    if(txtTrUserPassword1.value == '')
    {
       alert('Please enter password.');
       txtTrUserPassword1.focus();
       return false;
    }
    else if(isblank(txtTrUserPassword1)==false)
    {    
        alert('Blank space is not allowed.');
        txtTrUserPassword1.focus();
        return false;
    }
    else if((txtTrUserPassword1.value.length<6) || (txtTrUserPassword1.value.length>20))
    {
       alert('Please enter password between 6 to 20 character.');
       txtTrUserPassword1.focus();
       return false;
    }
    
    //checking confirm password...
    if(txtTrUserConfirmPassword1.value == '')
    {
       alert('Please enter confirm password.');
       txtTrUserConfirmPassword1.focus();
       return false;
    }
    else if(isblank(txtTrUserConfirmPassword1)==false)
    {    
        alert('Blank space is not allowed.');
        txtTrUserConfirmPassword1.focus();
        txtTrUserConfirmPassword1.value="";
        return false;
    }
    else if((txtTrUserConfirmPassword1.value.length < 6) || (txtTrUserConfirmPassword1.value.length >20))
    {
       alert('Please enter confirm password between 6 to 20 character.');
       txtTrUserConfirmPassword1.focus();
       txtTrUserConfirmPassword1.value="";
       return false;
    }

    //checking same confirm password with password field
    if(txtTrUserConfirmPassword1.value != txtTrUserPassword1.value)
    {
       alert('password and confirm password should be same.');
       txtTrUserConfirmPassword1.focus();
       txtTrUserConfirmPassword1.value="";
       return false;
    }
    //check time zone......
    if(ddlTimeZone1.selectedIndex == 0)
    {
        alert('Please select timezone.');
        ddlTimeZone1.focus();
        return false;
    }
    
    return true;
}

function ValidateFieldsForRSTrialSignUp(txtSpace,txtTrUserName,txtPhone,txtTrUserEmail,txtTrUserPassword,txtTrUserConfirmPassword,ddlTimeZone)
 {
   var txtSpace1=document.getElementById(txtSpace); 
//   var hdnSpaceRemain1=document.getElementById(hdnSpaceRemain); 
   var txtTrUserName1=document.getElementById(txtTrUserName); 
   var txtPhone1=document.getElementById(txtPhone); 
   var txtTrUserEmail1=document.getElementById(txtTrUserEmail);
   var txtTrUserPassword1=document.getElementById(txtTrUserPassword);
   var txtTrUserConfirmPassword1=document.getElementById(txtTrUserConfirmPassword);
   var ddlTimeZone1=document.getElementById(ddlTimeZone);

   //check that the reseller does not cross his space limit....
//   if(parseInt(hdnSpaceRemain1.value,0)<= 0)
//   {
//       alert('You have already used 50GB to create your trial accounts. So you are not allowed to create any trial user unless one/more than one of your trial user(s) going to be paid user.'); 
//       return false;
//   }
   
    if(parseInt(txtSpace1.value,0)>25)
    {
        alert('You can not allot more than 25GB to create a trial accounts.'); 
        return false;
    }
   
   //check the space to be alloted must be numeric...
   if(txtSpace1.value == '')
   {
       alert('Please enter the space to be alloted for the account.');
       txtSpace1.focus();
       return false;
   }
   else if(isblank(txtSpace1)==false)
   {    
       alert('Blank space is not allowed.');
       txtSpace1.focus();        
       return false;
   }
   else if(isInteger(txtSpace1.value)==false)//
   {
       alert('Please enter only digits.');
       txtSpace1.focus();        
       return false;
   }
  
   //checking for trial user name     
    if(txtTrUserName1.value == '')
    {
        alert('Please enter your name.');
        txtTrUserName1.focus();
        return false;
    }
    else if(isblank(txtTrUserName1)==false)
    {    
        alert('Blank space is not allowed.');
        txtTrUserName1.focus();        
        return false;
    }
    
    //check phone number...
    if(txtPhone1.value!='')
    {
        if(isblank(txtPhone1)==false)
        {    
            alert('Blank space is not allowed.');
            txtPhone1.focus();
            return false;
        }
    }
    else
    {
        alert('Please enter your phone number.');
        txtPhone1.focus();
        return false;
    }
    
    //checking for EmailId...   
    if(txtTrUserEmail1.value == '')
    {
       alert('Please enter email id.');
       txtTrUserEmail1.focus();
       return false;
    }
    else if(isblank(txtTrUserEmail1)==false)
    {    
        alert('Blank space is not allowed.');
        txtTrUserEmail1.focus();
        return false;
    }
    else if(IsValidEmail(txtTrUserEmail1) == false)
    {
        alert('Please enter valid customer email id.');
        txtTrUserEmail1.focus();
        return false;
    }
    
    //chkecking password....
    if(txtTrUserPassword1.value == '')
    {
       alert('Please enter password.');
       txtTrUserPassword1.focus();
       return false;
    }
    else if(isblank(txtTrUserPassword1)==false)
    {    
        alert('Blank space is not allowed.');
        txtTrUserPassword1.focus();
        return false;
    }
    else if((txtTrUserPassword1.value.length<6) || (txtTrUserPassword1.value.length>20))
    {
       alert('Please enter password between 6 to 20 character.');
       txtTrUserPassword1.focus();
       return false;
    }
    
    //checking confirm password...
    if(txtTrUserConfirmPassword1.value == '')
    {
       alert('Please enter confirm password.');
       txtTrUserConfirmPassword1.focus();
       return false;
    }
    else if(isblank(txtTrUserConfirmPassword1)==false)
    {    
        alert('Blank space is not allowed.');
        txtTrUserConfirmPassword1.focus();
        txtTrUserConfirmPassword1.value="";
        return false;
    }
    else if((txtTrUserConfirmPassword1.value.length < 6) || (txtTrUserConfirmPassword1.value.length >20))
    {
       alert('Please enter confirm password between 6 to 20 character.');
       txtTrUserConfirmPassword1.focus();
       txtTrUserConfirmPassword1.value="";
       return false;
    }

    //checking same confirm password with password field
    if(txtTrUserConfirmPassword1.value != txtTrUserPassword1.value)
    {
       alert('password and confirm password should be same.');
       txtTrUserConfirmPassword1.focus();
       txtTrUserConfirmPassword1.value="";
       return false;
    }
    //check time zone......
    if(ddlTimeZone1.selectedIndex == 0)
    {
        alert('Please select timezone.');
        ddlTimeZone1.focus();
        return false;
    }
    
    return true;
}


function check_agreement(txtNameOnCC,txtCCNumber,txtCvv,ddlMonth,ddlYear,ddlCCType,ddlTimeZone,rdManual,rdAutomatic,chkTermsandConditions,divProcess)
{
     var txtNameOnCC1=document.getElementById(txtNameOnCC);
     var txtCCNumber1=document.getElementById(txtCCNumber); 
     var txtCvv1=document.getElementById(txtCvv);  
     var ddlMonth1=document.getElementById(ddlMonth);
     var ddlYear1=document.getElementById(ddlYear);
     var ddlCCType1=document.getElementById(ddlCCType); 
     var ddlTimeZone1=document.getElementById(ddlTimeZone);
     var rdManual1=document.getElementById(rdManual);
     var rdAutomatic1=document.getElementById(rdAutomatic);
     var chkTermsandConditions1=document.getElementById(chkTermsandConditions);
     var divProcess1=document.getElementById(divProcess);   
     
     
     if(txtNameOnCC1.value=='')
     {
        alert('Please enter your name on credit card .');
        txtNameOnCC1.focus();
        return false;
     }
     else if(isblank(txtNameOnCC1)==false)
     {
        alert('Blank space is not allowed.');
        txtNameOnCC1.focus();
        return false;
     } 
     
     if(txtCCNumber1.value=='')
     {
        alert('Please enter your credit card number.');
        txtCCNumber1.focus();
        return false;
     } 
    //else if(isNaN(txtCCNumber1.value)==true)
    // {
    //    alert('Please enter only digits.');
    //    txtCCNumber1.focus();
    //    return false;
   //  }
     
     if(txtCvv1.value=='')
     {
        alert('Please enter your CVV2 number.');
        txtCvv1.focus();
        return false;
     } 
     else if(isNaN(txtCvv1.value)==true)
     {
        alert('Please enter only digits.');
        txtCvv1.focus();
        return false;
     } 
     
     if(ddlMonth1.selectedIndex==0)
     {
        alert('Please select expiry month.');
        ddlMonth1.focus();
        return false;
     }
     
     if(ddlYear1.selectedIndex==0)
     {
        alert('Please select expiry year.');
        ddlYear1.focus();
        return false;
     }
     
     if(ddlCCType1.selectedIndex==0)
     {
        alert('Please select your card type.');
        ddlCCType1.focus();
        return false;
     }
     
     if(ddlTimeZone1.selectedIndex==0)
     {
        alert('Please select your time zone.');
        ddlTimeZone1.focus();
        return false;
     }
     
     if(rdManual1.checked==false && rdAutomatic1.checked==false)
     {
        alert("Please select a billing option.");
        rdManual1.focus();
        return false;
     }
     
    if(chkTermsandConditions1.checked==false)
    {
        alert('You have to agree to our terms of services & conditions. So please check it.');
        return false;
    }
    //alert(divProcess1);
    divProcess1.style.display='';
    return true;
}

function check_agreement_for_upgrade(txtNameOnCC,txtCCNumber,txtCvv,ddlMonth,ddlYear,ddlCCType,ddlTimeZone,rdManual,rdAutomatic,chkTermsandConditions,hdnUpgradeExists)
{
     var txtNameOnCC1=document.getElementById(txtNameOnCC);
     var txtCCNumber1=document.getElementById(txtCCNumber); 
     var txtCvv1=document.getElementById(txtCvv);  
     var ddlMonth1=document.getElementById(ddlMonth);
     var ddlYear1=document.getElementById(ddlYear);
     var ddlCCType1=document.getElementById(ddlCCType); 
     var ddlTimeZone1=document.getElementById(ddlTimeZone);
     var rdManual1=document.getElementById(rdManual);
     var rdAutomatic1=document.getElementById(rdAutomatic);
     var chkTermsandConditions1=document.getElementById(chkTermsandConditions);
     var hdnUpgradeExists1=document.getElementById(hdnUpgradeExists);   
     var confm;

     if(hdnUpgradeExists1.value=='1')
     {
        confm=confirm('You have already requested to upgrade.Would you like to cancel the existing request and proceed with the current request ?')
        
        if(confm==true)
        {     
             if(txtNameOnCC1.value=='')
             {
                alert('Please enter your name on credit card .');
                txtNameOnCC1.focus();
                return false;
             }
             else if(isblank(txtNameOnCC1)==false)
             {
                alert('Blank space is not allowed.');
                txtNameOnCC1.focus();
                return false;
             } 
             
             if(txtCCNumber1.value=='')
             {
                alert('Please enter your credit card number.');
                txtCCNumber1.focus();
                return false;
             } 
             else if(isNaN(txtCCNumber1.value)==true)
             {
                alert('Please enter only digits.');
                txtCCNumber1.focus();
                return false;
             } 
             
             if(txtCvv1.value=='')
             {
                alert('Please enter your CVV2 number.');
                txtCvv1.focus();
                return false;
             } 
             else if(isNaN(txtCvv1.value)==true)
             {
                alert('Please enter only digits.');
                txtCvv1.focus();
                return false;
             } 
             
             if(ddlMonth1.selectedIndex==0)
             {
                alert('Please select expiry month.');
                ddlMonth1.focus();
                return false;
             }
             
             if(ddlYear1.selectedIndex==0)
             {
                alert('Please select expiry year.');
                ddlYear1.focus();
                return false;
             }
             
             if(ddlCCType1.selectedIndex==0)
             {
                alert('Please select your card type.');
                ddlCCType1.focus();
                return false;
             }
             
             if(ddlTimeZone1.selectedIndex==0)
             {
                alert('Please select your time zone.');
                ddlTimeZone1.focus();
                return false;
             }
             
             if(rdManual1.checked==false && rdAutomatic1.checked==false)
             {
                alert("Please select a billing option.");
                rdManual1.focus();
                return false;
             }
             
            if(chkTermsandConditions1.checked==false)
            {
                alert('You have to agree to our terms of services & conditions. So please check it.');
                return false;
            }  
        }
        else
        {
            return false; 
        }
     }
     else if(hdnUpgradeExists1.value=='0')
     {
         if(txtNameOnCC1.value=='')
         {
            alert('Please enter your name on credit card .');
            txtNameOnCC1.focus();
            return false;
         }
         else if(isblank(txtNameOnCC1)==false)
         {
            alert('Blank space is not allowed.');
            txtNameOnCC1.focus();
            return false;
         }         
         if(txtCCNumber1.value=='')
         {
            alert('Please enter your credit card number.');
            txtCCNumber1.focus();
            return false;
         } 
         else if(isNaN(txtCCNumber1.value)==true)
         {
            alert('Please enter only digits.');
            txtCCNumber1.focus();
            return false;
         }          
         if(txtCvv1.value=='')
         {
            alert('Please enter your CVV2 number.');
            txtCvv1.focus();
            return false;
         } 
         else if(isNaN(txtCvv1.value)==true)
         {
            alert('Please enter only digits.');
            txtCvv1.focus();
            return false;
         }          
         if(ddlMonth1.selectedIndex==0)
         {
            alert('Please select expiry month.');
            ddlMonth1.focus();
            return false;
         }         
         if(ddlYear1.selectedIndex==0)
         {
            alert('Please select expiry year.');
            ddlYear1.focus();
            return false;
         }         
         if(ddlCCType1.selectedIndex==0)
         {
            alert('Please select your card type.');
            ddlCCType1.focus();
            return false;
         }         
         if(ddlTimeZone1.selectedIndex==0)
         {
            alert('Please select your time zone.');
            ddlTimeZone1.focus();
            return false;
         }         
         if(rdManual1.checked==false && rdAutomatic1.checked==false)
         {
            alert("Please select a billing option.");
            rdManual1.focus();
            return false;
         }         
         if(chkTermsandConditions1.checked==false)
         {
            alert('You have to agree to our terms of services & conditions. So please check it.');
            return false;
         } 
     }     
     return true;
}

function check_TimeZone_for_PhoneCheque_Upgrd(ddlTimeZone,hdnUpgradeExists)
{
    var ddlTimeZone1=document.getElementById(ddlTimeZone);
    var hdnUpgradeExists1=document.getElementById(hdnUpgradeExists);
    var confm;

    if(hdnUpgradeExists1.value=='1')
    {
       confm=confirm('You have already requested to upgrade.Would you like to cancel the existing request and proceed with the current request ?')
       
       if(confm==true)
       {
           if(ddlTimeZone1.selectedIndex==0)
           {
               alert('Please select your time zone.');
               ddlTimeZone1.focus();
               return false;
           }
       }
       else
       {
           return false;
       }    
    }
    else if(hdnUpgradeExists1.value=='0')
    {
        if(ddlTimeZone1.selectedIndex==0)
        {
           alert('Please select your time zone.');
           ddlTimeZone1.focus();
           return false;
        }
    }    
    return true;
}


function check_TimeZone(ddlTimeZone)
{
    var ddlTimeZone1=document.getElementById(ddlTimeZone);
    if(ddlTimeZone1.selectedIndex==0)
    {
        alert('Please select your time zone.');
        ddlTimeZone1.focus();
        return false;
    }
    return true;
}

function ValidateCouponFields(ddlCouponType,txtCouponCode,txtDiscount,txtValidity)
{
    var txtCouponCode1= document.getElementById(txtCouponCode);
    var txtDiscount1= document.getElementById(txtDiscount);
    var txtValidity1= document.getElementById(txtValidity);
    var ddlCouponType1=document.getElementById(ddlCouponType);
    
    if(ddlCouponType1.selectedIndex==0)
    {
        alert('Please select coupon type.');
        ddlCouponType1.focus();
        return false;
    }
    if(txtCouponCode1.value=='')
    {
        alert('Please enter coupon code.');
        txtCouponCode1.focus();
        return false;   
    }   
    if(txtDiscount1.value=='')
    {
        alert('Please enter discount.');
        txtDiscount1.focus();
        return false;   
    }
    else if(isblank(txtDiscount1)==false)
    {
        alert('Blank space is not allowed in discount.');
        txtDiscount1.focus();
        return false;   
    }
    else if(isNaN(txtDiscount1.value)==true)
    {
        alert('Please enter numeric value in discount.');
        txtDiscount1.focus();
        return false;   
    }
    else if(txtDiscount1.value.indexOf('.')>-1)
    {
        var arr = txtDiscount1.value.split('.');
        if(arr[1].length>2)
        {
            alert('Please enter discount with 2 decimal precision.');
            txtDiscount1.focus();
            return false;
        }
    }
    else if(txtDiscount1.value > 100)
    {
        alert('Discount cannot be greater than 100%.');
        txtDiscount1.focus();
        return false;   
    }
    if(txtValidity1.value=='')
    {
        alert('Please enter validity in month(s).');
        txtValidity1.focus();
        return false;   
    }
    else if(isNaN(txtValidity1.value)==true)
    {
        alert('Please enter numeric value in validity.');
        txtValidity1.focus();
        return false;   
    }
    else if(IsPureInteger(txtValidity1)==false)
    {
        alert('Validity in month(s) cannot be fraction.');
        txtValidity1.focus();
        return false;   
    }
    return true;
}

function ValidatePromotion(txtName,txtEmail)
{
    var txtName1= document.getElementById(txtName);
    var txtEmail1= document.getElementById(txtEmail);
    
    if(txtName1.value=='')
    {
        alert('Please enter your name');
        txtName1.focus();
        return false;
    }
    else if(isblank(txtName1)==false)
    {       
        alert('Blank space is not allowed.');
        txtName1.focus();
        return false;   
    }
    
    if(txtEmail1.value=='')
    {
        alert('Please enter your email');
        txtEmail1.focus();
        return false;
    }
    else if(isblank(txtEmail1)==false)
    {
        alert('Blank space is not allowed');
        txtEmail1.focus();
        return false;
    }
    else if(IsValidEmail(txtEmail1)==false)
    {
        alert('Please enter valid email ID.');
        txtEmail1.focus();
        return false;
    }
    return true;
}

function CheckSearchForSupport(rdSUID,rdSUType,rdSClntType,rdSRegDate,txtSUID,ddlSUsrType,ddlSClType,txtSRegDate)
{
    var rdSUID1= document.getElementById(rdSUID);
    var rdSUType1= document.getElementById(rdSUType);
    var rdSClntType1= document.getElementById(rdSClntType);
    var rdSRegDate1= document.getElementById(rdSRegDate);
    var txtSUID1= document.getElementById(txtSUID);
    var ddlSUsrType1= document.getElementById(ddlSUsrType);
    var ddlSClType1= document.getElementById(ddlSClType);
    var txtSRegDate1= document.getElementById(txtSRegDate);
    
    if(rdSUID1.checked)
    {
        if(txtSUID1.value=='')
        {
            alert('Please enter User ID.');
            txtSUID1.focus();
            return false;
        }
        else if(isblank(txtSUID1)==false)
        {
            alert('Please enter User ID.');
            txtSUID1.value='';
            txtSUID1.focus();
            return false;
        }
        else if(IsValidEmail(txtSUID1)==false)
        {
            alert('Please enter valid email ID.');
            txtSUID1.focus();
            return false;
        }
    }
    
    if(rdSUType1.checked)
    {
        if(ddlSUsrType1.selectedIndex==0)
        {
            alert('Please select user type.');
            ddlSUsrType1.focus();
            return false;
        }
    }
    
    if(rdSClntType1.checked)
    {
        if(ddlSClType1.selectedIndex==0)
        {
            alert('Please select client type.');
            ddlSClType1.focus();
            return false;
        }
    }
 
    if(rdSRegDate1.checked)
    {
        if(txtSRegDate1.value=='')
        {
            alert('Please select registration date.');
            txtSRegDate1.focus();
            return false;
        }
        else
        {
            if(ScanDate(txtSRegDate1.value)==false)
            {
                txtSRegDate1.focus();
                return false;
            }
        }
    }
}
function CheckSearchForSupportUpgrade(rdSUID,rdSClntType,rdSRegDate,txtSUID,txtSRegDate,cboService)
{
    var rdSUID1= document.getElementById(rdSUID);
    var rdSClntType1= document.getElementById(rdSClntType);
    var rdSRegDate1= document.getElementById(rdSRegDate);
    var txtSUID1= document.getElementById(txtSUID);
    var txtSRegDate1= document.getElementById(txtSRegDate);
    var cboService1= document.getElementById(cboService);

    if(rdSUID1.checked)
    {
        if(txtSUID1.value=='')
        {
            alert('Please enter User ID.');
            txtSUID1.focus();
            return false;
        }
        else if(isblank(txtSUID1)==false)
        {
            alert('Please enter User ID.');
            txtSUID1.value='';
            txtSUID1.focus();
            return false;
        }
        else if(IsValidEmail(txtSUID1)==false)
        {
            alert('Please enter valid email ID.');
            txtSUID1.focus();
            return false;
        }
    }
    
    if(rdSClntType1.checked)
    {
        
        if(cboService1.selectedIndex==0)
        {
            alert('Please select client type.');
            cboService1.focus();
            return false;
        }
    }
 
    if(rdSRegDate1.checked)
    {
        if(txtSRegDate1.value=='')
        {
            alert('Please select registration date.');
            txtSRegDate1.focus();
            return false;
        }
    }
}

function CheckSearchForSupportUpgradePhoneCheque(rdSUID,rdSUserName,txtSUID,txtUserName)
{
    var rdSUID1= document.getElementById(rdSUID);
    var rdSUserName1= document.getElementById(rdSUserName);
    var txtSUID1= document.getElementById(txtSUID);
    var txtUserName1= document.getElementById(txtUserName);

    if(rdSUID1.checked)
    {
        if(txtSUID1.value=='')
        {
            alert('Please enter User ID.');
            txtSUID1.focus();
            return false;
        }
        else if(isblank(txtSUID1)==false)
        {
            alert('Please enter User ID.');
            txtSUID1.value='';
            txtSUID1.focus();
            return false;
        }       
    }
    
    if(rdSUserName1.checked)
    {        
       if(txtUserName1.value=='')
        {
            alert('Please enter User Name.');
            txtUserName1.focus();
            return false;
        }
        else if(isblank(txtUserName1)==false)
        {
            alert('Please enter User Name.');
            txtUserName1.value='';
            txtUserName1.focus();
            return false;
        }      
    } 
}


function validateSupport(txtRemarks)
{
    var txtRemarks1= document.getElementById(txtRemarks);
    //alert(txtRemarks1.value.length);
    if(txtRemarks1.value.length >4000)
    {
        alert('You can enter maximum 4000 characters.');
        txtRemarks1.focus();
        return false;
    }
    return true;
}

function CheckSearchForSupportOBSUpdate(rdSUID,rdSClntType,txtSUID,ddlSClType)
{
    var rdSUID1= document.getElementById(rdSUID);
    var rdSClntType1= document.getElementById(rdSClntType);
    var txtSUID1= document.getElementById(txtSUID);
    var ddlSClType1= document.getElementById(ddlSClType);
    
    if(rdSUID1.checked)
    {
        if(txtSUID1.value=='')
        {
            alert('Please enter User ID.');
            txtSUID1.focus();
            return false;
        }
        else if(isblank(txtSUID1)==false)
        {
            alert('Please enter User ID.');
            txtSUID1.value='';
            txtSUID1.focus();
            return false;
        }
        else if(IsValidEmail(txtSUID1)==false)
        {
            alert('Please enter valid email ID.');
            txtSUID1.focus();
            return false;
        }
    }    
    if(rdSClntType1.checked)
    {        
        if(ddlSClType1.selectedIndex==0)
        {
            alert('Please select client type.');
            ddlSClType1.focus();
            return false;
        }
    }
    return true;
}

function CheckSearchForBillingSentOrNot(rdSUID,rdoOrderDate,rdoPayment,rdoServiceType,txtSUserId,txtSFromDate,cboMode,cboServiceType)
{
    var rdSUID1= document.getElementById(rdSUID);
    var rdoOrderDate1= document.getElementById(rdoOrderDate);
    var rdoPayment1= document.getElementById(rdoPayment);
    var rdoServiceType1= document.getElementById(rdoServiceType);
    var txtSUserId1= document.getElementById(txtSUserId);
    var txtSFromDate1= document.getElementById(txtSFromDate);
    var cboMode1= document.getElementById(cboMode);
    var cboServiceType1= document.getElementById(cboServiceType);
    
    if(rdSUID1.checked)
    {
        if(txtSUserId1.value=='')
        {
            alert('Please enter User ID.');
            txtSUserId1.focus();
            return false;
        }
        else if(isblank(txtSUserId1)==false)
        {
            alert('Please enter User ID.');
            txtSUserId1.value='';
            txtSUserId1.focus();
            return false;
        }
        else if(IsValidEmail(txtSUserId1)==false)
        {
            alert('Please enter valid email ID.');
            txtSUserId1.focus();
            return false;
        }
    }    
    if(rdoServiceType1.checked)
    {        
        if(cboServiceType1.selectedIndex==0)
        {
            alert('Please select service type.');
           cboServiceType1.focus();
            return false;
        }
    }
    if(rdoPayment1.checked)
    {        
        if(cboMode1.selectedIndex==0)
        {
            alert('Please select payment mode.');
           cboMode1.focus();
            return false;
        }
    }
    if(rdoOrderDate1.checked)
    {
        if(txtSFromDate1.value=='')
        {
            alert('Please select order date.');
            txtSFromDate1.focus();
            return false;
        }
        else
        {
            if(ScanDate(txtSFromDate1.value)==false)
            {
                txtSFromDate1.focus();
                return false;
            }
        }
    }
    return true;
}

function checkchangecreditcardinfo(txtNameOnCC,txtCCNumber,txtCvv,ddlMonth,ddlYear,ddlCCType)
{
     var txtNameOnCC1=document.getElementById(txtNameOnCC);
     var txtCCNumber1=document.getElementById(txtCCNumber); 
     var txtCvv1=document.getElementById(txtCvv);  
     var ddlMonth1=document.getElementById(ddlMonth);
     var ddlYear1=document.getElementById(ddlYear);
     var ddlCCType1=document.getElementById(ddlCCType); 
     if(txtNameOnCC1.value=='')
     {
        alert('Please enter your name on credit card .');
        txtNameOnCC1.focus();
        return false;
     }
     else if(isblank(txtNameOnCC1)==false)
     {
        alert('Blank space is not allowed.');
        txtNameOnCC1.focus();
        return false;
     } 
     
     if(txtCCNumber1.value=='')
     {
        alert('Please enter your credit card number.');
        txtCCNumber1.focus();
        return false;
     } 
    //else if(isNaN(txtCCNumber1.value)==true)
    // {
    //    alert('Please enter only digits.');
    //    txtCCNumber1.focus();
    //    return false;
   //  }
     
     if(txtCvv1.value=='')
     {
        alert('Please enter your CVV2 number.');
        txtCvv1.focus();
        return false;
     } 
     else if(isNaN(txtCvv1.value)==true)
     {
        alert('Please enter only digits.');
        txtCvv1.focus();
        return false;
     } 
     
     if(ddlMonth1.selectedIndex==0)
     {
        alert('Please select expiry month.');
        ddlMonth1.focus();
        return false;
     }
     
     if(ddlYear1.selectedIndex==0)
     {
        alert('Please select expiry year.');
        ddlYear1.focus();
        return false;
     }
     
     if(ddlCCType1.selectedIndex==0)
     {
        alert('Please select your card type.');
        ddlCCType1.focus();
        return false;
     }
    return true;
} 

function ValidateSearchReseller(txtRSName,txtRsUserName,txtRSRegDateFrom,txtRSRegDateTo)
{
	var txtRSName1=document.getElementById(txtRSName);
	var txtRsUserName1=document.getElementById(txtRsUserName);
	var txtRSRegDateFrom1=document.getElementById(txtRSRegDateFrom);
	var txtRSRegDateTo1=document.getElementById(txtRSRegDateTo);

	if(txtRSName1.value!='' && isblank(txtRSName1)==false)
	{
		if(regexLetter.test(txtRSName1.value)==false)
		{
				alert('Please enter only alphabets.');
				txtRSName1.focus();
				return false;
		}
	}		
	
	if(txtRSRegDateFrom1.value!=='' && isblank(txtRSRegDateFrom1)==false)
	{
		if(isValidDate(txtRSRegDateFrom1.value)==false)
		{
				alert('Please enter valid date.');
				txtRSRegDateFrom1.focus();
				return false;
		}	
	}
	
	if(txtRSRegDateTo1.value!=='' && isblank(txtRSRegDateTo1)==false)
	{
		if(isValidDate(txtRSRegDateTo1.value)==false)
		{
				alert('Please enter valid date.');
				txtRSRegDateTo1.focus();
				return false;
		}	
	}
	
	if(Date.parse(txtRSRegDateFrom1.value) >Date.parse(txtRSRegDateTo1.value))
	{
		alert("'From Date' can not be greater than 'To Date'.");
		txtRSRegDateFrom1.focus();
		return false;
	}	 		
	return true;		
}