﻿function ajaxHTTP()
{
	var xmlhttp=null;
	try
	{
		xmlhttp=new XMLHttpRequest();
	}
	catch(err)
	{
		try
		{
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(err)
		{
			try
			{
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(err)
			{
				alert("您的浏览器不支持AJAX");
				return false;
			}
		}
	}
return xmlhttp;
}	
function typelist(op1,op2)
{	
	xmlhttp1=ajaxHTTP();
	xmlhttp1.onreadystatechange=function()
	{
		if(xmlhttp1.readyState==4)
			{
				document.getElementById("typelist").innerHTML=xmlhttp1.responseText;
				//alert(xmlhttp1.responseText);
				if(op2==1)
				{
					document.getElementById("hiddenType").innerHTML="<a href='javascript:typelist("+op1+",2);'  class='a6' style='color:#ff3300'>+展开更多分类</a>";
				}
				else
				{
					document.getElementById("hiddenType").innerHTML="<a href='javascript:typelist("+op1+",1);'  class='a6'  style='color:green'>-收起更多分类</a>";
				}	
			}
	}
	var vUrl=document.URL;
	var startIndex=vUrl.lastIndexOf("class_");	
	var endIndex=vUrl.lastIndexOf(".");
	op1=vUrl.substring(startIndex+6,endIndex);
	var op1index=op1.lastIndexOf("_");
	if (op1index!=-1)
	{op1=op1.substring(0,op1index);}else{return;}
	//alert(op1);
	cxstring="/pub/typelist.asp";
	xmlhttp1.open("POST",cxstring,true);
	xmlhttp1.setRequestHeader("If-Modified-Since","0");
 	parstring="op1="+op1+"&op2="+op2+"&fandom"+Math.random();
 	xmlhttp1.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
	xmlhttp1.send(parstring);
}
function typelistNEW(op1,op2,op3)
{	
	var xmlhttp1=ajaxHTTP();
	xmlhttp1.onreadystatechange=function()
	{
		if(xmlhttp1.readyState==4)
			{
				document.getElementById(op3).innerHTML=xmlhttp1.responseText;
				
			}
	}
	cxstring="/pub/typelistNEW.asp";
	xmlhttp1.open("POST",cxstring,true);
	xmlhttp1.setRequestHeader("If-Modified-Since","0");
 	parstring="op1="+op1+"&op2="+op2+"&fandom"+Math.random();
 	xmlhttp1.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
	xmlhttp1.send(parstring);
}

