function showContactForm()
{
	//document.getElementById("contactForm").value
}


function isEmpty(str)
{
    if(str.length)
        return false;
    else    
        return true;         
}

function validateEmail(email) 
{
    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
    if(reg.test(email) == false) {
        return false;
    }
    else 
        return true ;
}

function sendEmail()
{	
	var txtName = document.getElementById("txtName").value;
	var txtEmail = document.getElementById("txtEmail").value;
	
	var txtIp = document.getElementById("txtIp").value;
	var txtinTime = document.getElementById("txtinTime").value;
	var txtFileName = document.getElementById("txtFileName").value;
	var	txtBrowser = document.getElementById("txtBrowser").value;
	var flag = true;
	
	if(isEmpty(txtName)){
        document.getElementById("errorLable").innerHTML = " Please enter name" ;
        document.getElementById("txtName").focus();
        return false;
        //flag = false;
        
        
    }
    
    if(isEmpty(txtEmail)){
        document.getElementById("errorLable").innerHTML = " Please enter email" ;
        //flag = false;
        document.getElementById("txtEmail").focus();
        return false;
    }
    
    if(!validateEmail(txtEmail)){
        document.getElementById("errorLable").innerHTML = " Email is invalid";        
        flag = false;
        document.getElementById("txtEmail").focus();
        return false;
    }
	
	var qString = "?tName="+txtName+"&tEmail="+txtEmail+"&tIp="+txtIp+"&tInTime="+txtinTime+"&tFileName="+txtFileName+"&tBrowser="+txtBrowser;
	
		
	var xmlhttp = CreateObject();
	
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4) {
			
			
			document.getElementById("bottom_11").style.display = 'none'; 
			document.getElementById("bottom_1").style.display = 'block';			
			
			document.getElementById("txtName").value = "";
			document.getElementById("txtEmail").value = "";			
			document.getElementById("errorLable").innerHTML = "";
	    		
  		}
	}
	xmlhttp.open("GET","sendMail.php"+qString,true);
	xmlhttp.send(null);
}

function CreateObject()
{
	var xmlhttp = null;
	if (window.XMLHttpRequest) {
  		// code for IE7+, Firefox, Chrome, Opera, Safari
  		xmlhttp=new XMLHttpRequest();
  	} else if (window.ActiveXObject) {
  		// code for IE6, IE5
  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	} else {
  		alert("Your browser does not support XMLHTTP!");
  	}
  	
  	return xmlhttp;

}