function abuseconf()
{
	alert("Abuse report sent successfully");
}
function validate()
{
	with ( window.document.sendinfo)
  	{
		if(sendername.value=="")
		{
			alert("Enter Your Name");
			sendername.focus();
			return false;
		}
		if(friendemail.value=="")
		{
			alert("Enter Email ID(s)");
			friendemail.focus();
			return false;
		}
  	}
	document.getElementById("sendmessage").innerHTML = "";
	document.getElementById("HiddenImage").style.visibility = "visible";
  	return true;
}
function printit()
{  
	if (window.print) 
	{
    	window.print() ;  
	} 
	else 
	{
		var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
		WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
	}
}
function toggleBox(szDivID, iState) // 1 visible, 0 hidden 
{ 
  	if(document.layers)  // NN4 
    	document.layers[szDivID].visibility = iState ? "show" : "hide"; 
  	else if(document.getElementById) // gecko(NN6) + IE5+ 
  	{ 
    	var obj = document.getElementById(szDivID); 
    	obj.style.visibility = iState ? "visible" : "hidden"; 
  	} 
  	else if(document.all) //IE 4 
    	document.all[szDivID].style.visibility = iState ? "visible" : "hidden"; 
}
function open_image(ip)
{
	window.open (ip, "mywindow", "status=0,toolbar=0,resizable=1,scrollbars=1, location=no, fullscreen=1"); 
}
function display_com_box(q)
{
	if(q == "yes")
	{
		document.getElementById("CommentBox").style.display = "block";
	}
	if(q == "no")
	{
		document.getElementById("CommentBox").style.display = "none";
	}
}
function ValidateComment()
{
	var fname= document.WriteComment.comment.value.replace(/ /g,"");
	if(fname == 0)
	{
		alert("Write your comment");
		document.WriteComment.comment.focus();
		return false;
	}
}
function textCounter(field, countfield, maxlimit) 
{
    if (field.value.length > maxlimit) // if too long...trim it!
        field.value = field.value.substring(0, maxlimit);
        // otherwise, update 'characters left' counter
}
function checkfirst()
{
	if(document.sendinfo.storeids.checked == true && document.sendinfo.first.value > 0)
	{
		return true;
	}
	else if(document.sendinfo.storeids.checked == false && document.sendinfo.first.value > 0)
	{
		return true;
	}
	else
	{
		alert("Please sign in to store email ids.");
		return false;
	}
}
var xmlhttp
var rating;
function rateinfo(infoid, inforating)
{	
	rating = inforating;
	var userid = document.getElementById("checklogin").value;
	if(userid > 0)
	{
		xmlhttp=GetXmlHttpObject();
		if (xmlhttp==null)
		{
			alert ("Your browser does not support XMLHTTP!");
			return;
		}
		var url="/infob/info_rating.php";
		var params="readinfo="+infoid+"&inforating="+inforating;
		xmlhttp.open("POST",url,true);
		//Send the proper header information along with the request
		xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlhttp.setRequestHeader("Content-length", params.length);
		xmlhttp.setRequestHeader("Connection", "close");
		xmlhttp.send(params);
		document.getElementById("rating_div").innerHTML = "<img src='http://static.go2inbox.com/images/progress.gif' border=0 style='padding-bottom:10px' width='16px' height='16px'>";
		xmlhttp.onreadystatechange=getrating;
	}
	else
	{
		window.location = "/myaccount/loginnow.php?GoToPage=ReadInfo&passrating=yes&readinfo="+infoid+"&inforating="+inforating;	
	}
}
function getrating()
{
	if (xmlhttp.readyState==4)
	{
		if(rating == "Very Useful")
		{
			document.getElementById("vu1").checked = true;
			document.getElementById("share").bgColor = "#FFCC99";
		}
		if(rating == "Useful")
		{
			document.getElementById("u1").checked = true;
			document.getElementById("share").bgColor = "#FFCC99";
		}
		if(rating == "Average")
		{
			document.getElementById("a1").checked = true;
		}
		if(rating == "Not Useful")
		{
			document.getElementById("nu1").checked = true;
		}
		var result = xmlhttp.responseText.split("|");
		document.getElementById("rating_div").innerHTML = result[0];
		document.getElementById("overallrating_div").innerHTML = result[1];
		document.getElementById("ratedbyno").innerHTML = result[2];
  	}
}
function DisplayRating(id, Npage)
{
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
  	{
  		alert ("Your browser does not support XMLHTTP!");
  		return;
	}
	var url="/infob/ratedby.php";
	url=url+"?readinfo="+id;
	url=url+"&nextpage="+Npage;
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=getratedby;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}
function getratedby()
{
	if (xmlhttp.readyState==4)
	{
  		document.getElementById("ratedby_div").innerHTML = xmlhttp.responseText;
  	}
	else
	{
		document.getElementById("ratedby_div").innerHTML = "<img src='http://static.go2inbox.com/images/progress.gif' border=0 style='padding-bottom:10px' width='16px' height='16px'>";
	}
}
function GetXmlHttpObject(){if (window.XMLHttpRequest){  		// code for IE7+, Firefox, Chrome, Opera, Safari
  		return new XMLHttpRequest();
  	}if (window.ActiveXObject)
  	{  		// code for IE6, IE5
  		return new ActiveXObject("Microsoft.XMLHTTP");
  	}return null;
}
document.onclick=check; 
function check(e)
{ 
	var evt = (e)?e:event;
	var target = (e && e.target) || (event && event.srcElement); 
	var obj = document.getElementById('searchinfo_div'); 
	var obj2 = document.getElementById('sho'); 
	checkParent(target)?obj.style.display='none':null; 
	target==obj2?obj.style.display='block':null; 
} 
function checkParent(t)
{ 
	while(t.parentNode)
	{ 
		if(t==document.getElementById('searchinfo_div'))
		{ 
			return false 
		} 
		t=t.parentNode 
	} 
	return true 
}
