function emptyFormTextArea() {
 if(document.tipMessageForm.tip.value == 'Type your anonymous tip here') {
	document.tipMessageForm.tip.value = '';
 }
}
function emptyFormSpamValue() {
 if(document.tipMessageForm.spamValue.value == 'Type word here...') {
	document.tipMessageForm.spamValue.value = '';
 }
}
function submit_tip_message(){
	document.getElementById("TipEmpty").innerHTML = "";
	var str = document.tipMessageForm.tip.value;
	var str1= document.tipMessageForm.hideTipVal.value;
    var str2 = document.tipMessageForm.spamValue.value;   
	if(str.length == 0 || str=="Type your anonymous tip here...") {
		document.getElementById("TipEmpty").innerHTML = '<font color="red">Please enter your tip in the tip box.</font>';
		return false;
	} else if( str1 != str2) {		
		document.getElementById("TipEmpty").innerHTML = '<font color="red">Please enter correct word</font>';
		return false;
	} else {
			xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null){
				alert ("Browser does not support HTTP Request");
				return;
			}
			var url="/store_tip.php";
			url=url+"?tip="+str+"&action=1";
			xmlHttp.open("GET",url,false);
			xmlHttp.send(null);
			if (xmlHttp.status==200){ 
				document.getElementById("TipEmpty").innerHTML=xmlHttp.responseText ;
			}
			return false; 
	}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}


