function contactform() {

    var name = document.getElementById("name").value;
    var email = document.getElementById("email").value;
	var contact_no = document.getElementById("contact_no").value;
	var sel_country = document.contact_form.sel_country.selectedIndex;
	var comments = document.getElementById("comments").value;
	
    var focus = "";
    var errormsg = "";
    if(name.length == 0 ){
        errormsg+='Please enter your Name!\n';
        if (focus=="") focus = "name";
        document.getElementById("name").style.backgroundColor = '#e8e8e8';
    }
    if(email==''){
        errormsg+='Please enter your Email Address!\n';
        if (focus=="") focus = "email";
        document.getElementById("email").style.backgroundColor = '#e8e8e8';
    }
    if(email != ''){
        if (email.indexOf('@')==-1||email.indexOf('.')==-1||email.indexOf('@.')!=-1){
            errormsg+="Please provide a valid Email Address!\n";
            if (focus=="") focus = "email";
            document.getElementById("email").style.backgroundColor = '#e8e8e8';
        }
    }
	if(contact_no.length==0){
        errormsg+='Please enter your Contact Number!\n';
        if (focus=="") focus = "contact_no";
        document.getElementById("contact_no").style.backgroundColor = '#e8e8e8';
    }
    else if(contact_no.length > 13){
        errormsg+='Please enter at least 13 numbers for your Contact Number!\n';
        if (focus=="") focus = "contact_no";
        document.getElementById("contact_no").style.backgroundColor = '#e8e8e8';
    }
    else if (!/^-?\d+$/.test(contact_no)){
        errormsg+='Please enter only numbers for your Contact Number!\n';
        if (focus=="") focus = "contact_no";
        document.getElementById("contact_no").style.backgroundColor = '#e8e8e8';
    }
	
	if(sel_country == 0 ){
        errormsg+='Please select a country!\n';
        if (focus=="") focus = "sel_country";
        document.contact_form.sel_country.style.backgroundColor = '#e8e8e8';
    }
	if(comments == 0 ){
        errormsg+='Please enter your messages!\n';
        if (focus=="") focus = "comments";
        document.getElementById("comments").style.backgroundColor = '#e8e8e8';
    }
    if (errormsg!=""){
        document.getElementById(focus).focus();
        alert(errormsg);
        return false;

    }else{
        return true;
    }
}
