function supportValidate()
{
    var RetValue=false;
    if(Trim(document.frm_Customer_support.subject.value)=="")
    {
        alert("Subject is blank");
        RetValue=false;
        document.frm_Customer_support.subject.focus();
    }
    else if(Trim(document.getElementById("contname").value)=="")
    {
        alert("Report By is blank");
        RetValue=false;
        document.getElementById("contname").focus();
    }
    else if(nameValidate(Trim(document.getElementById("contname").value))==false)
    {
        alert("Report By is Invalid");
        RetValue=false;
        document.getElementById("contname").focus();
    } 
    else if(Trim(document.frm_Customer_support.email.value)=="")
    {
        alert("Email is blank");
        RetValue=false;
        document.frm_Customer_support.email.focus();
    } 
    else if((RetValue = isValidEMailId(Trim(document.frm_Customer_support.email.value))) == false)
    {
        alert("Invalid E-Mail ID");
        RetValue=false;
        document.frm_Customer_support.email.focus();
    }
    else if(Trim(document.frm_Customer_support.Phone.value)=="")
    {
        alert("Phone Number is blank");
        RetValue=false;
        document.frm_Customer_support.Phone.focus();
    }
    else if(document.frm_Customer_support.Phone.value.length < 7)
    {
        alert("Phone Number should be of Minimum 7 characters.");
        RetValue=false;
        document.frm_Customer_support.Phone.focus();
    }
    else if((RetValue=phoneFaxValidate(Trim(document.frm_Customer_support.Phone.value))) == false)
    {
        alert("Invalid Phone Number");
        RetValue=false;
        document.frm_Customer_support.Phone.focus();
    }
    else
    {
        RetValue=true;
        document.frm_Customer_support.method = "post";
        document.frm_Customer_support.action = "thanks.jsp?mail=yes&mailTo=2";
        document.frm_Customer_support.submit();  
    }
    //return RetValue;	
}

function ContactMeValidate()
{
    var RetValue=false;
    if(Trim(document.frm_ContactMe.companyname.value)=="")
    {
        alert("Company Name is blank");
        RetValue=false;
        document.frm_ContactMe.companyname.focus();
    }
    else if(Trim(document.getElementById("contname").value)=="")
    {
        alert("Name is blank");
        RetValue=false;
        document.getElementById("contname").focus();
    }
    else if(nameValidate(Trim(document.getElementById("contname").value))=="")
    {
        alert("Name is Invalid");
        RetValue=false;
        document.getElementById("contname").focus();
    }
	else if(Trim(document.frm_ContactMe.email.value)=="")
    {
        alert("Email is blank");
        RetValue=false;
        document.frm_ContactMe.email.focus();
    } 
    else if((RetValue = isValidEMailId(Trim(document.frm_ContactMe.email.value))) == false)
    {
        alert("Invalid E-Mail ID");
        RetValue=false;
        document.frm_ContactMe.email.focus();
    }
    else if(Trim(document.frm_ContactMe.Phone.value)=="")
    {
        alert("Phone Number is blank");
        RetValue=false;
        document.frm_ContactMe.Phone.focus();
    }
    else if(document.frm_ContactMe.Phone.value.length<7)
    {
        alert("Phone Number should be of Minimum 7 characters.");
        RetValue=false;
        document.frm_ContactMe.Phone.focus();
    }
    else if((RetValue=phoneFaxValidate(Trim(document.frm_ContactMe.Phone.value))) == false)
    {
        alert("Invalid Phone Number");
        RetValue=false;
        document.frm_ContactMe.Phone.focus();
    }
    else if(Trim(document.frm_ContactMe.city.value)=="")
    {
        alert("City is blank");
        RetValue=false;
        document.frm_ContactMe.city.focus();
    }
    else if(nameValidate(Trim(document.frm_ContactMe.city.value))=="")
    {
        alert("City is Invalid");
        RetValue=false;
        document.frm_ContactMe.city.focus();
    }
    else
    {
        RetValue=true;
        document.frm_ContactMe.method = "post";
        document.frm_ContactMe.action = "thanks.jsp?mail=yes&mailTo=3";
        document.frm_ContactMe.submit();          
    }
    //return RetValue;	
}

function sendmail()
{
    if(validate())
    {
        document.frm_ContactUs.method = "post";
        document.frm_ContactUs.action = "become-partner.jsp?mail=yes&mailTo=1";
        document.frm_ContactUs.submit();
    }
}
function validate()
{
    var RetValue=false;
    if(Trim(document.frm_ContactUs.companyname.value)=="")
    {
        alert("Company Name is blank");
        RetValue=false;
        document.frm_ContactUs.companyname.focus();
    }
    else if(Trim(document.frm_ContactUs.address.value)=="")
    {
        alert("Address is blank");
        RetValue=false;
        document.frm_ContactUs.address.focus();
    }
    else if(Trim(document.frm_ContactUs.city.value)=="")
    {
        alert("City is blank");
        RetValue=false;
        document.frm_ContactUs.city.focus();
    }
    else if(nameValidate(Trim(document.frm_ContactUs.city.value)) == false)
    {
        alert("Invalid City Name");
        RetValue=false;
        document.frm_ContactUs.city.focus();
    }
    else if(Trim(document.frm_ContactUs.state.value)=="")
    {
        alert("State is blank");
        RetValue=false;
        document.frm_ContactUs.state.focus();
    }
    else if(Trim(document.frm_ContactUs.country.value)=="")
    {
        alert("Country is blank");
        RetValue=false;
        document.frm_ContactUs.country.focus();
    }        
    else if(Trim(document.frm_ContactUs.postal.value)=="")
    {
        alert("Zip/Postal is blank");
        RetValue=false;
        document.frm_ContactUs.postal.focus();
    }
    else if(postalValidate(Trim(document.frm_ContactUs.postal.value)) == false)
    {
        alert("Zip/Postal is Invalid.");
        RetValue=false;
        document.frm_ContactUs.postal.focus();
    }
    else if(Trim(document.frm_ContactUs.contname.value)=="")
    {
        alert("Contact Name is blank");
        RetValue=false;
        document.frm_ContactUs.contname.focus();
    }
    else if(nameValidate(Trim(document.frm_ContactUs.contname.value)) == false)
    {
        alert("Invalid Contact Name.");
        RetValue=false;
        document.frm_ContactUs.contname.focus();
    }
    else if(Trim(document.frm_ContactUs.Phone.value)=="")
    {
        alert("Phone Number is blank");
        RetValue=false;
        document.frm_ContactUs.Phone.focus();
    }
    else if(document.frm_ContactUs.Phone.value.length<7)
    {
        alert("Phone Number should be of Minimum 7 characters.");
        RetValue=false;
        document.frm_ContactUs.Phone.focus();
    }
    else if((phoneFaxValidate(Trim(document.frm_ContactUs.Phone.value))) == false)
    {
        alert("Invalid Phone Number");
        RetValue=false;
        document.frm_ContactUs.Phone.focus();
    }
    else if(Trim(document.frm_ContactUs.email.value)=="")
    {
        alert("E-Mail ID is blank");
        RetValue=false;
        document.frm_ContactUs.email.focus();
    } 
    else if((RetValue = isValidEMailId(Trim(document.frm_ContactUs.email.value))) == false)
    {
        alert("Invalid E-Mail ID");
        RetValue=false;
        document.frm_ContactUs.email.focus();
    }
    else
    {
        RetValue=true;
    }
    return RetValue;
}
function phoneFaxValidate(phone)
{
        var numList= "+-0123456789";
        
        var isAvailable = false;
        for(var i=0; i<phone.length; i++)
        {
            var x= phone.charCodeAt(i);
            if(!((x>47 && x<58) || x==43 || x==45))
            {
                return false;
            }
        }
            if(phone.indexOf("+")>0)
                {
			return false;
                }
return true;
}

function postalValidate(phone)
{
        
        var isAvailable = false;
        for(var i=0; i<phone.length; i++)
        {
            var x= phone.charCodeAt(i);
            if(!(x>47 && x<58))
            {
                return false;
            }
        }
return true;
}

function isValidEMailId(content)
{
	if(content.length<5)
		return false
	if(content.indexOf(" ") > 0)
		return false
	if(content.indexOf("@") < 1)
		return false
	else if(content.indexOf("@",content.indexOf("@")+1)>0)
		return false
	if(content.lastIndexOf(".") == content.length - 1)
		return false
	x = content.charCodeAt(0)
	if(!((x>=65 && x<=90) || (x>=97 && x<=122) || (x>=48 && x<=57)))
		return false
	x = content.charCodeAt(content.lastIndexOf(".")+1)
	if(!((x>=65 && x<=90) || (x>=97 && x<=122)))
		return false
	if(content.lastIndexOf(".") < content.indexOf("@") + 2)
		return false
	return true
}

function nameValidate(phone)
{
        for(var i=0; i<phone.length; i++)
        {
            var x= phone.charCodeAt(i);
            if(!((x>64 && x<91) || (x>96 && x<123) || x==46 || x==32))
            {
                return false;
            }
        }
        return true;
}


function Trim(STRING){STRING = LTrim(STRING);return RTrim(STRING);}
function RTrim(STRING){while(STRING.charAt((STRING.length -1))==" "){STRING = STRING.substring(0,STRING.length-1);}return STRING;}
function LTrim(STRING){while(STRING.charAt(0)==" "){STRING = STRING.replace(STRING.charAt(0),"");}return STRING;}