﻿function toHex(c) {
  var r, g, b;
  r = c[0].toString(16);
  if (c[0] < 0x10) {
    r = "0" + r;
  }
  g = c[1].toString(16);
  if (c[1] < 0x10) {
    g = "0" + g;
  }
  b = c[2].toString(16);
  if (c[2] < 0x10) {
    b = "0" + b;
  }
  return (r + g + b).toUpperCase();
}

/* write swatch */
function ws(c, s, z) {
  var v = toHex(c);
  document.write(
    "<td  style='font-size:1px;' onclick=\"sf_oc(gf(),'" + v +
    "')\" title=\"" + v + "\" " + ((s == 1) ? "" : ("colspan=\"" + s +
    "\" ")) + "bgcolor=\"" + v + "\" onmouseover=\"status='" + v +
    "'\" " + "onmouseout=\"status=''\"><div class=\"" + z + "\"></div></td>");
}

/* set field helper for onchange events */
function sf_oc(f, v) {
  change(f,v);
}

/* write palette table */
function wt() {
  for(var r = 255; r >= 0; r -= 51) {
    document.write("<tr>");
    for(var g = 255; g >= 0; g -= 51) {
      for(var b = 255; b >= 0; b -= 51) {
        ws([r, g, b], 1, "swatch");
      }
    }
    document.write("</tr>");
  }
  document.write("<tr>");
  for(var l = 255; l >= 0; l -= 51) {
    ws([l, l, l], 6, "swatch2");
  }
  document.write("</tr>");
}


/* set field valid value */
var sf_vv = /[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]/i;

/* get field value */
function gf() {
  var e = document.forms.fieldForm.elements.field;
  if(e != undefined) {
    for (var i = 0; i < e.length; i++) {
      if (e[i].checked) {
        return e[i].value;
		//alert(e[i].value);
      }
    }
  }
  
  /* we need this so this function becomes reusable
   * with ChooseColor.gxp
   */
  var r = document.forms.fieldForm.elements;
  for (var i = 0; i < r.length; i++) {
     return r[i].id;
  }
}
//var imgtag = true;
function change(f,v){
   var wb,bw,bh,fs,bk,bkstyle,showcode,myurl,urlstr,cbd,cbdvalue,cbg,cbgvalue;
   var searchdisplay,displayvalue,fc,fontColorValue;
   var al,alinkValue,ah,ahoverValue,av,visitedValue;
   var changeURL,bkvalue;
   var imgline,bkimg,wbb;
   var strEncoding,getcolor;
   var bkwh;
   var totalSrc = "?" ;
   var shuru;
   wb = document.getElementById("wb");  
   bw = document.getElementById("bw"); 
   bh = document.getElementById("bh");
   fs = document.getElementById("fs");
   bk = document.getElementById("bk");
   bkstyle = document.getElementById("bkstyle");
   bkwidth = document.getElementById("bkwidth");
   showcode = document.getElementById("showcode");
   myurl = document.getElementById("myurl");
   cbd = document.getElementById("cbd");
   cbg = document.getElementById("cbg") ;
   searchdisplay = document.getElementById("searchdisplay");
   fc = document.getElementById("fc");
   al = document.getElementById("al");
   ah = document.getElementById("ah");
   av = document.getElementById("av");
   imgline = document.getElementById("imgline");
     bkimg = document.getElementById("bkimg");
     wbb = document.getElementById("wbb");
     getcolor = document.getElementById("getcolor");
     bkwh = document.getElementById("bkwh");
	 search1 = document.getElementById("search");
	 //shishi = document.getElementById("shishi");
     var imgbk,bkimgleft,bkimgright,bkimgup,bkimgdown;
     var imgURL;
     var imgleft,imgright,imgup,imgdown;
     var imgleftheight,imgrightheight,imgupheight,imgdownheight;
     var bkimgbg,imgbg,imgheight,imagupwidth,imageheight;
     var iframewidth;
     var king110;
     imgURL = "http://w.159.com/Shell/img/";
     imgbk = document.getElementById("imgbk");
     
     
      
      
     
     
     
     bkimgleft = document.getElementById("bkimgleft");
     bkimgright = document.getElementById("bkimgright");
     
     bkimgbg = document.getElementById("bkimgbg");
     king110= document.getElementById("king110");
     bkimgup = document.getElementById("bkimgup");
     bkimgdown = document.getElementById("bkimgdown");
     var gaoji = document.getElementById("gaoji");
    //alert(cbg.value);
  //width pare value
  
  
  if(king110.value=="")
	   { 
         wbb.src = "http://w.159.com/WapBro/Client/WAPBrowser.aspx?url=" + urlstr;
      }
      else
      {
        wbb.src = "http://w.159.com/WapBro/Client/WAPBrow.aspx?url=" + urlstr ;
      }
  
  
  
  
  if(bw.value != "" && !isNaN(bw.value)){
    if (bw.value >= 50 && bw.value<=360){
      wb.style.width = bw.value;
	}else{
	  bw.value = "185";
      wb.style.width = bw.value;
	  alert("宽度值应该介于50px与360px之间!");  
      //return false;
	}
   
  }else{
   bw.value = "185";
   wb.style.width = bw.value;
   alert("宽度值不能为空,且必需为数值!");
   //return false;
  }
  
  // height pare value
   if(bh.value != "" && !isNaN(bh.value)){
    imageheight = bh.value;
    if (imageheight >= 50 && imageheight <=360){     
      wb.style.height = imageheight;
      wbb.height = imageheight;
      
      //初始化的时候，将“roboo蓝色简洁版”的高度改为280px;其它都200px
       /*
        if(imgtag){
           imageheight = "280";
           wb.style.height = imageheight;
           wbb.height = imageheight;
           imgtag = false;
           }
           */
      
	}else{  
	  bh.value = "250";
	  imageheight = bh.value;
      wb.style.height = imageheight;
      wbb.height = imageheight;
      alert("高度值应该介于50px与360px之间!");
      //return false;
	}
   
  }else{ 
   bh.value = "250";
   imageheight = bh.value;
   wb.style.height = imageheight;
   wbb.height = imageheight;
   alert("高度值不能为空,且必需为数值!");
   //return false;
  }
 
  if(bk.value != ""){
   wb.style.borderStyle = bk.value ;
   bkvalue = bk.value;
  }
  
  if(imgline.value == "line"){
    bkstyle.style.display = "block"; 
    bkimg.style.display = "none";
    wb.style.display = "block";
    getcolor.style.display = "block";
    imgstyle.style.display = "none";
    bkwh.style.display = "block";
  }else if(imgline.value == "img"){
    bkstyle.style.display = "none";
    wb.style.borderStyle = "none";
    wb.style.display = "none";
    bkvalue = "none";
    bkimg.style.display = "block";  
    if(!gaoji.checked){
    getcolor.style.display = "none";
   
    }
    imgstyle.style.display = "block";
   // bkwh.style.display = "none";
  }else if(imgline.value = "no"){
    bkstyle.style.display = "none";
    wb.style.borderStyle = "none";
    bkvalue = "none";
    bkimg.style.display = "none";
    wb.style.display = "block";
    
    if(!gaoji.checked){
    getcolor.style.display = "none";
    }
    imgstyle.style.display = "none";
    bkwh.style.display = "block";
  }
  
  if(bkwidth.value !="" && !isNaN(bkwidth.value)){
   wb.style.borderWidth = bkwidth.value;
  }
  
  
  /*
  if (!sf_vv.test(v)) {
    return;
  }
*/
  //alert(f);
  // This is bordercolor value;
  if(f == "cbd"){
    wb.style.borderColor = '#' + v;
    document.getElementById(f).style.background = '#' + v;
    document.getElementById(f).value = v;
  }
  // This is background Color value;
  if(f == "cbg"){
    wb.style.background = '#' + v;
    document.getElementById(f).style.background = '#' + v;
    document.getElementById(f).value = v;
  }
  // This border color value;
  if (cbd.value == undefined){
    cbdvalue = "CCCCCC";
   }else{
    cbdvalue = cbd.value;
   }
   // This wap url value;

   if(myurl.value != "" && myurl.value != "wap.159.com"){
   
 
   
      urlstr ="http://"+ myurl.value;
       totalSrc +="url="+urlstr+"&"; 

   //alert(urlstr);  
  }else{
    
      urlstr = "http://wap.159.com";
 
  }
  //This backgroud color value;
   if(cbg.value == undefined){
    cbgvalue = "FFFFFF";
   }else{
    cbgvalue = cbg.value;
    totalSrc += "bc="+cbgvalue+"&";
   }
  
  //This is font color value
   if(f == "fc"){
    document.getElementById(f).style.background = '#' + v;
    document.getElementById(f).value = v;
  } 
   //This is font color value
   if(fc.value == undefined){
    fontColorValue = "000000";
   }else{
    fontColorValue = fc.value;
    totalSrc += "fc="+fontColorValue+"&";
   }
  
  // link color value pare ,a:link
  if(f == "al"){
    document.getElementById(f).style.background = '#' + v;
    document.getElementById(f).value = v;
  }
  
   if(al.value == undefined){
    alinkValue = "0000FF";
   }else{
    alinkValue = al.value;
    totalSrc += "al="+alinkValue+"&";
   }
  
   // link color value pare ,a:hover
  if(f == "ah"){
    document.getElementById(f).style.background = '#' + v;
    document.getElementById(f).value = v;
  }
  
   if(ah.value == undefined){
    ahoverValue = "0000FF";
   }else{
    ahoverValue = ah.value;
    totalSrc += "ah="+ahoverValue+"&";
   }
   
    // link color value pare ,a:av
  
  if(f == "av"){
    document.getElementById(f).style.background = '#' + v;
    document.getElementById(f).value = v;
  }
  
   if(av.value == undefined){
    visitedValue = "CC3366";
   }else{
    visitedValue = av.value;
    totalSrc += "av="+visitedValue+"&";
   }
  
  //url address value
   if(searchdisplay.value != "block"){
    displayvalue = searchdisplay.value;
	search1.style.display = "none"; 
	
	shuru="";

    //totalSrc += "sv="+displayvalue+"&";
    //changeURL = "wbpdth.jsp";
   }else{
    displayvalue = "block";
	//search1.style.display = "block";  

	//shuru="<DIV id=\"search\" style=\"position:relative;text-align:center;\" >";
	//shuru+="<INPUT type=\"image\" name=\"back\" src=\""+imgURL+"/back.gif\" width=\"16\" height=\"18\" tabindex=\"2\" alt=\"后退\" onClick=\"javascript:{window.history.go(-1);return false}\">";
	//shuru+="&nbsp;<INPUT type=\"text\" name=\"url\" value=\"wap.159.com \" alt=\"在此输入WAP网站地址\" size=\"12\" tabindex=\"0\" onKeyDown=\"javascript:{if(event.keyCode==13){ document.ooform.submit();return false;}}\">";
	//shuru+="&nbsp;<INPUT accesskey=\"enter\" alt=\"转到\" tabindex=\"1\" type=\"image\" width=\"18\"  onclick\=\"histo1()\" height=\"18\" src=\""+imgURL+"/search_go.gif\">";
	//shuru+="</DIV>";
	shuru="<script type=\"text/JavaScript\">";
	shuru+="function histo1()";
	shuru+="{";
	

	 if(king110.value=="")
	 {             
	   	shuru+=" document.getElementById(\"wbb\").src=\"http://w.159.com/WapBro/Client/WAPBrowser.aspx?url=http://\"+document.getElementById(\"url\").value; ";
	 }
	 else
	 {
	   	shuru+=" document.getElementById(\"wbb\").src=\"http://w.159.com/WapBro/Client/WAPBrow.aspx?url=http://\"+document.getElementById(\"url\").value; ";

	 }
	shuru+="}";
	shuru+="</script>";

    //changeURL = "wbpdth.jsp";
   }
  
  
  //font size value;
  if(fs.value != "12" && !isNaN(fs.value)){
     wb.style.fontSize = fs.value;
     totalSrc += "fs="+fs.value+"&";
  }
  
 //if(shishi.checked){
//   totalSrc += " ";
//	//totalSrc += "rf=y&";
//  }
  
  
  if(imgbk.value == "phone1"){
     
     imagupwidth="263";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "210";
     wbb.width = iframewidth;
     
     imgup = imgURL + "phone_mb_up1.gif";
     bkimgup.src = imgup;
     imgupheight = "37";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg1.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down1.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "36";
     bkimgdown.height = imgdownheight;
     
  }else if(imgbk.value == "phone2"){
  
     imagupwidth="144";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "100";
     wbb.width = iframewidth;
     
     imgup = imgURL + "phone_mb_up2.gif";
     bkimgup.src = imgup;
     imgupheight = "36";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg2.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
     
     imgdown = imgURL + "phone_mb_down2.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "101";
     bkimgdown.height = imgdownheight;
     
     
    
  }else if(imgbk.value == "phone3"){
  
     imagupwidth="263";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "200";
     wbb.width = iframewidth;
     
     imgup = imgURL + "phone_mb_up3.gif";
     bkimgup.src = imgup;
     imgupheight = "36";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg3.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
     
     imgdown = imgURL + "phone_mb_down3.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "33";
     bkimgdown.height = imgdownheight;

  }else if(imgbk.value == "phone4"){
  
     imagupwidth="213";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "185";
     wbb.width = iframewidth;
     
     imgup = imgURL + "phone_mb_up4.gif";
     bkimgup.src = imgup;
     imgupheight = "34";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg4.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down4.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "126";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone5"){
  
     imagupwidth="263";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "215";
     wbb.width = iframewidth;
  
     imgup = imgURL + "phone_mb_up5.gif";
     bkimgup.src = imgup;
     imgupheight = "33";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg5.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down5.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "33";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone6"){
  
     imagupwidth="202";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "175";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up6.gif";
     bkimgup.src = imgup;
     imgupheight = "32";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg6.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down6.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "15";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone7"){
  
     imagupwidth="280";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "215";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up7.gif";
     bkimgup.src = imgup;
     imgupheight = "85";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg7.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down7.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "121";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone8"){
  
     imagupwidth="303";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "295";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up8.gif";
     bkimgup.src = imgup;
     imgupheight = "35";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg8.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down8.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "25";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone9"){
  
     imagupwidth="215";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "165";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up9.gif";
     bkimgup.src = imgup;
     imgupheight = "34";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg9.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down9.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "103";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone10"){
  
     imagupwidth="250";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "200";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up10.gif";
     bkimgup.src = imgup;
     imgupheight = "59";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg10.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down10.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "120";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone11"){
  
     imagupwidth="189";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "115";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up11.gif";
     bkimgup.src = imgup;
     imgupheight = "81";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg11.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down11.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "53";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone12"){
  
     imagupwidth="263";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "215";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up12.gif";
     bkimgup.src = imgup;
     imgupheight = "34";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg12.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down12.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "33";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone13"){
  
     imagupwidth="232";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "165";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up13.gif";
     bkimgup.src = imgup;
     imgupheight = "61";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg13.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down13.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "144";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone14"){
  
     imagupwidth="199";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "165";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up14.jpg";
     bkimgup.src = imgup;
     imgupheight = "66";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg14.png";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down14.jpg";
     bkimgdown.src = imgdown;
     imgdownheight = "135";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone15"){
  
     imagupwidth="230";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "165";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up15.gif";
     bkimgup.src = imgup;
     imgupheight = "79";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg15.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down15.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "91";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone16"){
  
     imagupwidth="227";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "165";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up16.gif";
     bkimgup.src = imgup;
     imgupheight = "94";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg16.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down16.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "82";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone17"){
  
     imagupwidth="212";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "165";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up17.gif";
     bkimgup.src = imgup;
     imgupheight = "97";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg17.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down17.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "161";
     bkimgdown.height = imgdownheight;
  
  }else if(imgbk.value == "phone18"){
  
     imagupwidth="250";
     bkimg.width = imagupwidth;
     bkimgup.width = imagupwidth;
     bkimgdown.width = imagupwidth;
     
     iframewidth = "165";
     wbb.width = iframewidth;
     
  
     imgup = imgURL + "phone_mb_up18.gif";
     bkimgup.src = imgup;
     imgupheight = "60";
     bkimgup.height = imgupheight;
     
     imgbg = imgURL + "phone_mb_bg18.gif";
     bkimgbg.style.backgroundImage="url("+imgbg+")";
  
     imgdown = imgURL + "phone_mb_down18.gif";
     bkimgdown.src = imgdown;
     imgdownheight = "127";
     bkimgdown.height = imgdownheight;
  
  }
  

  //iframe src value
  //alert(urlstr);
  if(imgline.value == "img"){
      if(king110.value=="")
	   { 
	   		if(searchdisplay.value != "block")
     		{
        		 wbb.src = "http://w.159.com/WapBro/Client/WAPBrowser.aspx?url=" + urlstr;
			}
			else
			{
				wbb.src = "http://w.159.com/WapBro/Client/WAPBroweL.aspx?url=" + urlstr;
			}
      }
      else
      {
		  if(searchdisplay.value != "block")
    	 {
        	wbb.src = "http://w.159.com/WapBro/Client/WAPBrow.aspx?url=" + urlstr ;
	 		}
			else
			{
				wbb.src = "http://w.159.com/WapBro/Client/WAPBrow1.aspx?url=" + urlstr ;
			}
      }
      
  }
  else{
     if(searchdisplay.value != "block")
     {
       if(king110.value=="")
	   { 
           wb.src = "http://w.159.com/WapBro/Client/WAPBrowser.aspx?url=" + urlstr ;
       }
       else
       {
           wb.src = "http://w.159.com/WapBro/Client/WAPBrow.aspx?url=" + urlstr ;
       }
     }
     else
     {
       if(king110.value=="")
	   { 
           wb.src = "/WapBro/Client/WAPBroweL.aspx?url=" + urlstr ;
       }
       else
       {
          wb.src = "/WapBro/Client/WAPBrow1.aspx?url=" + urlstr ;
       }
     }
  }
  
  //if(imgline.value == "img"){
//  wbb.src = "/wbexp.aspx?url=" + urlstr + "&bc="+cbgvalue+"&fs="+fs.value+"&sv="+displayvalue+"&fc="+fontColorValue+"&al="+alinkValue+"&ah="+ahoverValue+"&av="+visitedValue;
//  }else{
//  wb.src = "/wbexp.aspx?url=" + urlstr + "&bc="+cbgvalue+"&fs="+fs.value+"&sv="+displayvalue+"&fc="+fontColorValue+"&al="+alinkValue+"&ah="+ahoverValue+"&av="+visitedValue;
//  }
  

  if (totalSrc == "?"){
      totalSrc = urlstr;
  }else{
      //alert(totalSrc.lastIndexOf("&"));
	 
      totalSrc = totalSrc.substring(0,totalSrc.lastIndexOf("&"));
     
  }
 //text show ares

       strEncoding  ="<table id=\"bkimg\" width=\""+imagupwidth+"\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"display:block\">";
       strEncoding +="<tr>";
       strEncoding +="<td><img src=\""+imgup+"\"  width=\""+imagupwidth+"\" height=\""+imgupheight+"\" id=\"bkimgup\" ></td>";
       strEncoding +="</tr>";
       strEncoding +="<tr>";
       strEncoding +="<td background=\""+imgbg+"\" id=\"bkimgbg\"> ";
       strEncoding +="<table  border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">";
       strEncoding +="<tr>";
       strEncoding +="<td>";
	   strEncoding +=""+shuru+"";
	    if(king110.value=="")
	   {  
			 if(searchdisplay.value != "block")
			 {
				strEncoding +="<iframe name=\"wbb\" id=\"wbb\" style=\"margin-top:0px;border-color:#"+cbdvalue+";border-style:"+bkvalue+";border-width:"+bkwidth.value+"px; \"   marginheight=\"0\" marginwidth=\"0\" width=\""+iframewidth+"\" height=\""+imageheight+"px\" frameborder=\"0\" src=\"http://w.159.com/WapBro/Client/WAPBrowser.aspx?banquan="+king110.value+"&url="+urlstr+"\"></iframe>";
			 }
			 else
			 {
				 strEncoding +="<iframe name=\"wbb\" id=\"wbb\" style=\"margin-top:0px;border-color:#"+cbdvalue+";border-style:"+bkvalue+";border-width:"+bkwidth.value+"px; \"   marginheight=\"0\" marginwidth=\"0\" width=\""+iframewidth+"\" height=\""+imageheight+"px\" frameborder=\"0\" src=\"http://w.159.com/WapBro/Client/WAPBroweL.aspx?banquan="+king110.value+"&url="+urlstr+"\"></iframe>";
			 }
       }
       else
       {
		   if(searchdisplay.value != "block")
		   {
				strEncoding +="<iframe name=\"wbb\" id=\"wbb\" style=\"margin-top:0px;border-color:#"+cbdvalue+";border-style:"+bkvalue+";border-width:"+bkwidth.value+"px; \"   marginheight=\"0\" marginwidth=\"0\" width=\""+iframewidth+"\" height=\""+imageheight+"px\" frameborder=\"0\" src=\"http://w.159.com/WapBro/Client/WAPBrow.aspx?banquan="+king110.value+"&url="+urlstr+"\"></iframe>";
		   }
		   else
		   {
			  	strEncoding +="<iframe name=\"wbb\" id=\"wbb\" style=\"margin-top:0px;border-color:#"+cbdvalue+";border-style:"+bkvalue+";border-width:"+bkwidth.value+"px; \"   marginheight=\"0\" marginwidth=\"0\" width=\""+iframewidth+"\" height=\""+imageheight+"px\" frameborder=\"0\" src=\"http://w.159.com/WapBro/Client/WAPBrow1.aspx?banquan="+king110.value+"&url="+urlstr+"\"></iframe>";
 	
		   }

       }
       strEncoding +="</td>";
       strEncoding +="</tr>";
       strEncoding +="</table>";
       strEncoding +="</td>";
       strEncoding +="</tr>";
       strEncoding +="<tr>";
       strEncoding +="<td><img src=\""+imgdown+"\" width=\""+imagupwidth+"\" height=\""+imgdownheight+"\" border=\"0\" id=\"bkimgdown\" ></td>";
       strEncoding +="</tr>";
       strEncoding +="</table>";
     
    
      
  if(imgline.value == "img"){
    //document.form1.showcode.innerHTML = "<div>jdfdjfkl</div>";
    showcode.innerHTML = "<textarea cols=50 rows=10 id=showcode1>"+strEncoding+"</textarea>";
    //showcode.innerText = strEncoding;
  }else{
  showcode.innerHTML = "";
   if(king110.value=="")
    {  
		if (shuru!="")
		{
       		showcode.innerHTML="<textarea cols=50 rows=10 id=showcode1> <iframe name=\"wb\" id=\"wb\" style=\"position:relative;margin-top:0px;border-color:#"+cbdvalue+";border-style:"+bkvalue+";border-width:"+bkwidth.value+"px; \"   marginheight=\"0\" marginwidth=\"0\" width="+bw.value+" height="+imageheight+" frameborder=\"0\" src=\"http://w.159.com/WapBro/Client/WAPBroweL.aspx?url="+urlstr+"\"></iframe> </textarea>"
		}
		else
		{
			showcode.innerHTML="<textarea cols=50 rows=10 id=showcode1> <iframe name=\"wb\" id=\"wb\" style=\"position:relative;margin-top:0px;border-color:#"+cbdvalue+";border-style:"+bkvalue+";border-width:"+bkwidth.value+"px; \"   marginheight=\"0\" marginwidth=\"0\" width="+bw.value+" height="+imageheight+" frameborder=\"0\" src=\"http://w.159.com/WapBro/Client/WAPBrowser.aspx?url="+urlstr+"\"></iframe> </textarea>"
		}
    }
    else
    {
		if (shuru!="")
		{
       		showcode.innerHTML="<textarea cols=50 rows=10 id=showcode1> <iframe name=\"wb\" id=\"wb\" style=\"position:relative;margin-top:0px;border-color:#"+cbdvalue+";border-style:"+bkvalue+";border-width:"+bkwidth.value+"px; \"   marginheight=\"0\" marginwidth=\"0\" width="+bw.value+" height="+imageheight+" frameborder=\"0\" src=\"http://w.159.com/WapBro/Client/WAPBrow1.aspx?url="+urlstr+"\"></iframe> </textarea>"
		}
		else
		{
			showcode.innerHTML="<textarea cols=50 rows=10 id=showcode1> <iframe name=\"wb\" id=\"wb\" style=\"position:relative;margin-top:0px;border-color:#"+cbdvalue+";border-style:"+bkvalue+";border-width:"+bkwidth.value+"px; \"   marginheight=\"0\" marginwidth=\"0\" width="+bw.value+" height="+imageheight+" frameborder=\"0\" src=\"http://w.159.com/WapBro/Client/WAPBrow.aspx?url="+urlstr+"\"></iframe> </textarea>"
		}
    }
 
  }


}
function histo()
    {
          if(king110.value=="")
	      { 
         
               document.getElementById("wbb").src="http://w.159.com/WapBro/Client/WAPBrowser.aspx?url=http://"+myurl.value; 
          }
          else
          {
               document.getElementById("wbb").src="http://w.159.com/WapBro/Client/WAPBrow.aspx?url=http://"+myurl.value; 
          }
    }
	
function histo1()
{
    if(king110.value=="")
    { 
         
	  document.getElementById("wbb").src="http://w.159.com/WapBro/Client/WAPBrowser.aspx?url=http://"+url.value; 
	 }
	 else
	 {
	   document.getElementById("wbb").src="http://w.159.com/WapBro/Client/WAPBrow.aspx?url=http://"+myurl.value; 
	 }
}
	
function JM_cc(ob){
var bb;
var aa = document.getElementById("showcode1");
    aa.select();
    bb = aa.createTextRange();
    bb.execCommand("Copy");
    /*
var js;
ob.select();
js=ob.createTextRange();
js.execCommand("Copy");
*/
}

function gao(){
var gaoji = document.getElementById("gaojishow");
var getcolor = document.getElementById("getcolor"); 
var imgline = document.getElementById("imgline");   
    if(gaoji.style.display == "none"){
       gaoji.style.display = "block";
       getcolor.style.display = "block";
    }else{
       gaoji.style.display = "none";
       if (imgline.value != "line"){
       getcolor.style.display = "none";
       }
    }
}




function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}