/*
* js file used to execute the action script
* on ajax call
* to show details of a particular product
*/
function ajaxFunctionProducts(pid)
{
var xmlHttp;
var url="individual_product_detail.php?pid="+pid;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  //alert(xmlHttp.onreadystatechange)
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
	    str = xmlHttp.responseText;
	  	/*var avilablewidth=0;
		var screenWidth=document.body.clientWidth;
		if (screenWidth<1003)
		{
		avilablewidth=20;
		}
		else
		{
		avilablewidth=(screenWidth-363)/2;
		}
		alert("here")
      document.getElementById("dv_product_details"+pid).style.left=Math.round(avilablewidth) + "px";
	  document.getElementById("dv_product_details"+pid).style.top=245 + "px";*/
	   document.getElementById("dv_product_details"+pid).style.left=(parseInt(document.documentElement.clientWidth/2) -250) + 'px';
 
	   if(document.documentElement.clientHeight>=800)
	      document.getElementById("dv_product_details"+pid).style.top=(parseInt(document.documentElement.scrollTop) + 250) + 'px';
	   else if(document.documentElement.clientHeight>=600)
	      document.getElementById("dv_product_details"+pid).style.top=(parseInt(document.documentElement.scrollTop) + 150) + 'px';
	   else
  	  document.getElementById("dv_product_details"+pid).style.top=(parseInt(document.documentElement.scrollTop) + 50) + 'px';
	  document.getElementById("dv_product_details"+pid).style.display="block";
	  document.getElementById("dv_product_details"+pid).innerHTML=str;
	 // alert(document.getElementById("dv_product_details"+pid).style.top)
      }
    }
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
  }
  
  
