	function init(){
		
		var chkLen = document.getElementsByName("chkQuick").length;				
		for(var i = 0; i < chkLen ; i++){
			document.getElementsByName("chkQuick")[i].disabled = true;
		}
		if(kind == "latest"){
			document.getElementById("sort").options[2].selected = true;
			funPhoneSort();
		}else{
			if(compGbn == "compare"){
				funCompareResult();
			}else if(compGbn == "popular"){
				document.getElementById("sort").options[1].selected = true;
				funPhoneSort();
			}else{
				if(serachGbn != ""){
					searchTabChange(serachGbn);
				}else{
					//funSearch('00000000000000');
					document.getElementById("sort").options[2].selected = true;
					funPhoneSort();
				}		
			}
		}
		document.getElementById("seriesSeqNo").options[1].selected = true;
		selectSeries();
		new Selectbox('seriesSeqNo');
		new Selectbox('seriesPhoneModel');
		if(document.getElementById("phoneSearchPage").style.display == ""){	
			new Selectbox('sort');
		}
	}
	var imageViewHtml="";
	var detailViewHtml="";
	function viewIconChange(iconGbn){	
		var inhtml = "";
		document.getElementById("viewGbn").value=iconGbn;
		if(iconGbn == "T"){		
			inhtml += "分類搜尋";
			inhtml += "<img src=\""+IMG_URL_ROOT+"products/ico_view01_on.gif\" alt=\"Thumbnail View\">";
			inhtml += "<a href=\"javascript:viewIconChange('I');\" class=\"rollover\" title=\"Images View\"><img src=\""+IMG_URL_ROOT+"products/ico_view02_off.gif\" alt=\"Images View\"><img src=\""+IMG_URL_ROOT+"products/ico_view02_on.gif\" alt=\"Images View\" class=\"over\"></a>";
			inhtml += "<a href=\"javascript:viewIconChange('D');\" class=\"rollover\" title=\"Text View\"><img src=\""+IMG_URL_ROOT+"products/ico_view03_off.gif\" alt=\"Text View\"><img src=\""+IMG_URL_ROOT+"products/ico_view03_on.gif\" alt=\"Text View\" class=\"over\"></a>";
			document.getElementById("thumbnailView").style.display="";
			document.getElementById("imageView").style.display="none";
			document.getElementById("detailView").style.display="none";
		}else if(iconGbn == "I" && quick_count == 0){
			inhtml += "分類搜尋";
			inhtml += "<a href=\"javascript:viewIconChange('T');\" class=\"rollover\" title=\"Thumbnail View\"><img src=\""+IMG_URL_ROOT+"products/ico_view01_off.gif\" alt=\"Thumbnail View\"><img src=\""+IMG_URL_ROOT+"products/ico_view01_on.gif\" alt=\"Images View\" class=\"over\"></a>";
			inhtml += "<img src=\""+IMG_URL_ROOT+"products/ico_view02_on.gif\" alt=\"Images View\" class=\"over\">";
			inhtml += "<a href=\"javascript:viewIconChange('D');\" class=\"rollover\" title=\"Text View\"><img src=\""+IMG_URL_ROOT+"products/ico_view03_off.gif\" alt=\"Text View\"><img src=\""+IMG_URL_ROOT+"products/ico_view03_on.gif\" alt=\"Text View\" class=\"over\"></a>";	
			document.getElementById("thumbnailView").style.display="none";
			document.getElementById("imageView").style.display="";
			document.getElementById("detailView").style.display="none";
		}else if(iconGbn == "I"){			
			inhtml += "分類搜尋";
			inhtml += "<a href=\"javascript:viewIconChange('T');\" class=\"rollover\" title=\"Thumbnail View\"><img src=\""+IMG_URL_ROOT+"products/ico_view01_off.gif\" alt=\"Thumbnail View\"><img src=\""+IMG_URL_ROOT+"products/ico_view01_on.gif\" alt=\"Images View\" class=\"over\"></a>";
			inhtml += "<img src=\""+IMG_URL_ROOT+"products/ico_view02_on.gif\" alt=\"Images View\" class=\"over\">";
			inhtml += "<a href=\"javascript:viewIconChange('D');\" class=\"rollover\" title=\"Text View\"><img src=\""+IMG_URL_ROOT+"products/ico_view03_off.gif\" alt=\"Text View\"><img src=\""+IMG_URL_ROOT+"products/ico_view03_on.gif\" alt=\"Text View\" class=\"over\"></a>";
			if(imageViewHtml == ""){
				var phoneModelLength = phoneData.length;
				imageViewHtml += "<ul class=\"prdList\">"
				for(var i=0; i< phoneModelLength; i++){
					imageViewHtml += "<li>\n";
					imageViewHtml += "	<div class=\"prd180\">\n";
					
					var phoneUrl = phoneData[i].miniName.toLowerCase();
					phoneUrl = phoneUrl.replace(/\s/g, "-").replace(/samsung|sgh-|sch-|gt-/g, "");
					phoneUrl = "samsung-" + phoneUrl;								
					
					if(phoneData[i].stateInfo == "0900001"){
						if(phoneData[i].quickViewImage.substring(0, 4) != 'http'){
							imageViewHtml += "		<img src=\""+phoneData[i].quickViewImage+"\" width=\"180\" height=\"180\" alt=\""+phoneData[i].phoneName+"\">\n";
						}
						if(phoneData[i].quickViewImage.substring(0, 4) == 'http'){
							imageViewHtml += "		<img src=\""+phoneData[i].quickViewImage+"\" width=\"180\" height=\"180\" alt=\""+phoneData[i].phoneName+"\">\n";
						}
					}else{
						if(phoneData[i].quickViewImage.substring(0, 4) != 'http'){
							imageViewHtml += "		<a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams +"\" title=\""+phoneData[i].phoneName+"\"><img src=\""+phoneData[i].quickViewImage+"\" width=\"180\" height=\"180\" alt=\""+phoneData[i].phoneName+"\"></a>\n";
						}
						if(phoneData[i].quickViewImage.substring(0, 4) == 'http'){
							imageViewHtml += "		<a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams +"\" title=\""+phoneData[i].phoneName+"\"><img src=\""+phoneData[i].quickViewImage+"\" width=\"180\" height=\"180\" alt=\""+phoneData[i].phoneName+"\"></a>\n";
						}				
					}
					if(phoneData[i].newgbn == "new"){
						if(phoneData[i].stateInfo == "0900001"){
	 						imageViewHtml += "		<p class=\"prd_tit2\"><img src=\""+IMG_URL_ROOT+"common/ico_new.gif\" alt=\"new\" class=\"bNew\">"+phoneData[i].phoneName+"</p>\n";
						} else {
	 						imageViewHtml += "		<p class=\"prd_tit2\"><img src=\""+IMG_URL_ROOT+"common/ico_new.gif\" alt=\"new\" class=\"bNew\"><a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams + "\" title=\""+phoneData[i].phoneName+"\">"+phoneData[i].phoneName+"</a></p>\n";
						}
					}else{				
						if(phoneData[i].stateInfo == "0900001"){
							imageViewHtml += "		<p class=\"prd_tit2\">"+phoneData[i].phoneName+"</p>\n";
						}else{				
							imageViewHtml += "		<p class=\"prd_tit2\"><a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams +"\" title=\"" + phoneData[i].phoneName + "\">"+phoneData[i].phoneName+"</a></p>\n";
						}
					}
					if(phoneData[i].stateInfo == "0900001"){
						imageViewHtml += "			<div class=\"prdLinkBox2\">\n";
					}else{
						imageViewHtml += "			<div class=\"prdLinkBox\">\n";
					}
					imageViewHtml += "			<ul>\n";
					imageViewHtml += "				<li><a href=\"#quick_view\" onclick=\"javascript:quickview_view(event,'quickview',"+(i+1)+",'"+phoneData[i].phoneModel+"');\" title=\"手機簡介\">手機簡介</a></li>\n";
					if(phoneData[i].stateInfo != "0900001"){
						imageViewHtml += "				<li id=\""+phoneData[i].phoneModel+"_i\"><a href=\"javascript:setCookie('"+phoneData[i].phoneModel+"','"+phoneData[i].miniName+"','"+phoneData[i].xsmallImage2+"');\" title=\"評鑑\">評鑑</a></li>\n";
					}
					imageViewHtml += "			</ul>\n";
					imageViewHtml += "		</div>\n";
					imageViewHtml += "	</div>\n";
					imageViewHtml += "</li>\n";
				}
				imageViewHtml += "</ul>"
				if(phoneModelLength == 0){
					imageViewHtml = "<div class=\"box_result\">";
					imageViewHtml+= "	<strong>抱歉,</strong> 未發現產品";
					imageViewHtml+= "</div>";
				}
				document.getElementById("imageView").innerHTML = imageViewHtml;
			}
			document.getElementById("thumbnailView").style.display="none";
			document.getElementById("imageView").style.display="";
			document.getElementById("detailView").style.display="none";
		}else if(iconGbn == "D"){
			inhtml += "分類搜尋";
			inhtml += "<a href=\"javascript:viewIconChange('T');\" class=\"rollover\" title=\"Thumbnail View\"><img src=\""+IMG_URL_ROOT+"products/ico_view01_off.gif\" alt=\"Thumbnail View\"><img src=\""+IMG_URL_ROOT+"products/ico_view01_on.gif\" alt=\"Images View\" class=\"over\"></a>";
			inhtml += "<a href=\"javascript:viewIconChange('I');\" class=\"rollover\" title=\"Images View\"><img src=\""+IMG_URL_ROOT+"products/ico_view02_off.gif\" alt=\"Images View\"><img src=\""+IMG_URL_ROOT+"products/ico_view02_on.gif\" alt=\"Images View\" class=\"over\"></a>";
			inhtml += "<img src=\""+IMG_URL_ROOT+"products/ico_view03_on.gif\" alt=\"Text View\" class=\"over\">";
			if( detailViewHtml == "" ){
				var phoneModelLength = phoneData.length;
				detailViewHtml += "<ul class=\"prdList_Row\">\n";
				for(var i=0; i< phoneModelLength; i++){
					detailViewHtml += "<li class=\"row\">\n";
					detailViewHtml += "		<div class=\"prd120\">\n";
					
					var phoneUrl = phoneData[i].miniName.toLowerCase();
					phoneUrl = phoneUrl.replace(/\s/g, "-").replace(/samsung|sgh-|sch-|gt-/g, "");
					phoneUrl = "samsung-" + phoneUrl;
					
					if(phoneData[i].stateInfo == "0900001"){
						if(phoneData[i].smallImage.substring(0, 4) != 'http'){
							detailViewHtml += "			<img src=\""+phoneData[i].smallImage+"\" width=\"120\" height=\"120\" alt=\""+phoneData[i].phoneName+"\">\n";
						}
						if(phoneData[i].smallImage.substring(0, 4) == 'http'){
							detailViewHtml += "			<img src=\""+phoneData[i].smallImage+"\" width=\"120\" height=\"120\" alt=\""+phoneData[i].phoneName+"\">\n";
						}				
					}else{
						if(phoneData[i].smallImage.substring(0, 4) != 'http'){
							detailViewHtml += "			<a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams +"\" title=\""+phoneData[i].phoneName+"\"><img src=\""+phoneData[i].smallImage+"\" width=\"120\" height=\"120\" alt=\""+phoneData[i].phoneName+"\"></a>\n";
						}
						if(phoneData[i].smallImage.substring(0, 4) == 'http'){
							detailViewHtml += "			<a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams +"\" title=\""+phoneData[i].phoneName+"\"><img src=\""+phoneData[i].smallImage+"\" width=\"120\" height=\"120\" alt=\""+phoneData[i].phoneName+"\"></a>\n";
						}					
					}
					if(phoneData[i].newgbn == "new"){
						if(phoneData[i].stateInfo == "0900001"){
							detailViewHtml += "			<p class=\"prd_tit2\"><img src=\""+IMG_URL_ROOT+"common/ico_new.gif\" alt=\"new\" class=\"bNew\">"+phoneData[i].phoneName+"</p>\n";
					
						}else{
							detailViewHtml += "			<p class=\"prd_tit2\"><img src=\""+IMG_URL_ROOT+"common/ico_new.gif\" alt=\"new\" class=\"bNew\"> <a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams +"\" title=\""+phoneData[i].phoneName+"\">"+phoneData[i].phoneName+"</a></p>\n";
						}
					}else{
						if(phoneData[i].stateInfo == "0900001"){
							detailViewHtml += "			<p class=\"prd_tit2\">"+phoneData[i].phoneName+"</p>\n";
						}else{
							detailViewHtml += "			<p class=\"prd_tit2\"> <a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams +"\" title=\""+phoneData[i].phoneName+"\">"+phoneData[i].phoneName+"</a></p>\n";
						}
					}
					if(phoneData[i].stateInfo == "0900001"){
						detailViewHtml += "			<div class=\"prdLinkBox2\">\n";
					}else{
						detailViewHtml += "			<div class=\"prdLinkBox\">\n";
					}
					detailViewHtml += "				<ul>\n";
					detailViewHtml += "					<li><a href=\"#quick_view\" onclick=\"javascript:quickview_view(event,'quickview',"+(i+1)+",'"+phoneData[i].phoneModel+"');\" title=\"手機簡介\">手機簡介</a></li>\n";
					if(phoneData[i].stateInfo != "0900001"){
						detailViewHtml += "				<li id=\""+phoneData[i].phoneModel+"_d\"><a href=\"javascript:setCookie('"+phoneData[i].phoneModel+"','"+phoneData[i].miniName+"','"+phoneData[i].xsmallImage2+"');\" title=\"評鑑\">評鑑</a></li>\n";
					}
					detailViewHtml += "				</ul>\n";
					detailViewHtml += "			</div>\n";
					detailViewHtml += "		</div>\n";
					detailViewHtml += "		<div class=\"prdQspec\">\n";
					detailViewHtml += "			<h4>檢視規格</h4>\n";
					detailViewHtml += "			<ul>\n";
					for(var k=1; k<11; k++){
					if(eval("phoneData["+i+"].quickSpecImage"+k) != " "){
						detailViewHtml += "				<li>\n";
						detailViewHtml += "					<div class=\"spec_icon\"><a onMouseOver=\"spec_balloon("+k+",'"+phoneData[i].phoneModel+"')\" onMouseOut=\"selectHide('"+phoneData[i].phoneModel+"_"+k+"')\">\n";
							if((eval("phoneData["+i+"].quickSpecImage"+k)).substring(0,4) == 'http') {
								detailViewHtml += "						<img src=\""+eval("phoneData["+i+"].quickSpecImage"+k)+"\" alt=\"\"></a>\n";
							} else {
								detailViewHtml += "						<img src=\""+PUB_LOCAL+""+QUICKSPEC_SAVE_PATH+""+eval("phoneData["+i+"].quickSpecImage"+k)+"\" alt=\"\"></a>\n";
							}							
						detailViewHtml += "					</div>\n";
						detailViewHtml += "					<div class=\"spec_balloon_h1 spec_balloon\" id=\""+phoneData[i].phoneModel+"_"+k+"\">\n";
							detailViewHtml += "						<div class=\"spec_balloon_con\">"+eval("phoneData["+i+"].quickSpecDesc"+k)+"</div>\n";
						detailViewHtml += "					</div>\n";
						detailViewHtml += "				</li>\n";
					}
					}						
					detailViewHtml += "			</ul>\n";
					detailViewHtml += "		</div>\n";					
					detailViewHtml += "		<div class=\"prdKeyFeat\">\n";
					detailViewHtml += "			<h4>主要特色</h4>\n";
					detailViewHtml += "			<ul class=\"dotList\">\n";
					if(phoneData[i].features1 != " "){
						detailViewHtml += "				<li>"+phoneData[i].features1+"</li>\n";
					}
					if(phoneData[i].features2 != " "){
						detailViewHtml += "				<li>"+phoneData[i].features2+"</li>\n";
					}
					if(phoneData[i].features3 != " "){
						detailViewHtml += "				<li>"+phoneData[i].features3+"</li>\n";
					} 
					if(phoneData[i].features4 != " "){
						detailViewHtml += "				<li>"+phoneData[i].features4+"</li>\n";
					}
					if(phoneData[i].features5 != " "){
						detailViewHtml += "				<li>"+phoneData[i].features5+"</li>\n";
					} 
					if(phoneData[i].features6 != " "){
						detailViewHtml += "				<li>"+phoneData[i].features6+"</li>\n";
					}
					detailViewHtml += "			</ul>\n";
					detailViewHtml += "		</div>\n";
					detailViewHtml += "	</li>\n";
				}
				detailViewHtml += "</ul>\n";
				if(phoneModelLength == 0){
					detailViewHtml = "<div class=\"box_result\">";
					detailViewHtml+= "	<strong>抱歉,</strong> 未發現產品";
					detailViewHtml+= "</div>";
				}
				document.getElementById("detailView").innerHTML = detailViewHtml;
			}
			document.getElementById("thumbnailView").style.display="none";
			document.getElementById("imageView").style.display="none";
			document.getElementById("detailView").style.display="";
		}		
		document.getElementById("viewIcon").innerHTML = inhtml;	
		compareSetting();	
	}
	function spec_balloon(n, objNm) {
		for(var i = 1; i <= 10; i++) {		
			obj_d = document.getElementById(objNm+'_'+i);
			if ( n == i ) {
					obj_d.style.display = "block";
			} 
		}
	}
	var ns4=document.layers
	var ie4=document.all
	var ns6=document.getElementById&&!document.all
	if (ns4||ns6) document.captureEvents(Event.MOUSEMOVE);
	function quickview_view(e,id,objCount,phoneModel) {
		/*
		ProductsDwrAction.selectPhoneColor({				 
				phoneModel:phoneModel		
			},
			function funColorSearch(data){
				var colorHtml = "";
				
				for(var i = 0; i < data.length; i++){
					colorHtml += "<li><span style=\"background-color:#"+data[i].colorValue+";\"></span></li>\n";
				}
				
				for(var j = data.length; j< 10; j++){
					colorHtml += "<li></li>\n";
				}
				
				document.getElementById("colorList").innerHTML = colorHtml;
			}
		);
		*/
		var varLeft;
		var varTop;
			
		if(ns4||ns6){		
			varLeft = (e.clientX+window.pageXOffset);
			varTop = (e.clientY+window.pageYOffset+100);		
		}else{
			varLeft = (event.clientX+document.documentElement.scrollLeft);
			varTop = (event.clientY+document.documentElement.scrollTop+100);
		}
		if(document.documentElement.clientWidth > 980){
			if(varLeft > 650){
				varLeft = (varLeft-((document.documentElement.clientWidth-980)/2))-180;
			}else{
				varLeft = (varLeft-((document.documentElement.clientWidth-980)/2))+200; 
			}
		}else{
			varLeft += 200; 
		}
		if(ns4||ns6){	
			document.getElementById(id).style.left=varLeft+"px";
			document.getElementById(id).style.top=varTop+"px";
		}else{
			document.getElementById(id).style.left=varLeft;
			document.getElementById(id).style.top=varTop;
		}
		if(phoneData != null){		
			var arrNum = objCount - 1;	
			if(phoneData[arrNum].stateInfo == "0900001"){
				document.getElementById("detail_bt").style.display="none";
				if(phoneData[arrNum].quickViewImage.substring(0, 4) != 'http'){
					document.getElementById("phoneQuickImage").innerHTML = "<img src=\""+phoneData[arrNum].quickViewImage+"\" id=\"quick_phone_image\" width=\"180\" height=\"180\" alt=\""+phoneData[arrNum].phoneName+"\">";
				}
				if(phoneData[arrNum].quickViewImage.substring(0, 4) == 'http'){
					document.getElementById("phoneQuickImage").innerHTML = "<img src=\""+phoneData[arrNum].quickViewImage+"\" id=\"quick_phone_image\" width=\"180\" height=\"180\" alt=\""+phoneData[arrNum].phoneName+"\">";
				}
			}else{
				var phoneUrl = phoneData[arrNum].miniName.toLowerCase();
				phoneUrl = phoneUrl.replace(/\s/g, "-").replace(/samsung|sgh-|sch-|gt-/g, "");
				phoneUrl = "samsung-" + phoneUrl;			
			
				if(phoneData[arrNum].quickViewImage.substring(0, 4) != 'http'){
					document.getElementById("phoneQuickImage").innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/"+ phoneUrl + "\" class=\"leftA mt3\" title=\""+phoneData[arrNum].phoneName+"\"><img src=\""+phoneData[arrNum].quickViewImage+"\" id=\"quick_phone_image\" width=\"180\" height=\"180\" alt=\""+phoneData[arrNum].phoneName+"\"></a>";
				}
				if(phoneData[arrNum].quickViewImage.substring(0, 4) == 'http'){
					document.getElementById("phoneQuickImage").innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/"+ phoneUrl + "\" class=\"leftA mt3\" title=\""+phoneData[arrNum].phoneName+"\"><img src=\""+phoneData[arrNum].quickViewImage+"\" id=\"quick_phone_image\" width=\"180\" height=\"180\" alt=\""+phoneData[arrNum].phoneName+"\"></a>";
				}		
				document.getElementById("detail_bt").style.display="block";
				document.getElementById("detail_bt").innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/" + phoneUrl + "\" class=\"leftA mt3\" title=\""+phoneData[arrNum].phoneName+"\"><img src=\""+IMG_URL_ROOT+"products/bt_detail.gif\" id=\"detail_bt_image\" alt=\""+phoneData[arrNum].phoneName+"\"></a>";
			}
			document.getElementById("quick_phone_name").innerHTML = phoneData[arrNum].phoneName;
			var inFeature = "";
			if(phoneData[arrNum].features1 != " "){
				inFeature += "<li>"+FFStrCutByteString(phoneData[arrNum].features1,22)+"</li>";
			}
			if(phoneData[arrNum].features2 != " "){
				inFeature += "<li>"+FFStrCutByteString(phoneData[arrNum].features2,22)+"</li>";
			}
			if(phoneData[arrNum].features3!= " "){
				inFeature += "<li>"+FFStrCutByteString(phoneData[arrNum].features3,22)+"</li>";
			}
			if(phoneData[arrNum].features4 != " "){
				inFeature += "<li>"+FFStrCutByteString(phoneData[arrNum].features4,22)+"</li>";
			}
			if(phoneData[arrNum].features5 != " "){
				inFeature += "<li>"+FFStrCutByteString(phoneData[arrNum].features5,22)+"</li>";
			}
			if(phoneData[arrNum].features6 != " "){
				inFeature += "<li>"+FFStrCutByteString(phoneData[arrNum].features6,22)+"</li>";
			}
			document.getElementById("qFeaturesList").innerHTML = "<ul class=\"dotList mt5\">"+inFeature+"</ul>";
			document.getElementById("slogon").innerHTML = phoneData[arrNum].slogon;
			var detailViewHtml = "";
			for(j = 1 ; j < 11 ; j++){
				if(eval("phoneData["+arrNum+"].quickSpecImage"+j) != " "){
					detailViewHtml += "				<li>\n";
					if((eval("phoneData["+arrNum+"].quickSpecImage"+j)).substring(0,4) == 'http') {
						detailViewHtml += "				<div class=\"spec_icon\"><a onMouseOver=\"spec_balloon("+j+",'spec_balloon')\" onMouseOut=\"selectHide('spec_balloon_"+j+"')\"><img src=\""+eval("phoneData["+arrNum+"].quickSpecImage"+j)+"\" id=\"quick_view_spec_image"+j+"\" alt=\"\" ></a></div>\n";
					} else { 
						detailViewHtml += "				<div class=\"spec_icon\"><a onMouseOver=\"spec_balloon("+j+",'spec_balloon')\" onMouseOut=\"selectHide('spec_balloon_"+j+"')\"><img src=\""+PUB_LOCAL+""+QUICKSPEC_SAVE_PATH+""+eval("phoneData["+arrNum+"].quickSpecImage"+j)+"\" id=\"quick_view_spec_image"+j+"\" alt=\"\" ></a></div>\n";
					}	
					detailViewHtml += "				<div class=\"spec_balloon_h"+j+" spec_balloon\" id=\"spec_balloon_"+j+"\"><div class=\"spec_balloon_con\" id=\"spec_balloon_con_"+j+"\">"+eval("phoneData["+arrNum+"].quickSpecDesc"+j)+"</div></div>\n";
					detailViewHtml += "				</li>\n";
				}
			}
			document.getElementById("qSpecList").innerHTML = "<ul>"+detailViewHtml+"</ul>";
		}else{
			alert("載入中....");
			return;
		}
		document.getElementById(id).style.visibility='visible';
	}
	var crossobj;
	function drag_drop(e){	
		if (ie4&&dragapproved){
			crossobj.style.left=tempx+event.clientX-offsetx
			crossobj.style.top=tempy+event.clientY-offsety
			return false
		} else if (ns6&&dragapproved) {
			crossobj.style.left=tempx+e.clientX-offsetx+"px"
			crossobj.style.top=tempy+e.clientY-offsety+"px"
			return false
		}
	}
	function initializedrag(e, id){
		crossobj=ns6? document.getElementById(id) : document.all[id]	
		var firedobj=ns6? e.target : event.srcElement
		var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
		while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!=id){
			firedobj=ns6? firedobj.parentNode : firedobj.parentElement
		}
		if (firedobj.id==id){
			offsetx=ie4? event.clientX : e.clientX
			offsety=ie4? event.clientY : e.clientY
			tempx=parseInt(crossobj.style.left)
			tempy=parseInt(crossobj.style.top)
			dragapproved=true
			document.onmousemove=drag_drop
		}
	}
	document.onmouseup=new Function("dragapproved=false")
	function hidebox(id){
		crossobj=ns6? document.getElementById(id) : document.all[id]
		if (ie4||ns6)
			crossobj.style.visibility="hidden"
		else if (ns4)
			document.quickview.visibility="hide"
	}
	function setCookie(phoneModel, phoneName, img){	
		var name="phoneCompare";
		var todayDate = new Date();
		var expiredays = 1;
	  	todayDate.setDate( todayDate.getDate() + expiredays );
	  	var cookieVal = getCookie(name);  	
	  	var value = phoneModel+"|"+phoneName+"|"+img;
		if(cookieVal != null){
			if( cookieVal.indexOf(value) < 0 ){
				if(cookieVal == ""){
					value = value;	
				}else{
					value = cookieVal+"^"+value;
				}					
			}else{
				alert(P01);
				return;
			}
			if(cookieVal.split("^").length > 2){
				alert(P02);
				return;
			}
		}
	  	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
	  	addCompare(phoneModel, phoneName, img);
	  	compareTxtSetting(value);
	  	//laypopCompareView2(value);  
	  	laypopCompareView();	
	}
	function getCookie(name) {
		var arg = name + "="; 
		var alen = arg.length;
		var clen = document.cookie.length;		
		var i = 0;
		while (i < clen) {
			var j = i + alen;
			if (document.cookie.substring(i, j) == arg)
	    		return getCookieVal (j);
	    	i = document.cookie.indexOf(" ", i) + 1;
	    	if (i == 0)
	    		break;
		}
		return null;
	}
	function getCookieVal(offset) {
		var endstr = document.cookie.indexOf (";", offset);
		if (endstr == -1)
			endstr = document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr));
	}
	function delCookie(phoneModel, phoneName, img){
		var name = "phoneCompare";
		var value = "";
		var todayDate = new Date();
		var expiredays = 1;
	  	todayDate.setDate( todayDate.getDate() + expiredays );
		var cookieVal = getCookie(name);
		if(cookieVal != null){	
			var rowCookie = cookieVal.split("^");
			var j = 0;
			for(var i = 0 ; i < rowCookie.length; i++){
				if(rowCookie[i].indexOf(phoneModel) == -1){
					j++;
					if(j == 1){
						value += rowCookie[i];
					}else{
						value += "^"+rowCookie[i];
					}
				}
			}
			document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";
		}
		removeCompare(phoneModel, phoneName, img);
		compareTxtSetting(value);
		//laypopCompareView2(value);
		laypopCompareView();
	}
	function delPhoneModelCookie(phoneModel){
		var name = "phoneCompare";
		var value = "";
		var todayDate = new Date();
		var expiredays = 1;
	  	todayDate.setDate( todayDate.getDate() + expiredays );
	  	var textCookieVal = phoneModel.split("|");
		var cookieVal = getCookie(name);
		if(cookieVal != null){	
			var rowCookie = cookieVal.split("^");
			var j = 0;
			for(var k = 0; k < textCookieVal.length; k++){
				for(var i = 0 ; i < rowCookie.length; i++){	
					var colCookie = rowCookie[i].split("|");		
					if(textCookieVal[k] == colCookie[0]){
						j++;
						if(j == 1){
							value += rowCookie[i];
						}else{
							value += "^"+rowCookie[i];
						}					
					}
				}
			}
			document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";
		}
		compareTxtSetting(value);
	}
	function addCompare(phoneModel, phoneName, img){
		if(document.getElementById(phoneModel+"_t") != null){
			document.getElementById(phoneModel+"_t").className = "on";
			document.getElementById(phoneModel+"_t").innerHTML = "<a href=\"javascript:delCookie('"+phoneModel+"','"+phoneName+"','"+img+"');\" title=\"Remove\">remove</a>";
		}
		if(document.getElementById(phoneModel+"_i") != null){
			document.getElementById(phoneModel+"_i").className = "on";
			document.getElementById(phoneModel+"_i").innerHTML = "<a href=\"javascript:delCookie('"+phoneModel+"','"+phoneName+"','"+img+"');\" title=\"Remove\">remove</a>";
		}
		if(document.getElementById(phoneModel+"_d") != null){
			document.getElementById(phoneModel+"_d").className = "on";
			document.getElementById(phoneModel+"_d").innerHTML = "<a href=\"javascript:delCookie('"+phoneModel+"','"+phoneName+"','"+img+"');\" title=\"Remove\">remove</a>";
		}
		if(document.getElementById(phoneModel+"_compare") != null){
			document.getElementById(phoneModel+"_compare").className = "on";
			document.getElementById(phoneModel+"_compare").innerHTML = "<a href=\"javascript:delCookie('"+phoneModel+"','"+phoneName+"','"+img+"');\" title=\"Remove\">remove</a>";
		}
	}
	function removeCompare(phoneModel, phoneName, img){
		if(document.getElementById(phoneModel+"_t") != null){
			document.getElementById(phoneModel+"_t").className = "";
			document.getElementById(phoneModel+"_t").innerHTML = "<a href=\"javascript:setCookie('"+phoneModel+"','"+phoneName+"','"+img+"');\" title=\">評鑑\">評鑑</a>";
		}
		if(document.getElementById(phoneModel+"_i") != null){
			document.getElementById(phoneModel+"_i").className = "";
			document.getElementById(phoneModel+"_i").innerHTML = "<a href=\"javascript:setCookie('"+phoneModel+"','"+phoneName+"','"+img+"');\" title=\">評鑑\">評鑑</a>";
		}
		if(document.getElementById(phoneModel+"_d") != null){
			document.getElementById(phoneModel+"_d").className = "";
			document.getElementById(phoneModel+"_d").innerHTML = "<a href=\"javascript:setCookie('"+phoneModel+"','"+phoneName+"','"+img+"');\" title=\">評鑑\">評鑑</a>";
		}
		if(document.getElementById(phoneModel+"_compare") != null){
			document.getElementById(phoneModel+"_compare").className = "";
			document.getElementById(phoneModel+"_compare").innerHTML = "<a href=\"javascript:setCookie('"+phoneModel+"','"+phoneName+"','"+img+"');\" title=\">評鑑\">評鑑</a>";
		}
	}
	function compareTxtSetting(value){
		var txtArr = value.split("^");	
		var modelArr;
		for(var i=0; i < 3; i++){
			if( txtArr == ""){
				//document.getElementById("compare"+(i+1)).value="---";
				document.getElementById("compare"+(i+1)).innerHTML = "<img src='"+IMG_URL_ROOT+"products/temp.gif' alt='' />";
			}else{				
				if( txtArr[i] != null ){										
					modelArr = txtArr[i].split("|");
					//document.getElementById("compare"+(i+1)).value = replace(modelArr[1],"Samsung ","");
					//document.getElementById("compare"+(i+1)).value = modelArr[1];
					document.getElementById("compareWidth"+(i+1)).style.width= (modelArr[1].length*8.5)+"px";
					document.getElementById("compare"+(i+1)).innerHTML = changeTxt(null,modelArr[1]);
				}else{
					//document.getElementById("compare"+(i+1)).value = "---";
					document.getElementById("compare"+(i+1)).innerHTML = "<img src='"+IMG_URL_ROOT+"products/temp.gif' alt='' />";
				}
			}
		}
	}
	function laypopCompareView(){
		var comparePhoneText = "0 支手機";
		var comparePhoneInfoHtml = "";
		var rowCookie = "";
		if(getCookie("phoneCompare") != null && getCookie("phoneCompare") != ""){						
			rowCookie = getCookie("phoneCompare").split("^");			
			var colCookie;
			comparePhoneText = rowCookie.length+" 支手機";
			for(var i=0; i < rowCookie.length; i++){
				colCookie = rowCookie[i].split("|");
				// 0505
				comparePhoneInfoHtml += "<li class=\"on\">\n";
				comparePhoneInfoHtml += "	<input type=\"checkbox\" id=\"comparePhoneModelChk\" name=\"comparePhoneModelChk\" value=\""+colCookie[0]+"|"+colCookie[1]+"|"+colCookie[2]+"\" class=\"chk\">\n";
				if((colCookie[2]).substring(0,4) == 'http') {
					comparePhoneInfoHtml += "	<img src=\""+colCookie[2]+"\" alt=\"\">\n";
				} else {
					comparePhoneInfoHtml += "	<img src=\""+colCookie[2]+"\" alt=\"\">\n";
				}	
				comparePhoneInfoHtml += "	<p class=\"p_tit\">"+changeTxt(null, colCookie[1])+"</p>\n";
				comparePhoneInfoHtml += "</li>\n";
			}
			for(var j=0; j < (3 - rowCookie.length); j++){
				comparePhoneInfoHtml += "<li>\n";
				comparePhoneInfoHtml += "	<input type=\"checkbox\" id=\"comparePhoneModelChk\" name=\"comparePhoneModelChk\" class=\"chk\" disabled>\n";
				comparePhoneInfoHtml += "	<p class=\"p_tit\">---</p>\n";
				comparePhoneInfoHtml += "</li>\n";
			}
		}else{
			for(var k=0; k < 3; k++){
				comparePhoneInfoHtml += "<li>\n";
				comparePhoneInfoHtml += "	<input type=\"checkbox\" id=\"comparePhoneModelChk\" name=\"comparePhoneModelChk\" class=\"chk\" disabled>\n";
				comparePhoneInfoHtml += "	<p class=\"p_tit\">---</p>\n";
				comparePhoneInfoHtml += "</li>\n";
			}
		}
		document.getElementById("comparePhone").innerHTML = comparePhoneText;
		document.getElementById("comparePhoneInfo").innerHTML = comparePhoneInfoHtml;
		if(rowCookie.length == 0){
			document.getElementById("compId1").innerHTML = "立刻評鑑！";
			document.getElementById("compId2").innerHTML = "刪除";
		}else{
			document.getElementById("compId1").innerHTML = "<a href=\"javascript:;\" OnClick=\"funCompareResult();selectHide2('laypop_compare')\" title=\"立刻評鑑！\">立刻評鑑！</a>";
			document.getElementById("compId2").innerHTML = "<a href=\"#delete\" OnClick=\"javascript:delCompare();\" title=\"刪除\">刪除</a>";		
		}
		document.getElementById("laypop_compare").style.display='block';
		funDisplayNone();
	}
	var setTime;
	function funDisplayNone(){
		if (document.getElementById("laypop_compare").style.display == "block"){ 
			setTime = setTimeout("selectHide2('laypop_compare')", 15000);
		}else{
			setTime = setTimeout("funDisplayNone()",50);		
		}
	}
	function laypopCompareView2(cookieValue){
		var comparePhoneText = "0 支手機";
		var comparePhoneInfoHtml = "";
		var rowCookie = "";
		if(cookieValue != null && cookieValue != ""){						
			rowCookie = cookieValue.split("^");			
			var colCookie;
			comparePhoneText = rowCookie.length+" 支手機";
			for(var i=0; i < rowCookie.length; i++){
				colCookie = rowCookie[i].split("|");
				comparePhoneInfoHtml += "<li class=\"on\">\n";
				comparePhoneInfoHtml += "	<input type=\"checkbox\" id=\"comparePhoneModelChk\" name=\"comparePhoneModelChk\" value=\""+colCookie[0]+"|"+colCookie[1]+"|"+colCookie[2]+"\" class=\"chk\">\n";
				if((colCookie[2]).substring(0,4) == 'http') {
					comparePhoneInfoHtml += "	<img src=\""+colCookie[2]+"\" alt=\"\">\n";
				} else {
					comparePhoneInfoHtml += "	<img src=\""+colCookie[2]+"\" alt=\"\">\n";
				}	
				comparePhoneInfoHtml += "	<p class=\"p_tit\">"+changeTxt(null,colCookie[1])+"</p>\n";
				comparePhoneInfoHtml += "</li>\n";
			}
			for(var j=0; j < (3 - rowCookie.length); j++){
				comparePhoneInfoHtml += "<li>\n";
				comparePhoneInfoHtml += "	<input type=\"checkbox\" id=\"comparePhoneModelChk\" name=\"comparePhoneModelChk\" class=\"chk\" disabled>\n";
				comparePhoneInfoHtml += "	<p class=\"p_tit\">---</p>\n";
				comparePhoneInfoHtml += "</li>\n";
			}
		}else{
			for(var k=0; k < 3; k++){
				comparePhoneInfoHtml += "<li>\n";
				comparePhoneInfoHtml += "	<input type=\"checkbox\" id=\"comparePhoneModelChk\" name=\"comparePhoneModelChk\" class=\"chk\" disabled>\n";
				comparePhoneInfoHtml += "	<p class=\"p_tit\">---</p>\n";
				comparePhoneInfoHtml += "</li>\n";
			}
		}
		document.getElementById("comparePhone").innerHTML = comparePhoneText;
		document.getElementById("comparePhoneInfo").innerHTML = comparePhoneInfoHtml;
		if(rowCookie.length == 0){
			document.getElementById("compId1").innerHTML = "立刻評鑑！";
			document.getElementById("compId2").innerHTML = "刪除";
		}else{
			document.getElementById("compId1").innerHTML = "<a href=\"javascript:;\" OnClick=\"funCompareResult();selectHide('laypop_compare')\" title=\"立刻評鑑！\">立刻評鑑！</a>";
			document.getElementById("compId2").innerHTML = "<a href=\"#delete\" OnClick=\"javascript:delCompare();\" title=\"刪除\">刪除</a>";		
		}
		
		if(document.getElementById("laypop_compare").style.display == "block"){
			document.getElementById("laypop_compare").style.display='block';
		}else if(document.getElementById("laypop_compare").style.display == "none"){
			document.getElementById("laypop_compare").style.display="none";
		}
	}
	function delCompare(){
		var delCompareVar;	
		var name="phoneCompare";
		var value = "";
		var phoneVal;
		var cookieVal = getCookie(name);
		var rowCookie = "";
		var chkCount = 0;
		if(cookieVal !=null && cookieVal != ""){
			rowCookie = cookieVal.split("^");
		}
		var todayDate = new Date();
		var expiredays = 1;
	  	todayDate.setDate( todayDate.getDate() + expiredays );
		for(var i = 0 ; i < document.getElementsByName("comparePhoneModelChk").length; i++){		
			if(document.getElementsByName("comparePhoneModelChk")[i].checked){
				phoneVal = document.getElementsByName("comparePhoneModelChk")[i].value.split("|");
				if(cookieVal !=null && cookieVal != ""){
					for(var j = 0 ; j < rowCookie.length; j++){					
						if( rowCookie[j].indexOf(phoneVal[0]) == 0 ){
							rowCookie[j] = "";
							removeCompare(phoneVal[0], phoneVal[1], phoneVal[2]);
							chkCount++;
						}
					}		
				}
			}
		}
		if(chkCount == 0){
			return;
		}
		var l = 0;
		for(var k = 0; k < rowCookie.length ; k++){		
			if(rowCookie[k] != ""){
				l++;
				if(l == 1){
					value += rowCookie[k];
				}else{
					value += "^"+rowCookie[k];
				}
			}
		}
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";	
		compareTxtSetting(value);
		laypopCompareView2(value);
		if(document.getElementById("phoneComparePage").style.display == ""){
			funCompareResult();
		}
	}
	function delAllCompare(){
		var delCompareVar;	
		var name="phoneCompare";
		var value = "";
		var todayDate = new Date();
		var expiredays = 1;
	  	todayDate.setDate( todayDate.getDate() + expiredays );
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";	
		compareTxtSetting(value);
		laypopCompareView2(value);
	}
	function funQuickSearch(){
		var searchSpecSeqNo="";
		var searchCnt=0;
		var advanceIsChoice = false;
		var advanceLen = document.getElementsByName("chkAdvance").length;
		for(var i = 0; i < advanceLen ; i++){
			if(document.getElementsByName("chkAdvance")[i] != null){
				if(document.getElementsByName("chkAdvance")[i].checked){
					searchSpecSeqNo += document.getElementsByName("chkAdvance")[i].value;
					advanceIsChoice = true;
					searchSpecSeqNo += ",";
				}
			}
		}
		if(advanceIsChoice)
			searchCnt++;
		var chkLen = document.getElementsByName("chkQuick").length;
		for(var i = 0; i < chkLen ; i++){
			if(document.getElementsByName("chkQuick")[i] != null){
				if(document.getElementsByName("chkQuick")[i].checked){
					searchSpecSeqNo += document.getElementsByName("chkQuick")[i].value;
					searchCnt++;
					searchSpecSeqNo += ",";
				}
			}
		}	
		funSearch(searchSpecSeqNo, searchCnt);
		if((feature_num !="")&& quick_count == 1){
		
				var form = document.frm ;
				var chkCnt = 0;
				
				
				for(var j=0; j<form.chkAdvance.length; j++){
					if(chkCnt < 2){
						if(form.chkAdvance[j].checked == true){
							if(chkCnt == 0){
								form.chkDtl1.value = form.chkAdvance[j].value
							}else{
								form.chkDtl2.value = form.chkAdvance[j].value
							}
							chkCnt = chkCnt + 1;
						}
					}
					else
					{
						break;
					}
								
				}
				
				for(var j=0; j<form.chkQuick.length; j++){
					if(chkCnt < 2){
						if(form.chkQuick[j].checked == true){
							if(chkCnt == 0){
								form.chkDtl1.value = form.chkQuick[j].value
							}else{
								form.chkDtl2.value = form.chkQuick[j].value
							}
							chkCnt = chkCnt + 1;
						}
					}
					else
					{
						break;
					}
								
				}
				
				//alert("end");
				
				form.action = "/mobile-phones/phone-search.do";
				form.submit(); 
		}
	}
	function funSearch(searchSpecSeqNo, searchCnt){//searchSpecSeqNo
		try {
			var chkAdvanceLen = document.getElementsByName("chkAdvance").length;	
			for(var i = 0; i < chkAdvanceLen ; i++){
				document.getElementsByName("chkAdvance")[i].disabled = true;
			}
			var chkLen = document.getElementsByName("chkQuick").length;	
			for(var i = 0; i < chkLen ; i++){
				document.getElementsByName("chkQuick")[i].disabled = true;
			}
			var kind = kindparam;
			document.getElementById("phoneSearchPage").style.display = "";
			document.getElementById("phoneComparePage").style.display = "none";
			document.getElementById("compPhone").style.display = "none";
			
			if(feature_num != "" || quick_count == 0){
			//alert("aa111===");
			}else{
			document.getElementById("thumbnailView").innerHTML = "載入中...";
			document.getElementById("imageView").innerHTML = "載入中...";
			document.getElementById("detailView").innerHTML = "載入中...";
			}
			var sort = document.getElementById("sort").value;
			document.getElementById("sort").disabled = true;
			ProductsDwrAction.selectGSfcPrdSearchDwrList({
					 searchSpecSeqNo:searchSpecSeqNo
					,searchCnt:searchCnt
					,kind:kind
					,order:document.getElementById("sort").value
					,phoneModel:""		
				},
				function funPhoneSearch(data){
				if(feature_num !="" || quick_count == 0){
					phoneData = data;
					var iconGbn = document.getElementById("viewGbn").value;				
					viewIconChange(iconGbn);
					var chkLen = document.getElementsByName("chkQuick").length;				
					for(var i = 0; i < chkLen ; i++){
						document.getElementsByName("chkQuick")[i].disabled = false;
					}
					var chkAdvanceLen = document.getElementsByName("chkAdvance").length;				
					for(var i = 0; i < chkAdvanceLen ; i++){
						document.getElementsByName("chkAdvance")[i].disabled = false;
					}
					document.getElementById("sort").disabled = false;
					compareSetting();
					quick_count=1;
				}else{
					phoneData = data;				
					var inhtml = "";
					document.getElementById("totalPhone").innerHTML = data.length;
					inhtml += "<ul class=\"prdList\">\n";
					for(var j = 0; j < data.length; j++){									
						inhtml += "	<li>\n";
						inhtml += "		<div class=\"prd120\">\n";
						
						var phoneUrl = data[j].miniName.toLowerCase();
						phoneUrl = phoneUrl.replace(/\s/g, "-").replace(/samsung|sgh-|sch-|gt-/g, "");
						phoneUrl = "samsung-" + phoneUrl;
						
						if(kind == 'upcoming'){
								if(data[j].smallImage.substring(0, 4) != 'http'){
									inhtml += "<img src=\""+data[j].smallImage+"\" width=\"120\" height=\"120\" alt=\""+data[j].phoneName+"\">\n";
								}
								if(data[j].smallImage.substring(0, 4) == 'http'){
									inhtml += "<img src=\""+data[j].smallImage+"\" width=\"120\" height=\"120\" alt=\""+data[j].phoneName+"\">\n";
								}
						}else{
								if(data[j].smallImage.substring(0, 4) != 'http'){
									inhtml += "<a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams +"\" title=\""+data[j].phoneName+"\"><img src=\""+data[j].smallImage+"\" width=\"120\" height=\"120\" alt=\""+data[j].phoneName+"\"></a>\n";
								}
								if(data[j].smallImage.substring(0, 4) == 'http'){			
									inhtml += "<a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams +"\" title=\""+data[j].phoneName+"\"><img src=\""+data[j].smallImage+"\" width=\"120\" height=\"120\" alt=\""+data[j].phoneName+"\"></a>\n";
								}					
						}
						if(data[j].newgbn == "new"){
							if(data[j].stateInfo == "0900001"){//2008.04.29
								inhtml += "			<p class=\"prd_tit2\"><img src=\""+IMG_URL_ROOT+"common/ico_new.gif\" alt=\"new\" class=\"bNew\">"+data[j].phoneName+"</p>\n";
							}else{
								inhtml += "			<p class=\"prd_tit2\"><img src=\""+IMG_URL_ROOT+"common/ico_new.gif\" alt=\"new\" class=\"bNew\"> <a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams + "\" title=\""+data[j].phoneName+"\">"+data[j].phoneName+"</a></p>\n";
							}
						}else{
							if(data[j].stateInfo == "0900001"){
								inhtml += "			<p class=\"prd_tit2\">"+data[j].phoneName+"</p>\n";
							} else {
								inhtml += "			<p class=\"prd_tit2\"><a href=\""+URL_ROOT+""+phone_detail+"" + phoneUrl + phonePageParams +"\" title=\""+data[j].phoneName+"\">"+data[j].phoneName+"</a></p>\n";
							}
						}
						if(data[j].stateInfo == "0900001"){
							inhtml += "					<div class=\"prdLinkBox2\">\n";
						}else{
							inhtml += "					<div class=\"prdLinkBox\">\n";
						}
						inhtml += "				<ul>\n";
						inhtml += "					<li><a href=\"#quick_view\" onclick=\"javascript:quickview_view(event,'quickview',"+(j+1)+",'"+data[j].phoneModel+"');\" title=\"手機簡介\">手機簡介</a></li>\n";
						if(data[j].stateInfo != "0900001"){
							inhtml += "					<li id=\""+data[j].phoneModel+"_t\"><a href=\"javascript:setCookie('"+data[j].phoneModel+"','"+data[j].miniName+"','"+data[j].xsmallImage2+"');\" title=\"評鑑\">評鑑</a></li>\n";
						}
						inhtml += "				</ul>\n";
						inhtml += "			</div>\n";					
						inhtml += "		</div>\n";
						inhtml += "	</li>\n";
						if(document.getElementById(data[j].phoneModel+"_brief") != null){
							document.getElementById(data[j].phoneModel+"_brief").innerHTML = "<a href=\"#quick_view\" onclick=\"javascript:quickview_view(event,'quickview',"+(j+1)+",'"+data[j].phoneModel+"');\" title=\"手機簡介\">手機簡介</a>";
							document.getElementById(data[j].phoneModel+"_compare").innerHTML = "<a href=\"javascript:setCookie('"+data[j].phoneModel+"','"+data[j].miniName+"','"+data[j].xsmallImage2+"');\" title=\"評鑑\">評鑑</a>";
						}
					}
					inhtml += "</ul>\n";
					if(data.length == 0){
						inhtml = "<div class=\"box_result\">";
						inhtml+= "	<strong>抱歉,</strong> 未發現產品";
						inhtml+= "</div>";
					}
					imageViewHtml="";
					detailViewHtml="";
					document.getElementById("thumbnailView").innerHTML = inhtml;
					document.getElementById("imageView").innerHTML = imageViewHtml;
					document.getElementById("detailView").innerHTML = detailViewHtml;			
					var iconGbn = document.getElementById("viewGbn").value;				
					viewIconChange(iconGbn);
					var chkLen = document.getElementsByName("chkQuick").length;				
					for(var i = 0; i < chkLen ; i++){
						document.getElementsByName("chkQuick")[i].disabled = false;
					}
					var chkAdvanceLen = document.getElementsByName("chkAdvance").length;				
					for(var i = 0; i < chkAdvanceLen ; i++){
						document.getElementsByName("chkAdvance")[i].disabled = false;
					}
					document.getElementById("sort").disabled = false;
					compareSetting();
					}
				}
			);
		}catch(e){
			alert(PPP);
		}	
	}
	function funClear(){
		var chkLen = document.getElementsByName("chkQuick").length;				
		for(var i = 0; i < chkLen ; i++){
			document.getElementsByName("chkQuick")[i].disabled = true;
			document.getElementsByName("chkQuick")[i].checked = false;
		}
		funQuickSearch();	
	}
	
	function compareSetting(){		
		if(getCookie("phoneCompare") != null && getCookie("phoneCompare") != ""){			
			var rowCookie = getCookie("phoneCompare").split("^");						
			var colCookie;
			for(var i=0; i < rowCookie.length; i++){
				colCookie = rowCookie[i].split("|");				
				addCompare(colCookie[0],colCookie[1],colCookie[2]);			
				//document.getElementById("compare"+(i+1)).value=replace(colCookie[1],"Samsung ","");
				//document.getElementById("compare"+(i+1)).value=colCookie[1];
				document.getElementById("compareWidth"+(i+1)).style.width = (colCookie[1].length*8.5)+"px";
				document.getElementById("compare"+(i+1)).innerHTML = changeTxt(null,colCookie[1]);
			}
		}
	}
	function funPhoneSort(){
		var sort = document.getElementById("sort").value;
		if(sort != ""){		
			funQuickSearch();
		}
	}
	function funPhoneCommonSearch(){	
		funQuickSearch();
	}
	var phoneComboHtml="";
	function funCompareResult(){	
		funPhoneComboHtml();
		document.getElementById("phoneSearchPage").style.display = "none";
		document.getElementById("phoneComparePage").style.display = "";
		document.getElementById("compPhone").style.display = "";
		var spCompHead1 = "<select id=\"comparePhone1\" name=\"comparePhone1\" style=\"width:150px\" OnChange=\"javascript:funCompareOnChange(this)\">\n<option value=\"\">Compare more</option>\n";
		var spCompHead2 = "<select id=\"comparePhone2\" name=\"comparePhone2\" style=\"width:150px\" OnChange=\"javascript:funCompareOnChange(this)\">\n<option value=\"\">Compare more</option>\n";
		var spCompHead3 = "<select id=\"comparePhone3\" name=\"comparePhone3\" style=\"width:150px\" OnChange=\"javascript:funCompareOnChange(this)\">\n<option value=\"\">Compare more</option>\n";
		var spCompTail = "</select>\n";
		document.getElementById("spComparePhone1").innerHTML = spCompHead1+phoneComboHtml+spCompTail;
		document.getElementById("spComparePhone2").innerHTML = spCompHead2+phoneComboHtml+spCompTail;
		document.getElementById("spComparePhone3").innerHTML = spCompHead3+phoneComboHtml+spCompTail;
		if(getCookie("phoneCompare") != null && getCookie("phoneCompare") != ""){						
			var rowCookie = getCookie("phoneCompare").split("^");			
			var colCookie;
			var comparePhoneText = rowCookie.length;
			document.getElementById("compareSize").innerHTML = comparePhoneText;
			for(var i = 0 ; i < rowCookie.length; i++){
				colCookie = rowCookie[i].split('|');
				document.getElementById("comparePhone"+(i+1)).value = colCookie[0];
			}
		}else{
			document.getElementById("compareSize").innerHTML = "0";
		}
		document.getElementById("nowPage").innerHTML = "Compare";
		funSpecListSearch();
	}
	function funCompareOnChange(selectObj){	
		var selecObjId = selectObj.id;
		var j = 0;
		for(var i = 1; i< 4; i++){
			if(document.getElementById("comparePhone"+i).options[document.getElementById("comparePhone"+i).selectedIndex].value != ""){	
				j++;
			}
		}
		document.getElementById("compareSize").innerHTML = j;
		funSpecListSearch(selecObjId);
	}
	function funSpecListSearch(selecObjId){	
		var resetNum;
		if(selecObjId == "comparePhone1"){
			resetNum = 1;
		}else if(selecObjId == "comparePhone2"){
			resetNum = 2;
		}else if(selecObjId == "comparePhone3"){
			resetNum = 3;
		}
		var spCompTail = "</select>\n";
		var compTemp = "";
		for(var i = 1 ; i < 3; i++){
			compTemp = document.getElementById("comparePhone"+i).value
			if(compTemp == ""){
				continue;
			}
			for(var j = i+1; j<4; j++){
				if(compTemp == "" && document.getElementById("comparePhone"+j).value == ""){
					break;
				}
				if(compTemp == document.getElementById("comparePhone"+j).value){				
					document.getElementById("spComparePhone"+resetNum).innerHTML = "<select id=\"comparePhone"+resetNum+"\" name=\"comparePhone"+resetNum+"\" style=\"width:150px\" OnChange=\"javascript:funCompareOnChange(this)\">\n<option value=\"\">Compare more</option>\n"+phoneComboHtml+spCompTail;								
					document.getElementById("compPhoneImg"+resetNum).innerHTML = "<img src=\""+IMG_URL_ROOT+"products/images_blank.gif\" width=\"120\" height=\"120\" alt=\"\" />";
					document.getElementById("compPhoneModel"+resetNum).innerHTML = "";
					document.getElementById("compPhoneFeature"+resetNum).innerHTML = "";	
					document.getElementById("compPhoneQuickSpec"+resetNum).innerHTML = "";	
					new Selectbox('comparePhone'+resetNum);
					var strComp = "";
					switch(resetNum){
						case (1) :
							strComp = "A";
							break;				
						case (2) :
							strComp = "B";
							break;				
						case (3) :
							strComp = "C";
							break;								
					}
					for(var k = 0;; k++){					
						if(document.getElementById("compareCon"+strComp+k) == null){
							break;
						}
						document.getElementById("compareCon"+strComp+k).innerHTML = "";
					}
					var cookieVal="";
					for(var l = 1; l < 4; l++){
						if(cookieVal == ""){
							cookieVal += document.getElementById("comparePhone"+l).value;
						}else{
							cookieVal += "|"+document.getElementById("comparePhone"+l).value;
						}
					}
					delPhoneModelCookie(cookieVal);
					alert(P01);
					return;
				}
			}
		}
		var phoneModel1 = document.getElementById("comparePhone1").value;
		var phoneModel2 = document.getElementById("comparePhone2").value;
		var phoneModel3 = document.getElementById("comparePhone3").value;
		document.getElementById("expandViewWrap").innerHTML = "載入中...";
		//document.getElementById("expandViewTab").innerHTML = "";
		ProductsDwrAction.selectGSfcSpecList({
					phoneModel1:phoneModel1
				   ,phoneModel2:phoneModel2
				   ,phoneModel3:phoneModel3
				},
				function funSpecSearch(data){
					var phone1 = data["phone1"];				
					var phone2 = data["phone2"];
					var phone3 = data["phone3"];
					var phoneSpec1 = data["phoneSpec1"];
					var phoneSpec2 = data["phoneSpec2"];
					var phoneSpec3 = data["phoneSpec3"];
					var copNum;
					if( phoneSpec1 != "" ){
						compNum = 1;
						
						var phoneUrl = phoneSpec1[0].miniName.toLowerCase();
						phoneUrl = phoneUrl.replace(/\s/g, "-").replace(/samsung|sgh-|sch-|gt-/g, "");
						phoneUrl = "samsung-" + phoneUrl;					
						
						if(phoneSpec1[0].smallImage == ""){
							if(phoneSpec1[0].stateInfo == "0900001"){
								document.getElementById("compPhoneImg"+compNum).innerHTML = "<img src=\""+IMG_URL_ROOT+"products/images_blank.gif\" width=\"120\" height=\"120\" alt=\"\" />";
							}else{
								document.getElementById("compPhoneImg"+compNum).innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/" + phoneUrl + "\"><img src=\""+IMG_URL_ROOT+"products/images_blank.gif\" width=\"120\" height=\"120\" alt=\"\" /></a>";
							}
						}else{
							if(phoneSpec1[0].stateInfo == "0900001"){
								if(phoneSpec1[0].smallImage.substring(0, 4) != 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<img src=\""+phoneSpec1[0].smallImage+"\" width=\"120\" height=\"120\" alt=\"\" />";
								}
								if(phoneSpec1[0].smallImage.substring(0, 4) == 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<img src=\""+phoneSpec1[0].smallImage+"\" width=\"120\" height=\"120\" alt=\"\" />";
								}						
							}else{
								if(phoneSpec1[0].smallImage.substring(0, 4) != 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/" + phoneUrl + "\" title=\""+phoneSpec1[0].phoneName+"\"><img src=\""+phoneSpec1[0].smallImage+"\" width=\"120\" height=\"120\" alt=\""+phoneSpec1[0].phoneName+"\" /></a>";
								}
								if(phoneSpec1[0].smallImage.substring(0, 4) == 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/" + phoneUrl + "\" title=\""+phoneSpec1[0].phoneName+"\"><img src=\""+phoneSpec1[0].smallImage+"\" width=\"120\" height=\"120\" alt=\""+phoneSpec1[0].phoneName+"\" /></a>";
								}							
							}						
						}
						document.getElementById("compPhoneModel"+compNum).innerHTML = phoneSpec1[0].miniName;
						var featureHtml = "";
						if(phoneSpec1[0].features1 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec1[0].features1,22)+"</li>\n";
						}
						if(phoneSpec1[0].features2 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec1[0].features2,22)+"</li>\n";
						}
						if(phoneSpec1[0].features3 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec1[0].features3,22)+"</li>\n";
						}
						if(phoneSpec1[0].features4 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec1[0].features4,22)+"</li>\n";
						}
						if(phoneSpec1[0].features5 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec1[0].features5,22)+"</li>\n";
						}
						if(phoneSpec1[0].features6 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec1[0].features6,22)+"</li>\n";
						}
						document.getElementById("compPhoneFeature"+compNum).innerHTML = featureHtml;
						var quickSpecHtml = "";
						for(var j=1 ;  j<11 ; j++){
							if(eval("phoneSpec1[0].quickSpecImage"+j) != " "){
							quickSpecHtml += "				<li>\n";
							quickSpecHtml += "					<div class=\"spec_icon\"><a onMouseOver=\"spec_balloon("+j+",'comp"+compNum+"_"+phoneSpec1[0].phoneModel+"')\" onMouseOut=\"selectHide('comp"+compNum+"_"+phoneSpec1[0].phoneModel+"_"+j+"')\">\n";
								if((eval("phoneSpec1[0].quickSpecImage"+j)).substring(0,4) == 'http') {
									quickSpecHtml += "						<img src=\""+eval("phoneSpec1[0].quickSpecImage"+j)+"\" alt=\"\"></a>\n";
								} else { 
									quickSpecHtml += "						<img src=\""+PUB_LOCAL+""+QUICKSPEC_SAVE_PATH+""+eval("phoneSpec1[0].quickSpecImage"+j)+"\" alt=\"\"></a>\n";
								}	
							quickSpecHtml += "					</div>\n";
							quickSpecHtml += "					<div class=\"spec_balloon_h"+j+" spec_balloon\" id=\"comp"+compNum+"_"+phoneSpec1[0].phoneModel+"_"+j+"\">\n";
							quickSpecHtml += "						<div class=\"spec_balloon_con\">"+eval("phoneSpec1[0].quickSpecDesc"+j)+"</div>\n";						
							quickSpecHtml += "					</div>\n";
							quickSpecHtml += "				</li>\n";
							}
						}	
						document.getElementById("compPhoneQuickSpec"+compNum).innerHTML = quickSpecHtml;
					}else{
						document.getElementById("compPhoneImg1").innerHTML = "<img src=\""+IMG_URL_ROOT+"products/images_blank.gif\" width=\"120\" height=\"120\" alt=\"\" />";
						document.getElementById("compPhoneModel1").innerHTML = "";
						document.getElementById("compPhoneFeature1").innerHTML = "";
						document.getElementById("compPhoneQuickSpec1").innerHTML = "";
					}
					if( phoneSpec2 != "" ){
						compNum = 2;
	
						var phoneUrl = phoneSpec2[0].miniName.toLowerCase();
						phoneUrl = phoneUrl.replace(/\s/g, "-").replace(/samsung|sgh-|sch-|gt-/g, "");
						phoneUrl = "samsung-" + phoneUrl;					
						
						if(phoneSpec2[0].smallImage == ""){	
							if(phoneSpec2[0].stateInfo == "0900001"){	
								document.getElementById("compPhoneImg"+compNum).innerHTML = "<img src=\""+IMG_URL_ROOT+"products/images_blank.gif\" width=\"120\" height=\"120\" alt=\"\" />";
							}else{
								document.getElementById("compPhoneImg"+compNum).innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/" + phoneUrl + "\"><img src=\""+IMG_URL_ROOT+"products/images_blank.gif\" width=\"120\" height=\"120\" alt=\"\" /></a>";
							}
						}else{
							if(phoneSpec2[0].stateInfo == "0900001"){	
								if(phoneSpec2[0].smallImage.substring(0, 4) != 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<img src=\""+phoneSpec2[0].smallImage+"\" width=\"120\" height=\"120\" alt=\"\" />";
								}
								if(phoneSpec2[0].smallImage.substring(0, 4) == 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<img src=\""+phoneSpec2[0].smallImage+"\" width=\"120\" height=\"120\" alt=\"\" />";
								}						
							}else{
								if(phoneSpec2[0].smallImage.substring(0, 4) != 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/" + phoneUrl + "\" title=\""+phoneSpec2[0].phoneName+"\"><img src=\""+phoneSpec2[0].smallImage+"\" width=\"120\" height=\"120\" alt=\""+phoneSpec2[0].phoneName+"\" /></a>";
								}
								if(phoneSpec2[0].smallImage.substring(0, 4) == 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/" + phoneUrl + "\" title=\""+phoneSpec2[0].phoneName+"\"><img src=\""+phoneSpec2[0].smallImage+"\" width=\"120\" height=\"120\" alt=\""+phoneSpec2[0].phoneName+"\" /></a>";
								}							
							}						
						}
						document.getElementById("compPhoneModel"+compNum).innerHTML = phoneSpec2[0].miniName;
						var featureHtml = "";
						if(phoneSpec2[0].features1 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec2[0].features1,22)+"</li>\n";
						}
						if(phoneSpec2[0].features2 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec2[0].features2,22)+"</li>\n";
						}
						if(phoneSpec2[0].features3 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec2[0].features3,22)+"</li>\n";
						}
						if(phoneSpec2[0].features4 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec2[0].features4,22)+"</li>\n";
						}
						if(phoneSpec2[0].features5 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec2[0].features5,22)+"</li>\n";
						}
						if(phoneSpec2[0].features6 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec2[0].features6,22)+"</li>\n";
						}
						document.getElementById("compPhoneFeature"+compNum).innerHTML = featureHtml;
						var quickSpecHtml = "";
						for(var j=1 ;  j<11 ; j++){
							if(eval("phoneSpec2[0].quickSpecImage"+j) != " "){
							quickSpecHtml += "				<li>\n";
							quickSpecHtml += "					<div class=\"spec_icon\"><a onMouseOver=\"spec_balloon("+j+",'comp"+compNum+"_"+phoneSpec2[0].phoneModel+"')\" onMouseOut=\"selectHide('comp"+compNum+"_"+phoneSpec2[0].phoneModel+"_"+j+"')\">\n";
								if((eval("phoneSpec2[0].quickSpecImage"+j)).substring(0,4) == 'http') {
									quickSpecHtml += "						<img src=\""+eval("phoneSpec2[0].quickSpecImage"+j)+"\" alt=\"\"></a>\n";
								} else { 
									quickSpecHtml += "						<img src=\""+PUB_LOCAL+""+QUICKSPEC_SAVE_PATH+""+eval("phoneSpec2[0].quickSpecImage"+j)+"\" alt=\"\"></a>\n";
								}	
							quickSpecHtml += "					</div>\n";
							quickSpecHtml += "					<div class=\"spec_balloon_h"+j+" spec_balloon\" id=\"comp"+compNum+"_"+phoneSpec2[0].phoneModel+"_"+j+"\">\n";
							quickSpecHtml += "						<div class=\"spec_balloon_con\">"+eval("phoneSpec2[0].quickSpecDesc"+j)+"</div>\n";						
							quickSpecHtml += "					</div>\n";
							quickSpecHtml += "				</li>\n";
							}
						}
						document.getElementById("compPhoneQuickSpec"+compNum).innerHTML = quickSpecHtml;
					}else{
						document.getElementById("compPhoneImg2").innerHTML = "<img src=\""+IMG_URL_ROOT+"products/images_blank.gif\" width=\"120\" height=\"120\" alt=\"\" />";
						document.getElementById("compPhoneModel2").innerHTML = "";
						document.getElementById("compPhoneFeature2").innerHTML = "";
						document.getElementById("compPhoneQuickSpec2").innerHTML = "";
					}
					if( phoneSpec3 != "" ){
						compNum = 3;
						
						var phoneUrl = phoneSpec3[0].miniName.toLowerCase();
						phoneUrl = phoneUrl.replace(/\s/g, "-").replace(/samsung|sgh-|sch-|gt-/g, "");
						phoneUrl = "samsung-" + phoneUrl;										
						
						if(phoneSpec3[0].smallImage == ""){	
							if(phoneSpec3[0].stateInfo == "0900001"){
								document.getElementById("compPhoneImg"+compNum).innerHTML = "<img src=\""+IMG_URL_ROOT+"products/images_blank.gif\" width=\"120\" height=\"120\" alt=\"\" />";
							}else{
								document.getElementById("compPhoneImg"+compNum).innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/" + phoneUrl + "\"><img src=\""+IMG_URL_ROOT+"products/images_blank.gif\" width=\"120\" height=\"120\" alt=\"\" /></a>";
							}
						}else{
							if(phoneSpec3[0].stateInfo == "0900001"){
								if(phoneSpec3[0].smallImage.substring(0, 4) != 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<img src=\""+phoneSpec3[0].smallImage+"\" width=\"120\" height=\"120\" alt=\"\" />";
								}
								if(phoneSpec3[0].smallImage.substring(0, 4) == 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<img src=\""+phoneSpec3[0].smallImage+"\" width=\"120\" height=\"120\" alt=\"\" />";
								}						
							}else{
								if(phoneSpec3[0].smallImage.substring(0, 4) != 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/" + phoneUrl + "\" title=\""+phoneSpec3[0].phoneName+"\"><img src=\""+phoneSpec3[0].smallImage+"\" width=\"120\" height=\"120\" alt=\""+phoneSpec3[0].phoneName+"\" /></a>";
								}
								if(phoneSpec3[0].smallImage.substring(0, 4) == 'http'){
									document.getElementById("compPhoneImg"+compNum).innerHTML = "<a href=\""+URL_ROOT+"mobile-phones/" + phoneUrl + "\" title=\""+phoneSpec3[0].phoneName+"\"><img src=\""+phoneSpec3[0].smallImage+"\" width=\"120\" height=\"120\" alt=\""+phoneSpec3[0].phoneName+"\" /></a>";
								}							
							}						
						}
						document.getElementById("compPhoneModel"+compNum).innerHTML = phoneSpec3[0].miniName;
						var featureHtml = "";
						if(phoneSpec3[0].features1 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec3[0].features1,22)+"</li>\n";
						}
						if(phoneSpec3[0].features2 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec3[0].features2,22)+"</li>\n";
						}
						if(phoneSpec3[0].features3 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec3[0].features3,22)+"</li>\n";
						}
						if(phoneSpec3[0].features4 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec3[0].features4,22)+"</li>\n";
						}
						if(phoneSpec3[0].features5 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec3[0].features5,22)+"</li>\n";
						}
						if(phoneSpec3[0].features6 != " "){
							featureHtml += "<li>- "+FFStrCutByteString(phoneSpec3[0].features6,22)+"</li>\n";
						}
						document.getElementById("compPhoneFeature"+compNum).innerHTML = featureHtml;
						var quickSpecHtml = "";
						for(var j=1 ;  j<11 ; j++){
							if(eval("phoneSpec3[0].quickSpecImage"+j) != " "){
							quickSpecHtml += "				<li>\n";
							quickSpecHtml += "					<div class=\"spec_icon\"><a onMouseOver=\"spec_balloon("+j+",'comp"+compNum+"_"+phoneSpec3[0].phoneModel+"')\" onMouseOut=\"selectHide('comp"+compNum+"_"+phoneSpec3[0].phoneModel+"_"+j+"')\">\n";
								if((eval("phoneSpec3[0].quickSpecImage"+j)).substring(0,4) == 'http') {
									quickSpecHtml += "						<img src=\""+eval("phoneSpec3[0].quickSpecImage"+j)+"\" alt=\"\"></a>\n";
								} else {
									quickSpecHtml += "						<img src=\""+PUB_LOCAL+""+QUICKSPEC_SAVE_PATH+""+eval("phoneSpec3[0].quickSpecImage"+j)+"\" alt=\"\"></a>\n";
								}	
							quickSpecHtml += "					</div>\n";
							quickSpecHtml += "					<div class=\"spec_balloon_h"+j+" spec_balloon\" id=\"comp"+compNum+"_"+phoneSpec3[0].phoneModel+"_"+j+"\">\n";
							quickSpecHtml += "						<div class=\"spec_balloon_con\">"+eval("phoneSpec3[0].quickSpecDesc"+j)+"</div>\n";						
							quickSpecHtml += "					</div>\n";
							quickSpecHtml += "				</li>\n";
							}
						}
						document.getElementById("compPhoneQuickSpec"+compNum).innerHTML = quickSpecHtml;
					}else{
						document.getElementById("compPhoneImg3").innerHTML = "<img src=\""+IMG_URL_ROOT+"products/images_blank.gif\" width=\"120\" height=\"120\" alt=\"\" />";
						document.getElementById("compPhoneModel3").innerHTML = "";
						document.getElementById("compPhoneFeature3").innerHTML = "";
						document.getElementById("compPhoneQuickSpec3").innerHTML = "";
					}
					// start -----------------------2008.05.02--------------------------- 
					var inhtml = "";
					var inhtml2 = "";
					var j = 0;
					var k = 0;
					var t = 0;
					var totalCnt = phone1.length;
					var isSpecDisplay
					for(var i = 0; i < phone1.length ; i++){
						//mits=15,Car Solution - Classification=16, Car Solution - Brand=17
						if(phone1[i].specSeqNo!="15"&&phone1[i].specSeqNo!="16"&&phone1[i].specSeqNo!="17"){
							if(phone1[i].specLevel == 1){
								isSpecDisplay = false;
								j++;					
								inhtml += "<dt>\n";
								inhtml += "	<span class=\"leftA\"><a href=javascript:expandView('expandView_"+j+"','btnView_"+j+"'); title=\""+phone1[i].specName+"\"><img src=\""+PUB_MASTER+""+PHONESPEC_SAVE_PATH+""+phone1[i].imagePath+"\" alt=\""+phone1[i].specName+"\" class=\"ico\" width=\"28\" height=\"28\">"+phone1[i].specName+"</a></span>\n";
								inhtml += "	<img src=\""+IMG_URL_ROOT+"common/btn_conOpen.gif\" alt=\"\" id=\"btnView_"+j+"\" class=\"rightA hand\" onClick=\"expandView('expandView_"+j+"',this.getAttribute('id'));\">\n";
								inhtml += "</dt>\n";
								inhtml += "<dd id=\"expandView_"+j+"\">\n";
							}
							if(phone1[i].specLevel == 2){	
								if(phone1[i].specCaption!="" || phone2[i].specCaption!="" || phone3[i].specCaption){
									if(phone1[i].specYn=="true"){
										isSpecDisplay = true;
										inhtml += "	<ul class=\"dotList\">\n";
										inhtml += "		<li>\n";
										inhtml += "		<p class=\"compareTit\">"+phone1[i].specName+"</p>\n";
										inhtml += "		<p id=\"compareConA"+k+"\" class=\"compareConA\">"+phone1[i].specCaption+"</p>\n";
										inhtml += "		<p id=\"compareConB"+k+"\" class=\"compareConB\">"+phone2[i].specCaption+"</p>\n";							
										inhtml += "		<p id=\"compareConC"+k+"\" class=\"compareConC\">"+phone3[i].specCaption+"</p>\n";
										inhtml += "		</li>\n";
										inhtml += "	</ul>\n";	
									}
								}
							}
							if(i+1 < totalCnt && phone1[i+1].specLevel==1){
								inhtml += "</dd>\n";
								if(isSpecDisplay){
									inhtml2 = inhtml2 + inhtml;
								}
								inhtml = "";
							}							
						}
					}
					// end -----------------------2008.05.02---------------------------
					document.getElementById("expandViewWrap").innerHTML = inhtml2;
					//document.getElementById("expandViewTab").innerHTML = "<img src=\""+IMG_URL_ROOT+"common/btn_allExpand.gif\" alt=\"All Expand\" id=\"btn_Expand\" class=\"hand\" onClick=\"expandAll(this.getAttribute('alt'))\">";
					for(var i = 1 ; i < 4; i++){
						document.getElementById("comparePhone"+i).disabled = false;
					}
					var chkLen = document.getElementsByName("chkQuick").length;				
					for(var i = 0; i < chkLen ; i++){
						document.getElementsByName("chkQuick")[i].disabled = false;
					}
					delAllCompare();
					if( phoneSpec1 != "" ){
						setCookie(phoneSpec1[0].phoneModel,phoneSpec1[0].miniName,phoneSpec1[0].xsmallImage2);
					}
					if( phoneSpec2 != "" ){
						setCookie(phoneSpec2[0].phoneModel,phoneSpec2[0].miniName,phoneSpec2[0].xsmallImage2);
					}
					if( phoneSpec3 != "" ){
						setCookie(phoneSpec3[0].phoneModel,phoneSpec3[0].miniName,phoneSpec3[0].xsmallImage2);
					}
					expandAll(document.getElementById("expandGbn").value);
					selectHide('laypop_compare');				
				}
		);
	}
	
	//phone search combo
	function selectSeries() {
		var siteCd = LANG;
		var langCd = LANG_CD;
		var seriesSeqNo = document.getElementById("seriesSeqNo");
		var selectSeriesSeqNo = seriesSeqNo.value;
		var seriesPhoneModel = document.getElementById("seriesPhoneModel");
		var gSfcPrdSeries;
		gSfcPrdSeries = {siteCd:siteCd, langCd:langCd, seriesSeqNo:selectSeriesSeqNo};
		SeriesPrdActionDWR.selectGSfcPrdSeriesListDWR(
				gSfcPrdSeries,
				function selectPhoneModelSelect(data){    
			        var phoneModelSelect = "<select id=\"seriesPhoneModel\" name=\"seriesPhoneModel\" style=\"width:163px\" onchange=\"javascript:selectSeriesPhoneModel();\">";
				        phoneModelSelect += "<option value=\"\">手機型號</option>";
					for(var i=0; i < data.length; i++) {					
				        phoneModelSelect += "<option value=\""+data[i].phoneName+"\">"+data[i].miniName+"</option>";
					}
						phoneModelSelect += "</select>";
					document.getElementById("selectPhoneModel").innerHTML = phoneModelSelect;
					new Selectbox('seriesPhoneModel');
				}			 
			);
	}
	function selectHide2(Name){
		self.clearTimeout(setTime);
		selectObj = document.getElementById(Name);
		selectObj.style.display='none';
	}
		function selectHide2(Name){
		self.clearTimeout(setTime);
		
		selectObj = document.getElementById(Name);
		selectObj.style.display='none';
	}
	//phone search combo
		function funPhoneComboHtml(){
		var xmlhttp; 
		xmlhttp=null;
	
		strURL = "/ajax/ajaxcombolist.do";
	if (window.XMLHttpRequest)
	  {// code for IE7, Firefox, Opera, etc.
	  xmlhttp=new XMLHttpRequest();
	  }
	else if (window.ActiveXObject)
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	if (xmlhttp!=null)
	  {
	  xmlhttp.open("GET",strURL,false);
	  xmlhttp.send(null);
	  phoneComboHtml = xmlhttp.responseText;
	  }
	else
	  {
	  alert("Your browser does not support XMLHTTP.");
	  }
	}