/**
 * 锟斤拷示锟斤拷锟叫筹拷锟斤拷ucweb
 */
function loadVendor(product){
	j = 0;
	document.write('<div class="download_all_brand">');
	
	for(i in arr){ 
		vendorEnName = arr[i][0]; //锟斤拷锟斤拷英锟斤拷锟斤拷
		vendorName = arr[i][1];  //锟斤拷锟斤拷锟斤拷
		var mTypes='';//该品牌的所有机型
		var mNames='';//机型名
		var mDownFilePaths='';//对应的下载文件
		for(j in arr[i][2]){
			if(j>0){
				mTypes+=";";
				mNames+=";";
				mDownFilePaths+=";";
			}
			var i1 = arr[i][2][j][0];
			mTypes+=i1;
			var i2 = arr[i][2][j][1];
			mNames+=i2;
			var index = arr[i][2][j][2];
			var i3 = arrPKG[index][2];
			mDownFilePaths+=i3;
		}
		document.write('<div align=\"center\" class="download_brand">');
		document.write('<a style=\"color:#4F81BD;text-decoration:underline;\"  href="#mao" onclick="loadModels(\''+product+'\',\''+vendorEnName+'\',\''+vendorName+'\',\''+mTypes+'\',\''+mNames+'\',\''+mDownFilePaths+'\');">');
		document.write('<img width="96" height="48" src="dlweb/images/vendor/'+vendorEnName+'.jpg" alt="'+vendorName+'" /></a>');
		document.write('<p align="center"><a style=\"color:#4F81BD;text-decoration:underline;\"  href="#step2" onclick="loadModels(\''+product+'\',\''+vendorEnName+'\',\''+vendorName+'\',\''+mTypes+'\',\''+mNames+'\',\''+mDownFilePaths+'\');">'+vendorName+'</a></p>');
        document.write('</div>');
		j=j+1;
		if(j == 7){
			document.write('</div><div class="download_all_brand">');
			j = 0;
		}
	} 
	document.write('</div>');
                  
}
/**
 * 锟斤拷椐筹拷锟斤拷英锟侥憋拷识锟斤拷锟斤拷锟斤拷锟斤拷斜锟�
 */
function loadModels1(product,vendorEnName,vendorName){
	alert("vendorEnName1:"+vendorEnName);
	$.ajax({
		type: "get",
		url: "dlweb/html/mlist_goonuu.jsp?name="+vendorEnName,
		beforeSend:function(){
			$("#mlist").html('loadding...');
		},
		success: function(content){
			alert("content123:"+content);
			(document.getElementById("mlist")).innerHTML=content;
			(document.getElementById("vendorSelected")).innerHTML=vendorName;
			//$("#mlist").html(content);
			//$('#vendorSelected').html(vendorName);
		}
		
	})
	//锟侥变厂锟斤拷锟斤拷示
 }
/* 
function newHtml(nameValue){
	document.write("<li>");
	
	if (nameValue) {
		alert("nameValue"+nameValue);
		var pName;
		var downFilePath;//相对应的GooNuu下载路径
		var picId;//具体手机的图片id
		var machineName;//具体手机的名称
		pName = nameValue
		alert("产品名称是:"+pName);
		for(i in arr){ 
			var tmp_pName = arr[i][0]; 
			if(tmp_pName==pName){
				for(j in arr[i][2]){
					picId = arr[i][2][j][0];
					machineName = arr[i][2][j][1];
					var tmp_downFilePath = arr[i][2][j][2];
					downFilePath = arrPKG[tmp_downFilePath][2];
					
					document.write("<a href=\""+downFilePath+"\" target=\"_blank\"><img src=\"dlweb/images/model/"+picId+".jpg\">");
				    document.write("</a> <br />");
		            document.write("<a href=\""+downFilePath+"\" target=\"_blank\">"+machineName+"</a>");
					
				}
				break;	
			}
			
		}
		
	}
	document.write("</li>");
}
*/
 function loadModels(product,vendorEnName,vendorName,mTypes,mNames,mDownFilePaths){
	var ajo;
	if(window.XMLHttpRequest)
    {//非IE内核浏览器
         ajo=new XMLHttpRequest();
    }
    else if(window.ActiveXObject)
    {//IE内核浏览器
        try
        {//IE6.0
             ajo=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(e1)
        {
            try
            {
                 ajo=new ActiveXObject("MSXML2.XMLHTTP");
            }
            catch(e2)
            {
                try
                {
                     ajo=new ActiveXObject("MSXML3.XMLHTTP");
                }
                catch(e3)
                {
                     alert("创建Ajax失败："+e3);
                     return;
                }
            }
        }
    }
    else
    {//未知浏览器
         alert("未能识别的浏览器");
         return;
    }
    try {
  		netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
 	} catch (e12) {
  			//alert("Permission UniversalBrowserRead denied.");
 	}
 	//alert("mTypes"+mTypes);
 	/*
	var url=host_ip+"/servlet/LoadByBrandAjax?brandName="+vendorEnName;
	//mTypes,mNames,mDownFilePaths
	url+="&mTypes="+mTypes;
	url+="&mNames="+encodeURI(mNames);
	url+="&mDownFilePaths="+encodeURI(mDownFilePaths);
	url+="&"+Math.random();
	*/
	var url=host_ip+"/servlet/LoadByBrandAjax?time="+new Date().getTime();
	//alert("mTypes:="+mTypes);
	//alert("mNames:="+mNames);
	//alert("mDownFilePaths:="+mDownFilePaths);
	//alert("qqqurl:"+url);
	//var method = "get";
	var method = "post";
	ajo.open(method,url,true);
	
	 function func1(){
	   	var state = ajo.readyState;
	   	if(state==1 || state==2 || state==3){
			(document.getElementById("mlist")).innerHTML="正在加载...";
	   	}
	   	if(state==4){
	   		var status = ajo.status;
	   		if(status==200){
	   				//alert("responseText"+ajo.responseText);
	    			(document.getElementById("mlist")).innerHTML = ajo.responseText;
	    			(document.getElementById("vendorSelected")).innerHTML = vendorName;
	   		}
	   	}
   	}
	
	ajo.onreadystatechange=func1;
	ajo.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	//ajo.send(null);
	ajo.send("brandName="+vendorEnName+"&mTypes="+mTypes+"&mNames="+encodeURI(encodeURI(mNames))+"&mDownFilePaths="+encodeURI(encodeURI(mDownFilePaths)));
 }