/*  
**    ==================================================================================================  
**    类名：CLASS_LIANDONG_YAO  
**    功能：多级连动菜单  
**    
**    作者：YAODAYIZI  
**    ==================================================================================================  
**/      
  function CLASS_LIANDONG_YAO(array)
  {
   //数组，联动的数据源
      this.array=array; 
      this.indexName='';
      this.obj='';
      //设置子SELECT
    // 参数：当前onchange的SELECT ID，要设置的SELECT ID
    this.subSelectChange=function(selectName1,selectName2)
      {
      //try
      //{
    var obj1=document.all[selectName1];
    var obj2=document.all[selectName2];
    var objName=this.toString();
    var me=this;
  
    obj1.onchange=function()
    {
        
        me.optionChange(this.options[this.selectedIndex].value,obj2.id)
		if(selectName1 == "Class1"){
		    if(this.options[this.selectedIndex].value == "7"){
				document.getElementById("PdtBrand").style.display = "block";
			}else{
				document.getElementById("PdtBrand").style.display = "none";
			}
		}
    }

      }
      //设置第一个SELECT
    // 参数：indexName指选中项,selectName指select的ID
      this.firstSelectChange=function(indexName,selectName)  
      {
      this.obj=document.all[selectName];
      this.indexName=indexName;
      this.optionChange(this.indexName,this.obj.id)

      }
  
    // indexName指选中项,selectName指select的ID
      this.optionChange=function (indexName,selectName)
      {
    var obj1=document.all[selectName];
    var me=this;
    obj1.length=0;
    obj1.options[0]=new Option("请选择...",'');
    for(var i=0;i<this.array.length;i++)
    {    
    
        if(this.array[i][1]==indexName)
        {
        //alert(this.array[i][1]+" "+indexName);
          obj1.options[obj1.length]=new Option(this.array[i][2],this.array[i][0]);
        }
    }
      }
      
  }


function Ajax(){
	var xmlHttp=false;
	try{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e){
			try{
				xmlHttp=new XMLHttpRequest();
			}catch(e){
				xmlHttp=false;
			}
		}
	}	
	return xmlHttp;
}

//新闻内容页面加载
function Main(ID, Class){
	document.getElementById("loading").innerHTML = "正在加载...";
	var Url = window.location.href;
	var IsCharAt = Url.indexOf("#");
	if(IsCharAt == -1){
		window.location = Url + "#1";
		ClassType = "1";
	}else{
		var ParaUrl = Url.split("#");
		if(Class != "" && Class != undefined){
			window.location = ParaUrl[0] + "#" + Class;
			ClassType = Class;
		}else{
			ClassType = ParaUrl[1];
		}
	}
	var xmlHttp = Ajax();
	xmlHttp.open("GET","Service/NewsDetailService.asp?ID=" + ID + "&Page=" + ClassType, true);
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			if(xmlHttp.status==200){
				xmlResult = xmlHttp.responseText;
				document.getElementById("newsdetail_content").innerHTML = xmlResult;
			}
		}
	}
	xmlHttp.send(null);
}

//显示详细介绍-手机介绍页面
function ShowContent(id, Page, ShwoType){
	this.onerror = function(){
		return true;
	}
	var Target = document.getElementById("ddcontent");
	if(ShwoType == 1){
		var Loading = document.getElementById("Loading");
	}else if(ShwoType == 2){
		var Loading = document.getElementById("PageLoading");
	}
	if(ShwoType == 1){
		if(Target.style.display == "none"){
			Target.style.display = "block";
		}else{
			Target.style.display = "none"
		}
	}
	if(id == "") return;
	if(Target.innerHTML == "" || ShwoType == 2){
		Loading.innerHTML = "<img src=\"images/loading.gif\" align=\"absmiddle\" />&nbsp;正在加载...";
		var xmlHttp = Ajax();
		xmlHttp.open("GET","Service/ShowContentService.asp?ID=" + id + "&Page=" + Page);
		xmlHttp.onreadystatechange=function(){
			if(xmlHttp.readyState==4){
				if(xmlHttp.status==200){
					Target.innerHTML = xmlHttp.responseText;
					Loading.innerHTML = "";
				}
			}
		}
		xmlHttp.send(null);
	}
}













