1function ClearForm() 2{ 3 var FieldType; 4 for (var i = 0; i < document.EditForm.length; i++) { 5 FieldType = document.EditForm.elements[i].type 6 if (FieldType == "text" || FieldType == "textarea") { 7 document.EditForm.elements[i].value = "" 8 } 9 if (FieldType == "select-one") { 10 document.EditForm.elements[i].options.selectedIndex = 0 11 } 12 } 13} 14 15function OpenNewWindow(url, width, height) 16{ 17 var randomnumber=Math.floor(Math.random()*5001) 18 window.open(url, randomnumber, "top=10,left=10,menubar=0,resizable=1,scrollbars=1,width=" + width + ",height=" + height) 19} 20 21function OpenWindowNoScroll(url, width, height) { 22 window.open(url, 'popup_noscroll', 23 "top=10,left=10,menubar=0,resizable=0,scrollbars=0,width=" + width + ",height=" + height) 24} 25 26function protect_images2(e) { 27var msg = "Sorry, our images are copyrighted."; 28if (navigator.appName == 'Netscape' && e.which == 3) { 29 alert(msg); 30 return false; 31} 32if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) { 33 alert(msg); 34 return false; 35} 36else return true; 37} 38 39function protect_images1() { 40 if(document.images) { 41 for(i=0;i<document.images.length;i++) { 42 document.images[i].onmousedown = protect_images2; 43 document.images[i].onmouseup = protect_images2; 44 } 45 } 46} 47 48function OpenSideWindow(url){ 49 rightwidth=300; 50 if (document.all) { 51 windowheight = screen.availHeight; 52 leftwidth=screen.availWidth-rightwidth-11; 53 SideWindow=window.open(url,'SideWindow','width='+rightwidth+',height='+(windowheight-60)+',screenX='+leftwidth+',screenY=0,top=0,left=' +leftwidth+',toolbar=0,location=0,status=1,menubar=0,resizable=1'); 54 SideWindow.focus(); 55 } else { 56 SideWindow=window.open(url,'','width=280,height=480,toolbar=0,location=0,status=1,menubar=0,resizable=1'); 57 } 58} 59 60function PageName() { 61 var pageName = window.location.href.toLowerCase(); 62 if (pageName.indexOf('_p/') != -1 || pageName.indexOf('-p/') != -1) { 63 pageName = 'productdetails.asp'; 64 } 65 else if (pageName.indexOf('_s/') != -1 || pageName.indexOf('-s/') != -1) { 66 pageName = 'searchresults.asp'; 67 } 68 else { 69 pageName = pageName.substr(pageName.lastIndexOf("/") + 1).replace(/\?[\s\S]*/, ""); 70 } 71 return pageName; 72} 73 74function PagePath() { 75 return window.location.href.toLowerCase().replace(/http[s]?:\/\/[^\/]*\/?/, "").replace(/\?[\s\S]*/, ""); 76} 77 78function QueryString(name) { 79 var qsRE = new RegExp("[?&]" + name + "=([^&]*)", "i"); 80 var value = qsRE.exec(location.href); 81 return (value) ? decode(value[1]) : ""; 82} 83 84function GetCookieArray() { 85 if (document.cookie.length > 0) { 86 var cookieRE = new RegExp("(?:^|;)[\\s]*([^=]*)=([^;]*)", "gi"); 87 var cookie, cookieArray = new Array(); 88 cookie = cookieRE.exec(unescape(document.cookie.toString())) 89 while (cookie) { 90 cookieArray[cookie[1]] = cookie[2]; 91 cookie = cookieRE.exec(unescape(document.cookie.toString())) 92 } 93 return cookieArray; 94 } 95 return ""; 96} 97 98function GetCookie(name, key, encoded) { 99 var value = '', cookies = ';' + document.cookie; 100 if (cookies.length > 1) { 101 if (key) { 102 var cookieRE = new RegExp(';[\\s]*' + name + '=[^;]*' + key + '=([^&;]*)[^;]*', 'i') 103 } 104 else { 105 var cookieRE = new RegExp(';[\\s]*' + name + '=([^;]*)', 'i'); 106 } 107 value = cookieRE.exec(cookies); 108 value = (value) ? value[1] : ''; 109 if (!encoded) { 110 value = decode(value); 111 } 112 } 113 return value; 114} 115 116var c_minutes = 1, c_hours = 60, c_days = 1440, c_years = 525600; 117function SetCookie(name, value, duration, key) { 118 var cookie = ''; 119 if (key) { 120 cookie = GetCookie(name, '', true); 121 if (cookie != '') { 122 cookie = '&' + cookie; 123 var keyRE = new RegExp('([\\s\\S]*?)(&' + key + '=)[^&]*([\\s\\S]*)', 'i'); 124 if (keyRE.test(cookie)) { 125 if (value == '') { 126 cookie = cookie.replace(keyRE, '$1$3'); 127 } 128 else { 129 cookie = cookie.replace(keyRE, '$1$2' + encode(value) + '$3'); 130 } 131 } 132 else if (value != '') { 133 cookie += '&' + key + '=' + encode(value); 134 } 135 cookie = cookie.substr(1); 136 } 137 else if (value == '') { 138 cookie = ''; 139 } 140 else { 141 cookie = key + '=' + encode(value); 142 } 143 } 144 else if (value != '') { 145 cookie = encode(value); 146 } 147 if (cookie == '') { 148 duration = -1000; 149 } 150 cookie = name + '=' + cookie + ';path=/'; 151 152 if (duration) { 153 var expireDate = new Date(); 154 expireDate.setMinutes(expireDate.getMinutes() + parseInt(duration)); 155 cookie = cookie + ';expires=' + expireDate.toGMTString(); 156 } 157 document.cookie = cookie; 158 return value; 159} 160 161function encode(value) { 162 value = escape(value); 163 value = value.replace(/@/gi, "%40"); 164 value = value.replace(/\*/gi, "%2A"); 165 value = value.replace(/_/gi, "%5F"); 166 value = value.replace(/-/gi, "%2D"); 167 value = value.replace(/\+/gi, "%2B"); 168 value = value.replace(/\./gi, "%2E"); 169 value = value.replace(/\//gi, "%2F"); 170 value = value.replace(/%20/gi, "+"); 171 return value; 172} 173 174function decode(value) { 175 value = value.replace(/\+/g, " "); 176 value = unescape(value); 177 return value; 178} 179 180function v$(id) { 181 if (typeof(id) == 'string') { 182 return document.getElementById(id); 183 } 184 else { 185 return id; 186 } 187} 188 189function FixEvent(event) { 190 if (window.event) { 191 var event = window.event; 192 event.target = event.srcElement; 193 } 194 else { 195 var event = event; 196 } 197 return event; 198} 199 200function AttachEvent(element, event, func) { 201 if (element.addEventListener) { 202 element.addEventListener(event.toLowerCase(), func, false); 203 } 204 else { 205 element.attachEvent('on' + event.toLowerCase(), func); 206 } 207} 208 209function DetachEvent(element, event, func) { 210 if (element.removeEventListener) { 211 element.removeEventListener(event.toLowerCase(), func, false); 212 } 213 else { 214 element.detachEvent('on' + event.toLowerCase(), func); 215 } 216} 217 218function ShowHide(Element_ID, Show) { 219 var Element = v$(Element_ID); 220 if (Element) { 221 Show = eval(Show) 222 if (typeof(Show) == 'undefined' && Element.style['display'] != 'none' || Show == false) { 223 Element.style['display'] = 'none'; 224 return false;
225 } 226 else { 227 Element.style['display'] = ''; 228 return true; 229 } 230 } 231} 232 233 234function vPlacement(element) { 235 var isSafari = false; 236 var foundPositionedElement = false; 237 238 if (navigator.vendor) { 239 if (navigator.vendor.toLowerCase().indexOf('apple') != -1) { 240 isSafari = true; 241 var getComputedStyle = document.defaultView.getComputedStyle; 242 } 243 } 244 245 var left = element.offsetLeft; 246 var top = element.offsetTop; 247 var parent = element.offsetParent; 248 while (parent) { 249 left += parent.offsetLeft; 250 top += parent.offsetTop; 251 252 var position = computedStyle(parent, 'position', 'position'); 253 if (parent.nodeName.toLowerCase() != 'body') { 254 left -= parent.scrollLeft; 255 top -= parent.scrollTop; 256 } 257 if (position == 'absolute' || position == 'relative') { 258 foundPositionedElement = true; 259 } 260 261 if (document.all) { 262 if (parent.nodeName.toUpperCase() == 'TABLE') { 263 left += (parseFloat(parent.border) || 0) ? 1 : 0; 264 top += (parseFloat(parent.border) || 0) ? 1 : 0; 265 } 266 } 267 else if (isSafari) { 268 if (parent.nodeName.toUpperCase() == 'TD' || parent.nodeName.toUpperCase() == 'TABLE') { 269 left += parseFloat(getComputedStyle(parent, null).getPropertyValue('border-left-width')) || 0; 270 top += parseFloat(getComputedStyle(parent, null).getPropertyValue('border-top-width')) || 0; 271 } 272 } 273 parent = parent.offsetParent; 274 } 275 delete(parent); 276 if (foundPositionedElement) { 277 left += document.documentElement.scrollLeft || document.body.scrollLeft; 278 top += document.documentElement.scrollTop || document.body.scrollTop; 279 } 280 return {'left':left, 'top':top, 'width':element.offsetWidth, 'height':element.offsetHeight} 281} 282 283// 05/08/2007 - vTrim() Added by ERW1N GUNG0N - changed to regex brad 284function vTrim(arg_value) { 285 return arg_value.toString().replace(/^[\s]+|[\s]+$/g, ''); 286} 287 288 289function computedStyle(element, ieStyle, ffStyle) { 290 if (element.currentStyle) { 291 return element.currentStyle[ieStyle]; 292 } 293 else if (document.defaultView && document.defaultView.getComputedStyle) { 294 return document.defaultView.getComputedStyle(element, null).getPropertyValue(ffStyle); 295 } 296 else { 297 return element.style[ieStyle]; 298 } 299} 300 301var agt = ''; 302if (navigator.userAgent) { agt=navigator.userAgent.toLowerCase(); } 303// *** BROWSER VERSION *** 304// note: on IE5, these return 4, so use is_ie5up to detect IE5. 305var is_major = parseInt(navigator.appVersion); 306var is_minor = parseFloat(navigator.appVersion); 307var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 308 && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 309 && (agt.indexOf('webtv')==-1)); 310var is_nav4 = (is_nav && (is_major == 4)); 311var is_nav4up = (is_nav && (is_major >= 4)); 312var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) || 313 (agt.indexOf("; nav") != -1)) ); 314var is_nav5 = (is_nav && (is_major == 5)); 315var is_nav5up = (is_nav && (is_major >= 5)); 316var is_ie = (agt.indexOf("msie") != -1); 317var is_ie3 = (is_ie && (is_major < 4)); 318var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) ); 319var is_ie4up = (is_ie && (is_major >= 4)); 320var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) ); 321var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.