function ajaxFunction(scid,cid,sc)
{
document.getElementById('working').style.display="block";	
var xmlHttp;
var url="products_category.php?scid="+scid+"&cid="+cid+"&sc="+sc;
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;
	  //alert(screenWidth)
	  //alert(window.innerHeight)
	 // alert(document.body.clientHeight)
	  if (screenWidth<1003)
	  {
	    avilablewidth=20;
	  }
	  else
	  {
	   avilablewidth=(screenWidth-963)/2;
	  }
       document.getElementById("dv_product_list").style.left=Math.round(avilablewidth) + "px";
       document.getElementById("dv_product_list").style.top=201 + "px";
       document.getElementById("dv_product_list").style.display="block";
       document.getElementById("dv_product_list").innerHTML=str;
	   document.getElementById('working').style.display="none";	

      }
    }
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
  }
  
  function close_div(div_id)
  {
  	  document.getElementById(div_id).style.display="none";
	  document.getElementById(div_id).innerHTML='';
  }
  
  
  function show_main_div(dv_name)
  {
  	document.getElementById(dv_name).style.display="block";
	var avilablewidth=0;
	var screenWidth=document.body.clientWidth;
	if (screenWidth<1003)
	{
	avilablewidth=20;
	}
	else
	{
	avilablewidth=(screenWidth-963)/2;
	}

	document.getElementById("dv_product_list").style.left=Math.round(avilablewidth) + "px";
//	document.getElementById("dv_product_list").style.top=201 + "px";
  }
  
  function hide_main_div(dv_name)
  {
  	document.getElementById(dv_name).style.display="none";
  	var avilablewidth=0;
	var screenWidth=document.body.clientWidth;
	if (screenWidth<1003)
	{
	avilablewidth=20;
	}
	else
	{
	avilablewidth=(screenWidth-963)/2;
	}
  }
  function CallJSResize()
  {
	// alert("test")
	var avilablewidth=0;
	var screenWidth=document.body.clientWidth;
	if (screenWidth<1003)
	{
	avilablewidth=20;
	}
	else
	{
	avilablewidth=(screenWidth-963)/2;
	}
	document.getElementById("dv_product_list").style.left=Math.round(avilablewidth) + "px";
  }
  // function use to multiply the quantity with amount
function multiply(act,id)
{
    // Get values from form
    var qty, qmt;
	if(document.getElementById('quantity'+id).value<1)
		document.getElementById('quantity'+id).value =1;
	if(act == "plus")
		document.getElementById('quantity'+id).value = parseInt(document.getElementById('quantity'+id).value)+1
	else if(act == "minus")
		document.getElementById('quantity'+id).value = parseInt(document.getElementById('quantity'+id).value)-1
	qty = parseInt(document.getElementById('quantity'+id).value);
	amt = parseInt(document.getElementById('hdn_amt'+id).value);

	// Compute the Toatal ammmount.
	var tot_amt = qty*amt;
	//alert(tot_amt)
	// Display Total amount in form.
	document.getElementById('tot_amt'+id).value = tot_amt;
}