﻿
var xmlHttp = false;
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}

function callServer(page) {
  var Color=document.getElementById("ChangeColor").value ;
  var Price=document.getElementById("ChangePrice").value ;
  var Indu=document.getElementById("ChangeIndu").value ;
  if ((Color == null) || (Price == "") || (Indu == "")) return;
  if(page==null)
  {
	  var url = "works_ajax.asp?Color="+escape(Color)+"&Price="+escape(Price)+"&Indu="+escape(Indu);
  }else{
      var url = "works_ajax.asp?Color="+escape(Color)+"&Price="+escape(Price)+"&Indu="+escape(Indu)+"&page="+escape(page);
  }
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = updatePage;
  xmlHttp.send(null);  
}

function updatePage() {
  if (xmlHttp.readyState < 4) {
 		showcontent.innerHTML="数据读取中...";
  }
  if (xmlHttp.readyState == 4) {
	  if (xmlHttp.status == 200) {
	  var response = xmlHttp.responseText;
		showcontent.innerHTML=response;
	  }
  }
}
function ChangePrice(id){
		document.getElementById("ChangePrice").value=id;
		document.getElementById("ChangeIndu").value=0;
		callServer();
}
function ChangeIndu(id){
		document.getElementById("ChangeIndu").value=id;
		document.getElementById("ChangePrice").value=0;
		callServer();
}
function ChangePage(page){
		callServer(page);
}

function tabClick4(idx,allnum,classid) {
	for(var id=1;id<=allnum;id++)
	{	
		var iin="tabLabel__"+id;
		if(id==idx){
			document.getElementById(iin).style.backgroundColor='#FFFFFF';
		}else{
			document.getElementById(iin).style.backgroundColor='#f0f0f0'; 
		}
	}
	
	document.getElementById("ChangeColor").value=classid
	callServer();
}

function tabClick(idx,allnum) {
	for(var id = 1;id<=allnum;id++)
	{
		var iin="tabLabel__"+id;
		if(id==idx){
			document.getElementById(iin).background='Images/index_35.gif';
			eval("class"+id).style.color="#000000";
			eval("content__"+id).style.display="";
		}else{
			document.getElementById(iin).background='Images/index_37.gif'; 
			eval("class"+id).style.color="#ffffff";
			eval("content__"+id).style.display="none";
		}
	}
}
function tabClick1(idx,allnum) {
	for(var id = 1;id<=allnum;id++)
	{
		var iin="tabLabel__"+id;
		if(id==idx){
			document.getElementById(iin).background='images/webdesign_28.gif';
			eval("class"+id).style.color="#000000";
			eval("content__"+id).style.display="";
		}else{
			document.getElementById(iin).background='images/webdesign_25.gif'; 
			eval("class"+id).style.color="#ffffff";
			eval("content__"+id).style.display="none";
		}
	}
}
function tabClick2(idx,allnum) {
	for(var id = 1;id<=allnum;id++)
	{
		var iin="tabLabel1__"+id;
		if(id==idx){
			document.getElementById(iin).background='images/webdesign_28.gif';
			eval("class1"+id).style.color="#000000";
			eval("content1__"+id).style.display="";
		}else{
			document.getElementById(iin).background='images/webdesign_25.gif'; 
			eval("class1"+id).style.color="#ffffff";
			eval("content1__"+id).style.display="none";
		}
	}
}
	
function tabClick6(idx,allnum) {
	for(var id=1;id<=allnum;id++)
	{	
		var iin="tabLabel__"+id;
		if(id==idx){
			document.getElementById(iin).style.backgroundColor='#FFFFFF';
			eval("content__"+id).style.display="";
			//eval("class"+id).style.color="#ffffff";
		}else{
			document.getElementById(iin).style.backgroundColor='#f0f0f0'; 
			eval("content__"+id).style.display="none";
			//eval("class"+id).style.color="#ffffff";
		}
	}
	
}