var xmlHttp
var title
function showfeedback(Id)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="showfeedbackdetails.php"
	url=url+"?id="+Id
	xmlHttp.onreadystatechange=stateChanged4
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged4()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("feedbacklist").innerHTML=xmlHttp.responseText 
		document.getElementById("header1").style.display="block";
		document.getElementById("feedbacklist").style.display="block";
				
	} 
	else
	{
		document.getElementById("feedbacklist").innerHTML="<div><img src='images/working.gif' border='0' alt=''></div>";
		document.getElementById("feedbacklist").style.display="block";
	}
}
function displayProductList(cat_id,parent_id,title1)
{ 
	title=title1;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="product_as_category.php"
	url=url+"?cat_id="+cat_id
	url=url+"&parent_id="+parent_id
	url=url+"&header_title="+title
	xmlHttp.onreadystatechange=stateChanged1
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function displayProductDetails(pid)
{
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="product_as_details.php"
	url=url+"?pid="+pid
	xmlHttp.onreadystatechange=stateChanged2
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

/*function cart_update(id,qnty,action,update)
{
	
	xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			}
			var url="cart.php"
			url=url+"?prod_id="+prod_id
			url=url+"&qty="+qnty
			url=url+"&action="+action	
			url=url+"&remove="+update	
			xmlHttp.onreadystatechange=stateChanged3
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
		
}*/
function displayTitle(title1)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="product_title.php"
	url=url+"?title="+title1;
	xmlHttp.onreadystatechange=stateChanged5
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
		
}


function cart(prod_id,qty,color,size,action)
		{
			
			xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			}
			var url="cart.php"
			url=url+"?prod_id="+prod_id
			url=url+"&qty="+qty
			url=url+"&color="+color
			url=url+"&size="+size
			url=url+"&action="+action	
			xmlHttp.onreadystatechange=stateChanged3
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
		
		}
		function stateChanged3()
		{
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
			 	 document.getElementById("cart_php").innerHTML=xmlHttp.responseText 
				 document.getElementById("cart_php").style.display="block";
				 document.getElementById("cart_header").style.display="block";
				 document.getElementById("div_addtocart").style.display="none";
				 document.getElementById("div_added").style.display="block";
				 xmlHttp=null;
				
			} 
			
		
		}
function stateChanged2() 
{ 

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	 	 document.getElementById("main_body").innerHTML=xmlHttp.responseText 
	} 
	
	/*else if(xmlHttp.readyState==1)
	{
		document.getElementById("product_list").style.Opacity=0.5
		
	}
	else{
		document.getElementById("product_list").style.background-image=url('images/working.gif')
	}*/
}
function stateChanged1() 
{ 

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	 	 
		 document.getElementById("product_list").innerHTML=xmlHttp.responseText 
		 displayTitle(title);
	} 
	
	/*else if(xmlHttp.readyState==1)
	{
		document.getElementById("product_list").style.Opacity=0.5
		
	}
	else{
		document.getElementById("product_list").style.background-image=url('images/working.gif')
	}*/
}
function stateChanged5()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("title_header").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;
}// JavaScript Document