
var xmlHttp


function showsource()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="get_source.php";
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


///////////////////////////////////////////////////////////////////////////////////////////
var q;
function licencesreqirement()
{ 

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="licences_requirment.php";
//alert(url);
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}




function stateChanged() 
{ 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
//alert(xmlHttp.responseText);
	document.getElementById("result").innerHTML=xmlHttp.responseText;
}
prepareInputsForHints();
}

///////////////////////////////////////////////////////////////////////////////////////////

function showsubcategory(cid)
{ 

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="show_subcategory.php?cid="+cid;
//alert(url);
xmlHttp.onreadystatechange=ShowsubcatstateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}




function ShowsubcatstateChanged() 
{ 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
//alert(xmlHttp.responseText);
	document.getElementById("showsubcat").innerHTML=xmlHttp.responseText;
}
prepareInputsForHints();
}

/////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////FOR EMAIL TO FRIEND//////////////////////////////////////////////////////



	function member_forward(proid)
	{ 
		//alert(id_mem)
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="member_forward.php?pid="+proid;
		//alert(url);
		
		xmlHttp.onreadystatechange=emailtofriend; 
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
	function emailtofriend() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById("Layer_forward").innerHTML=xmlHttp.responseText;	 
			
			//document.getElementById('Layer1').innerHTML="";
			scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			document.getElementById('Layer_forward').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('Layer_forward').style.width)/2)+"px";
			document.getElementById('Layer_forward').style.top=(scrolltop+150)+"px";
		} 
	} 
	

	function cancel_forward() 
	{ 
			document.getElementById("Layer_forward").innerHTML="";	 
	}

//////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////FOR FLAG AS INAPPROPRIATE//////////////////////////////////////////////////////



	function flag_inappropriate(proid)
	{ 
		//alert(id_mem)
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="inappropriate.php?pid="+proid;
		//alert(url);
		
		xmlHttp.onreadystatechange=flaginappropriate; 
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
	function flaginappropriate() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById("flag_inapp").innerHTML=xmlHttp.responseText;	 
			
			//document.getElementById('Layer1').innerHTML="";
			scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			document.getElementById('flag_inapp').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('flag_inapp').style.width)/2)+"px";
			document.getElementById('flag_inapp').style.top=(scrolltop+150)+"px";
		} 
	} 
	

	function cancel_inapp() 
	{ 
			document.getElementById("flag_inapp").innerHTML="";	 
	}

//////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////RATE DOCUMENT/////////////////////////////////////

		function rate_this_document(pdid,rating)
		{ 
		
		
			xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			}
				var url="save_rate_document.php?pid="+pdid+"&rate="+rating+"&doc_rt=rate_document";		
				//alert(url);
				xmlHttp.onreadystatechange=stateChanged5 
				xmlHttp.open("GET",url,true)
				xmlHttp.send(null)
			}
		
		function stateChanged5() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
		//alert(xmlHttp.responseText);
			document.getElementById('rating').innerHTML=xmlHttp.responseText 
			} 
		} 
		



/////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////POST REVIEW/////////////////////////////////////

		function post_review(pid,rid,ed)
		{ 
		
		
			xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			}
				var url="post_review.php?pid="+pid+"&rid="+rid+"&edit="+ed;		
				//alert(url);
				xmlHttp.onreadystatechange=postreview; 
				xmlHttp.open("GET",url,true)
				xmlHttp.send(null)
			}
		
		function postreview() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
		//alert(xmlHttp.responseText);
			document.getElementById('postreview').innerHTML=xmlHttp.responseText ;
			scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
			scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			document.getElementById('postreview').style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById('postreview').style.width)/2)+"px";
			document.getElementById('postreview').style.top=(scrolltop+150)+"px";
			
			} 
		} 
		
	function cancel_postreview() 
	{ 
			document.getElementById("postreview").innerHTML="";	 
	}
/////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////VIEW RESPONSE REVIEW/////////////////////////////////////

var lid;
		function showresponsereply(pid,rid)
		{ 
		lid=rid;
		
			xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			}
				var url="show_response.php?pid="+pid+"&rid="+rid;		
				//alert(url);
				xmlHttp.onreadystatechange=showresponse; 
				xmlHttp.open("GET",url,true)
				xmlHttp.send(null)
			}
		
		function showresponse() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
		//alert(document.getElementById(lid));
			document.getElementById(lid).innerHTML=xmlHttp.responseText ;
			//alert(document.getElementById(lid).innerHTML);
			} 
		} 
		
	
/////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////DELETE REVIEW/////////////////////////////////////

		var x;
		function redelete(deid,pid)
		{ 
		x=pid;
		
			xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			}
				var url="delete_review.php?deid="+deid;		
				//alert(url);
				xmlHttp.onreadystatechange=deletereview; 
				xmlHttp.open("GET",url,true)
				xmlHttp.send(null)
			}
		
		function deletereview() 
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
				alert(xmlHttp.responseText);
				window.location=('product_detail_page.php?pid='+x);
				window.submit();
			//document.getElementById('rating').innerHTML=xmlHttp.responseText 
			} 
		} 
		



/////////////////////////////////////////////////////////////////////////////////////////



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;
}



