 var data_list=new Array();
 function InitRequest()
{
	var C_req = null;
	try
	{
		C_req = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try{C_req = new ActiveXObject("Microsoft.XMLHTTP");}
		catch(oc){C_req = null;}
	}
	if (!C_req && typeof XMLHttpRequest != "undefined")
	{
		try{C_req = new XMLHttpRequest();}
		catch(fa){alert("对不起!您的浏览器不支持该功能,请使用Internet Explorer 6.0或FireFox浏览器!");C_req = null;}
	}
	return C_req;
}
function PostRequest(url, data)
{
    //alert(url+"?"+data);
    //prompt(url,url+"?"+data);
    if(data_list[data]==null)
    {
	    var AjaxRequestObj = InitRequest();
	    if (AjaxRequestObj != null)
	    {
		    AjaxRequestObj.onreadystatechange = function ()
		    {
			    if (AjaxRequestObj.readyState == 4 && AjaxRequestObj.responseText)
			    {				   
			        var i=0;
				    ProcessAjaxData(AjaxRequestObj.responseText);
				    data_list[data] = AjaxRequestObj.responseText;   				
			    }
		    };
		    AjaxRequestObj.open("POST", url, true);
		    AjaxRequestObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		    AjaxRequestObj.send(data);
	    }
	}
	else
	{
		ProcessAjaxData(data_list[data]);
	}
}
function ProcessAjaxData(data)
{
	eval(data);
}
var getclassinfoInterval,get5classinfoInterval;
var getclassInterval,get5classInterval;
function GetClassById(id)
{
    getclassinfoInterval = window.setTimeout("getClassinfo('"+id+"');",20);	
}
function getClassinfo(id)
{
    var PostData = "ClassId=01."+id;
	 if(data_list[PostData]==null)
	{
	    LoadShow("ClassContent","<div class=\"loading\"><br /><center>正在加载,请稍候...</center><br /></div>");
	}
	PostRequest(window.location.protocol + "//" + window.location.host + "/AjaxLoad/IndexClass.aspx", PostData);
	return ;	
}
//
function LoadShow(id,content)
{
    if(document.getElementById(id))
	{
		document.getElementById(id).innerHTML = content;
	}
}     
function setSevenclass(id)
{
    getclassInterval = window.setTimeout("setclass_name('"+id+"');",20);
}
var oldId1,oldId2;
oldId2="03";
function setclass_name(newId)
{
	if( oldId1!=null)
    {
	  document.getElementById("li"+oldId1).className = "";
	}	
	document.getElementById("li"+newId).className="on";
	oldId1 = newId;
}
/******************************************/
function Get5ClassById(id)
{
    get5classinfoInterval = window.setTimeout("get5Classinfo('"+id+"');",20);	
}
function get5Classinfo(id)
{
    var PostData = "type=xing&ClassId=01."+id;
	 if(data_list[PostData]==null)
	{
	    LoadShow("Class5Content","<div class=\"loading\"><br /><center>正在加载,请稍候...</center><br /></div>");
	}
	PostRequest(window.location.protocol + "//" + window.location.host + "/AjaxLoad/IndexClass.aspx", PostData);
	return ;	
}
function set5class(id)
{
    get5classInterval = window.setTimeout("set5class_name('"+id+"');",20);
}
function set5class_name(newId)
{
	if( oldId2!=null)
    {
	  document.getElementById("li5"+oldId2).className = "";
	}	
	document.getElementById("li5"+newId).className="on";
	oldId2 = newId;
}
function setClass(id,class_name)
{
    document.getElementById(id).className=class_name;
}
function setAttribute(id,att,values)
{
    document.getElementById(id).setAttribute(att, values);
}

var currId1 = 'NewProduct_1_o';
var currId2 = 'day_Product_1_o';
var currId3 = 'BiaoProduct_1_o';
function changTop1(newId)
{
	if( currId1!=null)
    {
	  document.getElementById(currId1).style.display="none";
	  document.getElementById(currId1+'_t').style.display="block";
	}	
	document.getElementById(newId).style.display="block";
	document.getElementById(newId+'_t').style.display="none";
	
	var oTime = window.setTimeout("closechangTop1('"+newId+"')",5000); 	
	currId1 = newId;
}

function closechangTop1(newId)
{
    document.getElementById(newId).style.display="none";
	document.getElementById(newId+'_t').style.display="";
}

function changTop2(newId)
{
	if( currId2!=null)
    {
	  document.getElementById(currId2).style.display="none";
	  document.getElementById(currId2+'_t').style.display="block";
	}	
	document.getElementById(newId).style.display="block";
	document.getElementById(newId+'_t').style.display="none";
	currId2 = newId;
}
function changTop3(newId)
{
	if( currId3!=null&&document.getElementById(currId3)!=null)
    {
	  document.getElementById(currId3).style.display="none";
	  document.getElementById(currId3+'_t').style.display="block";
	}	
	document.getElementById(newId).style.display="block";
	document.getElementById(newId+'_t').style.display="none";
	currId3 = newId;
}

 function getposOffset(what, offsettype)
{ 
    var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop; 
    var parentEl=what.offsetParent; 
    while (parentEl!=null)
    { 
        totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; 
         parentEl=parentEl.offsetParent; 
    } 
    return totaloffset; 
} 
function showInfo(obj,divId){
	var locdiv=document.getElementById(divId);	
    locdiv.style.top=(getposOffset(obj,"top")+20)+"px";
	locdiv.style.left=(getposOffset(obj,"left"))+"px";
	locdiv.style.display="";
	
}
function timecloseshowinfo(divId){
	setTimeout("closeshowinfo('"+divId+"');",2000);
}
function closeshowinfo(divId){
	var mdiv=document.getElementById(divId);	
	mdiv.style.display="none";
}


function DrawImage(ImgD,maxheight)
{  
   var image=new Image(); 
   image.src=ImgD.src; 
   if(image.height>maxheight)
   {    
     ImgD.height=maxheight;      
   } 
}





