function validatecontactinfo()
{
	if(document.getElementById("firstname").value == "")
	{
		alert("Please Fill First Name");
		document.getElementById("firstname").focus();
		return false;
		
	}


	if(document.getElementById("lastname").value == "")
	{
		alert("Please Fill Last Name ");
		document.getElementById("lastname").focus();
		return false;
		
	}

	if(document.getElementById("company").value == "")
	{
		alert("Please Fill Company");
		document.getElementById("company").focus();
		return false;
		
	}
	if(document.getElementById("Job").value == "")
	{
		alert("Please Fill Job Title");
		document.getElementById("Job").focus();
		return false;
		
	}
	if(document.getElementById("phone").value == "")
	{
		alert("Please Fill Phone");
		document.getElementById("phone").focus();
		return false;
		
	}
	if(document.getElementById("email").value == "")
	{
		alert("Please Fill Email");
		document.getElementById("email").focus();
		return false;
	}
	if(document.getElementById("securitycode").value == "")
	{
		alert("Please Fill Security Code");
		document.getElementById("securitycode").focus();
		return false;
	}
	return true;
}
function update_element(oXML , objid)
{
	document.getElementById(objid).innerHTML = oXML.responseText;
}


function showgraphbylistame(listname)
{
	
	var objid = document.getElementById("response_obj").value;
	var eventtype = document.getElementById("event_type").value;
	document.getElementById("graphheading").innerHTML  = eventtype+'-'+listname;
	if(eventtype)
	{
		var strReplaceAll = eventtype;
		var intIndexOfMatch = strReplaceAll.indexOf( "&" );
		 
		// Loop over the string value replacing out each matching
		// substring.
		while (intIndexOfMatch != -1){
		// Relace out the current instance.
		strReplaceAll = strReplaceAll.replace( "&", "__" )
		 
		// Get the index of any next matching substring.
		intIndexOfMatch = strReplaceAll.indexOf( "&" );
		}
		 
		eventtype = strReplaceAll;
	}else{
		alert("Please select the Event Type");
		return false;
		var eventtype=0;
	}

	if(listname)
	{
		var strReplaceAll = listname;
		var intIndexOfMatch = strReplaceAll.indexOf( "&" );
		 
		// Loop over the string value replacing out each matching
		// substring.
		while (intIndexOfMatch != -1){
		// Relace out the current instance.
		strReplaceAll = strReplaceAll.replace( "&", "__" )
		 
		// Get the index of any next matching substring.
		intIndexOfMatch = strReplaceAll.indexOf( "&" );
		}
		 
		listname = strReplaceAll;
	}else{
	var listname=0;
	}


	var myConn = new XHConn();
	
	document.getElementById(objid).innerHTML = "<img src='images/graph.jpg' alt='Loading, please wait...' />";
	myConn.connect("showgraph.php", "POST", "listname="+listname+"&eventtype="+eventtype, update_element , objid);
}



function showgraph(objid , eventtype)
{


	document.getElementById("response_obj").value = objid;
	document.getElementById("event_type").value = eventtype;
	listname = document.getElementById("listname").value;
	document.getElementById("graphheading").innerHTML  = eventtype+'-'+listname;	
	if(eventtype)
	{
		var strReplaceAll = eventtype;
		var intIndexOfMatch = strReplaceAll.indexOf( "&" );
		 
		// Loop over the string value replacing out each matching
		// substring.
		while (intIndexOfMatch != -1){
		// Relace out the current instance.
		strReplaceAll = strReplaceAll.replace( "&", "__" )
		 
		// Get the index of any next matching substring.
		intIndexOfMatch = strReplaceAll.indexOf( "&" );
		}
		 
		eventtype = strReplaceAll;
	}else{
	var eventtype=0;
	}
	
	if(listname)
	{
		var strReplaceAll = listname;
		var intIndexOfMatch = strReplaceAll.indexOf( "&" );
		 
		// Loop over the string value replacing out each matching
		// substring.
		while (intIndexOfMatch != -1){
		// Relace out the current instance.
		strReplaceAll = strReplaceAll.replace( "&", "__" )
		 
		// Get the index of any next matching substring.
		intIndexOfMatch = strReplaceAll.indexOf( "&" );
		}
		 
		listname = strReplaceAll;
	}else{
	var listname=0;
	}


	var myConn = new XHConn();
	
	document.getElementById(objid).innerHTML = "<img src='images/graph.jpg' alt='Loading, please wait...' />";
	myConn.connect("showgraph.php", "POST", "listname="+listname+"&eventtype="+eventtype, update_element , objid);
}

