 /*
    名称：产品查询
    编写：GeSen
    时间：06-06-07
    功能：利用Ajax进行产品查询，请在调用的页面家在Ajax.js
*/
 
        ///////////////////////////////////////////////////////////// 设置视图 /////////////////////////////////////////////////////////////
        function sendAjaxAllBigSort()
        {
            var select1 = document.getElementById("select1");
            if(select1.options[0].value == "" && select1.options.length == 1)
            {
				// 提示
				moveToSrcElem("select1", "iframeMq");
                sendAjaxWithXml("?type=allBigSort", setSelectBigSort);
            }
        }
        // 初始化大类
        function setSelectBigSort()
        {
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
            {
                var xmlDom = xmlHttp.responseXml;
                var rows = xmlDom.getElementsByTagName("row");
                var select1 = document.getElementById("select1");
                for(var i = select1.options.length; i > -1 ; i--)
                {
                    select1.options.remove(i);
                }
                var op = document.createElement("option");
                op.value = "";
                op.text = "全部大类(" + rows.length + ")";
                select1.add(op);
                for(var i = 0; i < rows.length; i++)
                {
                    var id = rows.item(i).getElementsByTagName('id').item(0).text
                    var name = rows.item(i).getElementsByTagName('name').item(0).text
                    var op = document.createElement("option");
                    op.value = id;
                    op.text = name;
                    select1.add(op);
                }
                document.getElementById("iframeMq").style.display = "none";
            }
        }
        // 根据大类查小类
        function sendAjaxByBigSort()
        {
            var select1 = document.getElementById("select1");
            var bigSortId = select1.options[select1.selectedIndex].value;
            sendAjaxWithXml("?type=smallSortByBigSort&bigSortId=" + bigSortId, setSelectSmallSort);
        }
        function setSelectSmallSort()
        {
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
            {
                var xmlDom = xmlHttp.responseXml;
                var rows = xmlDom.getElementsByTagName("row");
                var select2 = document.getElementById("select2");
                var select3 = document.getElementById("select3");
                for(var i = select2.options.length; i > -1 ; i--)
                {
                    select2.options.remove(i);
                }
                for(var i = select3.options.length; i > -1 ; i--)
                {
                    select3.options.remove(i);
                }
                var op = document.createElement("option");
                op.value = "";
                op.text = "所属小类(" + rows.length + ")";
                select2.add(op);
                var op2 = document.createElement("option");
                op2.value = "";
                op2.text = "所属品牌(0)";
                select3.add(op2);
                for(var i = 0; i < rows.length; i++)
                {
                    var id = rows.item(i).getElementsByTagName('id').item(0).text
                    var name = rows.item(i).getElementsByTagName('name').item(0).text
                    var op = document.createElement("option");
                    op.value = id;
                    op.text = name;
                    select2.add(op);
                }
                document.getElementById("iframeMq").style.display = "none";
            }
        }
        // 根据小类查品牌
        function sendAjaxBySmallSort()
        {
            var select2 = document.getElementById("select2");
            var smallSortId = select2.options[select2.selectedIndex].value;
            sendAjaxWithXml("?type=brandBySmallSort&smallSortId=" + smallSortId, setSelectBrandSort);
        }
        function setSelectBrandSort()
        {
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
            {
                var xmlDom = xmlHttp.responseXml;
                var rows = xmlDom.getElementsByTagName("row");
                var select3 = document.getElementById("select3");
                for(var i = select3.options.length; i > -1 ; i--)
                {
                    select3.options.remove(i);
                }
                var op = document.createElement("option");
                op.value = "";
                op.text = "所属品牌(" + rows.length + ")";
                select3.add(op);
                for(var i = 0; i < rows.length; i++)
                {
                    var id = rows.item(i).getElementsByTagName('id').item(0).text
                    var name = rows.item(i).getElementsByTagName('name').item(0).text
                    var op = document.createElement("option");
                    op.value = id;
                    op.text = name;
                    select3.add(op);
                }
            }
            document.getElementById("iframeMq").style.display = "none";
        }
        
        // 初始化版块列表
        function sendAjaxAllBoardList()
        {
            var select1 = document.getElementById("selectBoardList");
            if(select1.options[0].value == "" && select1.options.length == 1)
            {
				// 提示
				moveToSrcElem("selectBoardList", "iframeMq");
                sendAjaxWithXml("?type=bbsSearch", setSelectBoardList);
            }
        }
        function setSelectBoardList()
        {
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
            {
                var xmlDom = xmlHttp.responseXml;
                var rows = xmlDom.getElementsByTagName("row");
                var select1 = document.getElementById("selectBoardList");
                for(var i = select1.options.length; i > -1 ; i--)
                {
                    select1.options.remove(i);
                }
                var op = document.createElement("option");
                op.value = "";
                op.text = "选取所有版面";
                select1.add(op);
                for(var i = 0; i < rows.length; i++)
                {
                    var id = rows.item(i).getElementsByTagName('boardId').item(0).text
                    var name = rows.item(i).getElementsByTagName('boardType').item(0).text
                    var op = document.createElement("option");
                    op.value = id;
                    op.text = name;
                    select1.add(op);
                }
                document.getElementById("iframeMq").style.display = "none";
            }
        }    
        // 根据版块查专题
        function sendAjaxByBoardId()
        {
            var select1 = document.getElementById("selectBoardList");
            var boardId = select1.options[select1.selectedIndex].value;
            sendAjaxWithXml("?type=bbsSearch&boardId=" + boardId, setselectSpecial);
        }        
        function setselectSpecial()
        {
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
            {
                var xmlDom = xmlHttp.responseXml;
                var rows = xmlDom.getElementsByTagName("row");
                var select2 = document.getElementById("selectSpecial");
                for(var i = select2.options.length; i > -1 ; i--)
                {
                    select2.options.remove(i);
                }
                var op = document.createElement("option");
                op.value = "";
                op.text = "所有专题";
                select2.add(op);
                for(var i = 0; i < rows.length; i++)
                {
                    var id = rows.item(i).getElementsByTagName('specialId').item(0).text
                    var name = rows.item(i).getElementsByTagName('specialName').item(0).text
                    var op = document.createElement("option");
                    op.value = id;
                    op.text = name;
                    select2.add(op);
                }
                document.getElementById("iframeMq").style.display = "none";
            }
        }
		
		// 获取家居频道分类列表
        function sendAjaxAllHomeMallSort()
        {
            var select1 = document.getElementById("selectHomeMallSort");
            if(select1.options[0].value == "" && select1.options.length == 1)
            {
				// 提示
				moveToSrcElem("selectHomeMallSort", "iframeMq");
                sendAjaxWithXml("?type=homeMall&by=sort", setSelectHomeMallSort);
            }
        }
        function setSelectHomeMallSort()
        {
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
            {
                var xmlDom = xmlHttp.responseXml;
                var rows = xmlDom.getElementsByTagName("row");
                var select1 = document.getElementById("selectHomeMallSort");
                for(var i = select1.options.length; i > -1 ; i--)
                {
                    select1.options.remove(i);
                }
                var op = document.createElement("option");
                op.value = "";
                op.text = "所有类别";
                select1.add(op);
                for(var i = 0; i < rows.length; i++)
                {
                    var id = rows.item(i).getElementsByTagName('id').item(0).text
                    var name = rows.item(i).getElementsByTagName('name').item(0).text
                    var op = document.createElement("option");
                    op.value = name;
                    op.text = name;
                    select1.add(op);
                }
                document.getElementById("iframeMq").style.display = "none";
            }
        }  
		// 获取家居频道品牌列表
        function sendAjaxAllHomeMallBrand()
        {
            var select1 = document.getElementById("selectHomeMallBrand");
            if(select1.options[0].value == "" && select1.options.length == 1)
            {
				// 提示
				moveToSrcElem("selectHomeMallBrand", "iframeMq");
				var type = document.getElementById('selectType').options[document.getElementById('selectType').selectedIndex].value;
				
                sendAjaxWithXml("?type=" + type + "&by=brand", setSelectHomeMallBrand);
            }
        }
        function setSelectHomeMallBrand()
        {
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
            {
                var xmlDom = xmlHttp.responseXml;
                var rows = xmlDom.getElementsByTagName("row");
                var select1 = document.getElementById("selectHomeMallBrand");
                for(var i = select1.options.length; i > -1 ; i--)
                {
                    select1.options.remove(i);
                }
                var op = document.createElement("option");
                op.value = "";
                op.text = "所有品牌";
                select1.add(op);
                for(var i = 0; i < rows.length; i++)
                {
                    var id = rows.item(i).getElementsByTagName('id').item(0).text
                    var name = rows.item(i).getElementsByTagName('name').item(0).text
                    var op = document.createElement("option");
                    op.value = id;
                    op.text = name;
                    select1.add(op);
                }
                document.getElementById("iframeMq").style.display = "none";
            }
        }  
		// 获取家居频道材质列表
        function sendAjaxAllHomeMallTexture()
        {
            var select1 = document.getElementById("selectHomeMallTexture");
            if(select1.options[0].value == "" && select1.options.length == 1)
            {
				// 提示
				moveToSrcElem("selectHomeMallTexture", "iframeMq");
                sendAjaxWithXml("?type=homeMall&by=texture", setSelectHomeMallTexture);
            }
        }
        function setSelectHomeMallTexture()
        {
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
            {
                var xmlDom = xmlHttp.responseXml;
                var rows = xmlDom.getElementsByTagName("row");
                var select1 = document.getElementById("selectHomeMallTexture");
                for(var i = select1.options.length; i > -1 ; i--)
                {
                    select1.options.remove(i);
                }
                var op = document.createElement("option");
                op.value = "";
                op.text = "所有材质";
                select1.add(op);
                for(var i = 0; i < rows.length; i++)
                {
                    var id = rows.item(i).getElementsByTagName('id').item(0).text
                    var name = rows.item(i).getElementsByTagName('name').item(0).text
                    var op = document.createElement("option");
                    op.value = name;
                    op.text = name;
                    select1.add(op);
                }
                document.getElementById("iframeMq").style.display = "none";
            }
        }  
		// 获取家居频道功能列表
        function sendAjaxAllHomeMallFunction()
        {
            var select1 = document.getElementById("selectHomeMallFunction");
            if(select1.options[0].value == "" && select1.options.length == 1)
            {
				// 提示
				moveToSrcElem("selectHomeMallFunction", "iframeMq");
				var type = document.getElementById('selectType').options[document.getElementById('selectType').selectedIndex].value;
                sendAjaxWithXml("?type=" +type + "&by=function", setSelectHomeMallFunction);
            }
        }
        function setSelectHomeMallFunction()
        {
			
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
            {
                var xmlDom = xmlHttp.responseXml;
                var rows = xmlDom.getElementsByTagName("row");
                var select1 = document.getElementById("selectHomeMallFunction");
                for(var i = select1.options.length; i > -1 ; i--)
                {
                    select1.options.remove(i);
                }
                var op = document.createElement("option");
                op.value = "";
                op.text = "所有功能";
                select1.add(op);
                for(var i = 0; i < rows.length; i++)
                {
                    var id = rows.item(i).getElementsByTagName('id').item(0).text
                    var name = rows.item(i).getElementsByTagName('name').item(0).text
                    var op = document.createElement("option");
                    op.value = id;
                    op.text = name;
                    select1.add(op);
                }
                document.getElementById("iframeMq").style.display = "none";
            }
        }  
                                                      
        // 新版查询设置隐藏
		function setAllDisplayNone()
		{
			
			document.getElementById("imgTel").style.display = "inline";
			
			document.getElementById("select1").style.display = "none";
			document.getElementById("select2").style.display = "none";
			document.getElementById("select3").style.display = "none";
			document.getElementById("spanPrice").style.display = "none";
			document.getElementById("txtprice1").style.display = "none";
			document.getElementById("spanSign").style.display = "none";
			document.getElementById("txtprice2").style.display = "none";
			//document.getElementById("selectJieDuan").style.display = "none";
			//document.getElementById("selectDangCi").style.display = "none";
			document.getElementById("selectFengGe").style.display = "none";
			document.getElementById("selectHuXing").style.display = "none";
			document.getElementById("selectFangXing").style.display = "none";
			document.getElementById("selectYanSe").style.display = "none";
			document.getElementById("selectLiuCheng").style.display = "none";
			document.getElementById("spanKeyword").style.display = "none";
			document.getElementById("txtKeyword").style.display = "none";
			document.getElementById("spanTitle").style.display = "none";
			// 论坛
			document.getElementById("selectBoardList").style.display = "none";
			document.getElementById("selectSpecial").style.display = "none";
			document.getElementById("radioType1").style.display = "none";
			document.getElementById("radioType2").style.display = "none";
			document.getElementById("spanZuoZhe").style.display = "none";
			document.getElementById("spanZhuTi").style.display = "none";
			// 家居卖场
			//document.getElementById("selectHomeMallSort").style.display = "none";
			document.getElementById("selectHomeMallBrand").style.display = "none";
			//document.getElementById("selectHomeMallTexture").style.display = "none";
			document.getElementById("selectHomeMallFunction").style.display = "none";
			// 装饰企业
			document.getElementById("selectArea").style.display = "none";
			document.getElementById("selectCorpType").style.display = "none";
			document.getElementById("txtCorpISOC").style.display = "none";
			document.getElementById("txtCorpCompany").style.display = "none";
		}
		function setSearchType(type)
		{
			
			setAllDisplayNone();
			
			switch(type)
			{
				case "all":
					
					document.getElementById("select1").style.display = "inline";
					//document.getElementById("imgTel").style.display = "none";
					//document.getElementById("selectJieDuan").style.display = "inline";
					//document.getElementById("selectDangCi").style.display = "inline";
					document.getElementById("selectFengGe").style.display = "inline";
					document.getElementById("selectHuXing").style.display = "inline";
					document.getElementById("selectFangXing").style.display = "inline";
					document.getElementById("selectYanSe").style.display = "inline";
					document.getElementById("selectLiuCheng").style.display = "inline";
					break;
				case "article":
					//document.getElementById("select1").style.display = "inline";
					//document.getElementById("selectFengGe").style.display = "inline";
					//document.getElementById("selectHuXing").style.display = "inline";
					//document.getElementById("selectFangXing").style.display = "inline";
					//document.getElementById("selectYanSe").style.display = "inline";
					//document.getElementById("selectLiuCheng").style.display = "inline";
					//document.getElementById("imgTel").style.display = "none";
					document.getElementById("spanTitle").style.display = "inline";
					document.getElementById("txtKeyword").style.display = "inline";
					break;
				case "merch":
					document.getElementById("select1").style.display = "inline";
					document.getElementById("select2").style.display = "inline";
					document.getElementById("select3").style.display = "inline";
					document.getElementById("spanPrice").style.display = "inline";
					document.getElementById("txtprice1").style.display = "inline";
					document.getElementById("spanSign").style.display = "inline";
					document.getElementById("txtprice2").style.display = "inline";
					//document.getElementById("selectJieDuan").style.display = "inline";
					//document.getElementById("selectDangCi").style.display = "inline";
					document.getElementById("spanKeyword").style.display = "inline";
					document.getElementById("txtKeyword").style.display = "inline";
					document.getElementById("imgTel").style.display = "none";
					break;
				case "sample":
					document.getElementById("selectFengGe").style.display = "inline";
					document.getElementById("selectHuXing").style.display = "inline";
					document.getElementById("selectFangXing").style.display = "inline";
					document.getElementById("selectYanSe").style.display = "inline";
					break;
				case "bbsSearch":
					document.getElementById("selectBoardList").style.display = "inline";
					//document.getElementById("selectSpecial").style.display = "inline";
					document.getElementById("radioType1").style.display = "inline";
					document.getElementById("radioType2").style.display = "inline";
					document.getElementById("spanZuoZhe").style.display = "inline";
					document.getElementById("spanZhuTi").style.display = "inline";
					document.getElementById("txtKeyword").style.display = "inline";
					//document.getElementById("imgTel").style.display = "none";
					break;
				case "corp":
					document.getElementById("selectArea").style.display = "inline";
					document.getElementById("selectCorpType").style.display = "inline";
					document.getElementById("txtCorpISOC").style.display = "inline";
					document.getElementById("txtCorpCompany").style.display = "inline";
					//document.getElementById("imgTel").style.display = "none";
					break;
				case "furniture":
					//document.getElementById("selectHomeMallSort").style.display = "inline";
					document.getElementById("selectHomeMallBrand").style.display = "inline";
					//document.getElementById("selectHomeMallTexture").style.display = "inline";
					document.getElementById("selectHomeMallFunction").style.display = "inline";
					document.getElementById("txtKeyword").style.display = "inline";
					document.getElementById("spanKeyword").style.display = "inline";	
					var select1 = document.getElementById("selectHomeMallBrand");
					for(var i = select1.options.length; i > -1 ; i--)
					{
						select1.options.remove(i);
					}
					var op = document.createElement("option");
					op.value = "";
					op.text = "所有品牌";
					select1.add(op);
					select1 = document.getElementById("selectHomeMallFunction");
					for(var i = select1.options.length; i > -1 ; i--)
					{
						select1.options.remove(i);
					}
					var op = document.createElement("option");
					op.value = "";
					op.text = "所有功能";
					select1.add(op);
					break;
				case "electric":
					//document.getElementById("selectHomeMallSort").style.display = "inline";
					document.getElementById("selectHomeMallBrand").style.display = "inline";
					//document.getElementById("selectHomeMallTexture").style.display = "inline";
					document.getElementById("selectHomeMallFunction").style.display = "inline";
					document.getElementById("txtKeyword").style.display = "inline";
					document.getElementById("spanKeyword").style.display = "inline";

					var select1 = document.getElementById("selectHomeMallBrand");
					
					for(var i = select1.options.length; i > -1 ; i--)
					{
						select1.options.remove(i);
					}
					var op = document.createElement("option");
					op.value = "";
					op.text = "所有品牌";
					select1.add(op);
					select1 = document.getElementById("selectHomeMallFunction");
					for(var i = select1.options.length; i > -1 ; i--)
					{
						select1.options.remove(i);
					}
					var op = document.createElement("option");
					op.value = "";
					op.text = "所有功能";
					select1.add(op);
					break;
				case "homeproduct":
					//document.getElementById("selectHomeMallSort").style.display = "inline";
					document.getElementById("selectHomeMallBrand").style.display = "inline";
					//document.getElementById("selectHomeMallTexture").style.display = "inline";
					document.getElementById("selectHomeMallFunction").style.display = "inline";
					document.getElementById("txtKeyword").style.display = "inline";
					document.getElementById("spanKeyword").style.display = "inline";

					var select1 = document.getElementById("selectHomeMallBrand");
					for(var i = select1.options.length; i > -1 ; i--)
					{
						select1.options.remove(i);
					}
					var op = document.createElement("option");
					op.value = "";
					op.text = "所有品牌";
					select1.add(op);
					select1 = document.getElementById("selectHomeMallFunction");
					for(var i = select1.options.length; i > -1 ; i--)
					{
						select1.options.remove(i);
					}
					var op = document.createElement("option");
					op.value = "";
					op.text = "所有功能";
					select1.add(op);
					break;
			}
		}  
		
		// 提示
		function moveToSrcElem(srcElemId, ctrlId)
		{
			var top, left;
			var srcElem = document.getElementById(srcElemId);
			top = srcElem.offsetTop;
			left = srcElem.offsetLeft;
			var rect = srcElem.getBoundingClientRect();
			
			while(srcElem.tagName != "BODY")
			{
				srcElem = srcElem.offsetParent;
				top = top + srcElem.offsetTop;
				left = left + srcElem.offsetLeft;
			}
			var ctrl = document.getElementById(ctrlId);
			ctrl.style.display = "inline";
			ctrl.style.top = top;// + rect.bottom - rect.top;
			ctrl.style.left = left //+ rect.right - rect.left;
			ctrl.style.width = rect.right - rect.left;
			ctrl.style.height = rect.bottom - rect.top;
		}
		  
        // 新版查询
        function btnSearch()
        {
			var selectType = document.getElementById("selectType");
			
            var select1 = document.getElementById("select1");
            var select2 = document.getElementById("select2");
            var select3 = document.getElementById("select3");
            var selectJieDuan = document.getElementById("selectJieDuan");
            var selectDangCi = document.getElementById("selectDangCi");
            var txtPrice1 = document.getElementById("txtPrice1");
            var txtPrice2 = document.getElementById("txtPrice2");
			
            var selectType = document.getElementById("selectType");
            var selectJieDuan = document.getElementById("selectJieDuan");
            var selectDangCi = document.getElementById("selectDangCi");
            var selectFengGe = document.getElementById("selectFengGe");
            var selectHuXing = document.getElementById("selectHuXing");
            var selectFangXing = document.getElementById("selectFangXing");
            var selectYanSe = document.getElementById("selectYanSe");
            var selectLiuCheng = document.getElementById("selectLiuCheng");
            
            // 论坛
            var selectBoardList = document.getElementById("selectBoardList");
            var selectSpecial = document.getElementById("selectSpecial");
            var radioType1 = document.getElementById("radioType1");
            var radioType2 = document.getElementById("radioType2");
            
			// 家居卖场
			var selectHomeMallSort = document.getElementById("selectHomeMallSort");
			var selectHomeMallBrand = document.getElementById("selectHomeMallBrand");
			var selectHomeMallTexture = document.getElementById("selectHomeMallTexture");
			var selectHomeMallFunction = document.getElementById("selectHomeMallFunction");
            
            // 装饰企业
			var selectArea = document.getElementById("selectArea");
			var selectCorpType = document.getElementById("selectCorpType");
			var txtCorpISOC = document.getElementById("txtCorpISOC");
			var txtCorpCompany = document.getElementById("txtCorpCompany");
            
            var txtKeyword = document.getElementById("txtKeyword");
            var keywords = "";
            var keywordString = ""; 
	        var urlString = "/ResourceCenter/";
	        
	        switch(selectType.options[selectType.selectedIndex].value)
	        {
				case "all":
					urlString += select1.options[select1.selectedIndex].text == "" ? "" : encodeURIComponent(select1.options[select1.selectedIndex].text.replace("|", "_")) + "_"; 
					urlString += selectJieDuan.options[selectJieDuan.selectedIndex].value == "" ? "" : encodeURIComponent(selectJieDuan.options[selectJieDuan.selectedIndex].value) + "_"; 
					urlString += selectDangCi.options[selectDangCi.selectedIndex].value == "" ? "" : encodeURIComponent(selectDangCi.options[selectDangCi.selectedIndex].value) + "_"; 
					urlString += selectFengGe.options[selectFengGe.selectedIndex].value == "" ? "" : encodeURIComponent(selectFengGe.options[selectFengGe.selectedIndex].value) + "_"; 
					urlString += selectHuXing.options[selectHuXing.selectedIndex].value == "" ? "" : encodeURIComponent(selectHuXing.options[selectHuXing.selectedIndex].value) + "_"; 
					urlString += selectFangXing.options[selectFangXing.selectedIndex].value == "" ? "" : encodeURIComponent(selectFangXing.options[selectFangXing.selectedIndex].value) + "_";
					urlString += selectYanSe.options[selectYanSe.selectedIndex].value == "" ? "" : encodeURIComponent(selectYanSe.options[selectYanSe.selectedIndex].value) + "_";
					urlString += selectLiuCheng.options[selectLiuCheng.selectedIndex].value == "" ? "" : encodeURIComponent(selectLiuCheng.options[selectLiuCheng.selectedIndex].value);
					if(urlString == "/ResourceCenter/")
						urlString += "";
					else
						urlString += ".html";
					window.open(urlString);
					break;
				case "article":
					//urlString += select1.options[select1.selectedIndex].text == "" ? "" : encodeURIComponent(select1.options[select1.selectedIndex].text.replace("|", "_")) + "_"; 
					//urlString += selectFengGe.options[selectFengGe.selectedIndex].value == "" ? "" : encodeURIComponent(selectFengGe.options[selectFengGe.selectedIndex].value) + "_"; 
					//urlString += selectHuXing.options[selectHuXing.selectedIndex].value == "" ? "" : encodeURIComponent(selectHuXing.options[selectHuXing.selectedIndex].value) + "_"; 
					//urlString += selectFangXing.options[selectFangXing.selectedIndex].value == "" ? "" : encodeURIComponent(selectFangXing.options[selectFangXing.selectedIndex].value) + "_";
					//urlString += selectYanSe.options[selectYanSe.selectedIndex].value == "" ? "" : encodeURIComponent(selectYanSe.options[selectYanSe.selectedIndex].value) + "_";
					//urlString += selectLiuCheng.options[selectLiuCheng.selectedIndex].value == "" ? "" : encodeURIComponent(selectLiuCheng.options[selectLiuCheng.selectedIndex].value);
					urlString += encodeURIComponent(txtKeyword.value); 
					urlString += "_wz.html";
					window.open(urlString);
					break;
				case "sample":
					urlString += selectFengGe.options[selectFengGe.selectedIndex].value == "" ? "" : encodeURIComponent(selectFengGe.options[selectFengGe.selectedIndex].value) + "_" ;
					urlString += selectHuXing.options[selectHuXing.selectedIndex].value == "" ? "" : encodeURIComponent(selectHuXing.options[selectHuXing.selectedIndex].value) + "_"; 
					urlString += selectFangXing.options[selectFangXing.selectedIndex].value == "" ? "" : encodeURIComponent(selectFangXing.options[selectFangXing.selectedIndex].value) + "_";
					urlString += selectYanSe.options[selectYanSe.selectedIndex].value == "" ? "" : encodeURIComponent(selectYanSe.options[selectYanSe.selectedIndex].value);
					urlString += "_ybf.html";
					window.open(urlString);
					break;
				case "merch":
					var bigSortName = "";
					if(select1.options.length != 0)
					{
						if(select1.options[select1.selectedIndex].value != "")
						{
							bigSortName = select1.options[select1.selectedIndex].text;
						}
					}
					var smallSortName = "";
					if(select2.options.length != 0)
					{
						if(select2.options[select2.selectedIndex].value != "")
						{
							smallSortName = select2.options[select2.selectedIndex].text;
						}
					}
					var brandName = "";
					if(select3.options.length != 0)
					{
						if(select3.options[select3.selectedIndex].value != "")
						{
							brandName = select3.options[select3.selectedIndex].text;
						}
					}
					var price1 = txtPrice1.value;
					var price2 = txtPrice2.value;
					keywordString = selectJieDuan.options[selectJieDuan.selectedIndex].value == "" ? "" : selectJieDuan.options[selectJieDuan.selectedIndex].value + "_"; 
					keywordString += selectDangCi.options[selectDangCi.selectedIndex].value == "" ? "" : selectDangCi.options[selectDangCi.selectedIndex].value + "_";
					keywords = txtKeyword.value.split(" ");
					// 关键字列表
					for(var i = 0; i < keywords.length; i++)
					{
						keywordString += keywords[i];
						if(keywords[i] != "")
							keywordString += "_";
					}
					urlString += encodeURIComponent(bigSortName) + "_"; 
					urlString += encodeURIComponent(smallSortName) + "_";
					urlString += encodeURIComponent(brandName) + "_"; 
					urlString += price1 + "_"; 
					urlString += price2 + "_"; 
					urlString += encodeURIComponent(keywordString); 
					urlString += "jc.html";
					window.open(urlString);
					break;
				case "bbsSearch":
					urlString += (selectBoardList.options[selectBoardList.selectedIndex].value == "" ? "" : encodeURIComponent(selectBoardList.options[selectBoardList.selectedIndex].value)) + "_";
					urlString += (selectSpecial.options[selectSpecial.selectedIndex].value == "" ? "" : encodeURIComponent(selectSpecial.options[selectSpecial.selectedIndex].value)) + "_";
					urlString += (radioType1.checked ? radioType1.value : radioType2.value) + "_";
					urlString += encodeURIComponent(txtKeyword.value) + "_"; 
					urlString += "bbs.html";
					window.open(urlString);
					break;
				case "furniture":
					urlString = "http://www.525j.com.cn/jiaju/ProductList_";
					urlString += encodeURIComponent(selectHomeMallFunction.options[selectHomeMallFunction.selectedIndex].value);
					urlString += "_";
					//urlString += encodeURIComponent(selectHomeMallBrand.options[selectHomeMallBrand.selectedIndex].value);
					urlString += "_";
					urlString += encodeURIComponent(selectHomeMallBrand.options[selectHomeMallBrand.selectedIndex].value);
					urlString += "_";
					//urlString += encodeURIComponent(selectHomeMallFunction.options[selectHomeMallFunction.selectedIndex].value);
					urlString += "_";
					urlString += "_";
					urlString += "_";
					urlString += encodeURIComponent(txtKeyword.value);
					urlString += ".html";
					window.open(urlString);
					break;
				case "electric":
					urlString = "http://www.525j.com.cn/jiadian/ProductList_";
					urlString += encodeURIComponent(selectHomeMallFunction.options[selectHomeMallFunction.selectedIndex].value);
					urlString += "_";
					//urlString += encodeURIComponent(selectHomeMallBrand.options[selectHomeMallBrand.selectedIndex].value);
					urlString += "_";
					urlString += encodeURIComponent(selectHomeMallBrand.options[selectHomeMallBrand.selectedIndex].value);
					//alert(selectHomeMallBrand.options[selectHomeMallBrand.selectedIndex].value);
					urlString += "_";
					urlString += "_";
					//urlString += encodeURIComponent(selectHomeMallFunction.options[selectHomeMallFunction.selectedIndex].value);					
					urlString += encodeURIComponent(txtKeyword.value);
					urlString += ".html";
					window.open(urlString);
					break;
				case "homeproduct":
					urlString = "http://www.525j.com.cn/HomeProduce/ProductList_";
					urlString += encodeURIComponent(selectHomeMallFunction.options[selectHomeMallFunction.selectedIndex].value);
					urlString += "_";
					//urlString += encodeURIComponent(selectHomeMallBrand.options[selectHomeMallBrand.selectedIndex].value);
					urlString += "_";
					urlString += encodeURIComponent(selectHomeMallBrand.options[selectHomeMallBrand.selectedIndex].value);
					urlString += "_";
					//urlString += encodeURIComponent(selectHomeMallFunction.options[selectHomeMallFunction.selectedIndex].value);
					urlString += "_";
					urlString += "_";
					urlString += "_";
					urlString += encodeURIComponent(txtKeyword.value);
					urlString += ".html";
					window.open(urlString);
					break;
				case "corp":
					urlString = "/Corp/search.aspx?district="
					urlString += selectArea.options[selectArea.selectedIndex].value;
					urlString += "&corpType="
					urlString += selectCorpType.options[selectCorpType.selectedIndex].value;
					urlString += "&ono=";
					urlString += txtCorpISOC.value;
					urlString += "&corpName=";
					urlString += txtCorpCompany.value;
					window.open(urlString);
	        }
        }
        
        
