// JavaScript Document for get classes
var pid;
function vote_helpful(plid){
	pid=plid;
	try{
		var url = "../action/review_vote.asp?vote=helpful&plid=" +escape(plid);
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = getClassesOkItem;
		xmlHttp.send(null);	
	}catch(exception){}
}
function vote_unhelpful(plid){
	pid=plid;
	try{
		var url = "../action/review_vote.asp?vote=unhelpful&plid=" +escape(plid);
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = getClassesOkItem;
		xmlHttp.send(null);	
	}catch(exception){}
}

function getClassesOkItem(){
	if (xmlHttp.readyState == 4) {
		var response = xmlHttp.responseText;
		
		try{
			var classObj = document.getElementById("show_class"+pid);
			classObj.innerHTML=response;
		}catch(exception){}
	}	
}

function clearviewed(){
	try{
		var url = "/shop/action/clearviewed.asp";
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = getCleared;
		xmlHttp.send(null);	
	}catch(exception){}
}
function getCleared(){
	if (xmlHttp.readyState == 4) {
		var response = xmlHttp.responseText;
		
		try{
			var classObj = document.getElementById("recentviewed");
			classObj.innerHTML=response;
		}catch(exception){}
	}	
}

function AddToCompare(ppid,psid){
	try{
		var url = "/shop/action/AddCompare.asp?action=add&ppid="+escape(ppid)+"&psid="+escape(psid);
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);	
	}catch(exception){}
}

function DelCompare(formid,ppid){
try{
		var url = "/shop/action/AddCompare.asp?action=del&ppid="+escape(ppid);
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);	
	}catch(exception){}
	
	document.getElementById(formid).style.display='none';
}

var pmodel;
var es  = 1;
function czindex(loaddiv){
	var obj = document.getElementById(loaddiv);
	obj.style.zIndex = es;
	es++ ;
}
function showtag(model){
pmodel=model;
if(document.getElementById("loadimg"+pmodel)){

if(document.getElementById("loadimg"+pmodel).style.display=='inline'){
document.getElementById("loadimg"+pmodel).style.display='none';}
else{document.getElementById("loadimg"+pmodel).style.display='inline';}

}
else{
	
showHTML="<div id=\"loadimg"+pmodel+"\" class=\"loadimg\" style=\"display:inline;\" onmouseover=\"czindex('loadimg"+pmodel+"');\"><img src=\"/images/loading.gif\" id=\"loading\" style=\"margin-top:30px;margin-bottom:30px; margin-left:30px;\" /></div>";
oHTML=document.getElementById(pmodel).innerHTML;
document.getElementById(pmodel).innerHTML=showHTML+oHTML;

try{
		var url = "../action/GetItemTag.asp?model="+escape(pmodel);
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = getItemTagOK;
		xmlHttp.send(null);	
	}catch(exception){}
	
}
}

function getItemTagOK(){
	if (xmlHttp.readyState == 4) {
		var response = xmlHttp.responseText;
		
		try{
			var classObj = document.getElementById("loadimg"+pmodel);
			classObj.innerHTML=response;
		}catch(exception){}
	}	
}
