4 var gstrFormName= "";
\r
5 var gbWithButton = false;
\r
7 var gsOverImage = "";
\r
9 var gsClickImage = "";
\r
11 var gsBgColor = "#c0c0c0";
\r
14 var gbInputEnable = 0;
\r
16 var goTitleFont=null;
\r
17 var goInputFont=null;
\r
18 var goNormalFont=null;
\r
19 var goHoverFont=null;
\r
23 function setBackground(sBgImage)
\r
25 if (sBgImage != null && sBgImage.length > 0)
\r
26 gsBgImage = sBgImage;
\r
28 if (gsBgImage && gsBgImage .length > 0)
\r
30 document.body.background = gsBgImage ;
\r
34 function setBackgroundcolor(sBgColor)
\r
36 if (sBgColor != null && sBgColor.length > 0)
\r
37 gsBgColor = sBgColor;
\r
39 if (gsBgColor&& gsBgColor.length > 0)
\r
41 document.body.bgColor = gsBgColor;
\r
45 function setBtnType(sType)
\r
47 if (sType == "image")
\r
51 else if (sType == "text")
\r
57 function setGoImage1(sImage1)
\r
59 gsOutImage = sImage1;
\r
60 if (gsOutImage && gsOutImage.length > 0)
\r
61 gbWithButton = true;
\r
64 function setGoImage2(sImage2)
\r
66 gsOverImage = sImage2;
\r
67 if (gsOverImage && gsOverImage.length > 0)
\r
68 gbWithButton = true;
\r
71 function setGoImage3(sImage3)
\r
73 gsClickImage = sImage3;
\r
74 if (gsClickImage && gsClickImage.length > 0)
\r
75 gbWithButton = true;
\r
78 function setGoText(sText)
\r
81 if (gsText.length > 0)
\r
82 gbWithButton = true;
\r
85 function setFont(sType, sFontName, sFontSize, sFontColor, sFontStyle, sFontWeight, sFontDecoration)
\r
87 var vFont = new whFont(sFontName, sFontSize, sFontColor, sFontStyle, sFontWeight, sFontDecoration);
\r
88 if (sType == "Title")
\r
90 goTitleFont = vFont;
\r
91 var vFont1 = new whFont(sFontName, sFontSize, "black", sFontStyle, sFontWeight, sFontDecoration);
\r
92 goInputFont=vFont1;
\r
94 else if (sType == "Normal")
\r
95 goNormalFont = vFont;
\r
96 else if (sType == "Hover")
\r
97 goHoverFont = vFont;
\r
100 function writeFormStyle()
\r
102 var sStyle = "<style type='text/css'>";
\r
103 sStyle += "p.title {" + getFontStyle(goTitleFont) + "margin-top:0;margin-bottom:0}\n";
\r
104 sStyle += ".inputfield {" + getFontStyle(goInputFont) +"width:100%; }\n";
\r
105 sStyle+="A:link {"+getFontStyle(goNormalFont)+"}\n";
\r
106 sStyle+="A:visited {"+getFontStyle(goNormalFont)+"}\n";
\r
107 sStyle +="A:hover {"+getFontStyle(goHoverFont)+"}\n";
\r
108 sStyle+=".clsFormBackground{\n";
\r
110 sStyle+="border-top:"+gsBgColor+" 1px solid;}\n";
\r
112 sStyle+="border-top:black 1px solid;}\n";
\r
114 sStyle += "</style>";
\r
115 document.write(sStyle);
\r
118 function lookupKeyDown()
\r
124 if (event.keyCode == 13) //Enter key
\r
138 if (!window.Array) return;
\r
139 document.onkeyup = lookupKeyDown;
\r
142 function inputSubmit()
\r
144 if ((gbInputEnable && !gbIE4)|| gbInImage)
\r
148 function inputEnable(bEnable)
\r
150 gbInputEnable = bEnable;
\r
153 function inImage(bImage)
\r
155 gbInImage = bImage;
\r
158 function getFormHTML()
\r
161 sForm += "<table class=\"clsFormBackground\" width=\"100%\" cellspacing=\"0\" cellpadding=\"5\" border=\"0\">";
\r
162 sForm += "<form name=\"" + gstrFormName + "\" method=\"POST\" action=\"javascript:inputSubmit()\" style=\"width:100%\">";
\r
165 sForm += "<p class=title><nobr>" + gsTitle + "</nobr><br><table width=\"100%\"><tr valign=\"middle\"><td width=\"100%\"><input class=\"inputfield\" type=\"text\" name=\"keywordField\" onfocus=\"inputEnable(1);\" onblur=\"inputEnable(0);\"></td>";
\r
166 if (gbWithButton && gnType >= 0)
\r
168 sForm += "<td><a title=\"submit button\" href=\"javascript:void(0);\" onclick=\"" + gstrFormName + ".submit(); return false;\" onfocus=\"inImage(1);\" onblur=\"inImage(0);\" onmouseup=\"onMouseUp();\" onmousedown=\"onMouseDown();\" onmouseover=\"onMouseOver();\" onmouseout=\"onMouseOut();\">"
\r
173 sForm += "<img alt=\""+gsText+"\" id=\"go\" border=\"0\" src=\"" + gsOutImage + "\">";
\r
177 sForm += "</a></td>";
\r
179 sForm += "</tr></table></p></td></tr></form></table>";
\r
183 function onMouseOver()
\r
185 if (getElement("go") && gsOverImage)
\r
186 getElement("go").src = gsOverImage;
\r
189 function onMouseDown()
\r
191 if (getElement("go") && gsClickImage)
\r
192 getElement("go").src = gsClickImage;
\r
195 function onMouseUp()
\r
197 if (getElement("go") && gsOutImage)
\r
198 getElement("go").src = gsOutImage;
\r
201 function onMouseOut()
\r
203 if (getElement("go") && gsOutImage)
\r
204 getElement("go").src = gsOutImage;
\r
207 if (window.gbWhUtil&&window.gbWhVer&&window.gbWhProxy&&window.gbWhMsg)
\r
209 goTitleFont=new whFont("Arial", "9pt", "#000000", "normal", "normal", "none");
\r
210 goNormalFont=new whFont("Arial", "9pt", "#000000", "normal", "normal", "none");
\r
211 goHoverFont=new whFont("Arial", "9pt", "#000000", "normal", "normal", "underline");
\r
215 document.location.reload();