1// »ñÈ¡ÔªËØid 2function $id(str){ 3 return document.getElementById(str); 4} 5 6// »ñÈ¡ÔªËØname 7function $name(str){ 8 return document.getElementsByName(str); 9} 10 11// °ÑOptionµÄtextÖµ¸²¸ÇtoIDÎı¾¿ò 12// Ó¦ÓÃÀý×Ó onchange="OptionTextTo('labItemID','labItemName');" 13function OptionTextTo(sourceID,toID){ 14 document.getElementById(toID).value=document.getElementById(sourceID).options[document.getElementById(sourceID).selectedIndex].text; 15} 16 17// »ñÈ¡ÏÂÀ¿òµÄÎı¾ 18function SelectGetText(selectName){ 19 return document.getElementById(selectName).options[document.getElementById(selectName).options.selectedIndex].text; 20} 21 22 23// ÅжÏÊÇ·ñº¬ÌØÊâ·ûºÅ 24function Str_IsSign(str){ 25 var txt=new RegExp("[ ,\\`,\\~,\\!,\\@,\#,\\$,\\%,\\^,\\+,\\*,\\&,\\\\,\\/,\\?,\\|,\\:,\\.,\\<,\\>,\\{,\\},\\(,\\),\\',\\;,\\=,\"]"); 26 // ÌØÊâ×Ö·ûÕýÔò±í´ïʽ 27 if (txt.test(str)){ 28 return true; 29 }else{ 30 return false; 31 } 32} 33 34// ¼ÆËã×Ö·û´®µÄ×Ö½ÚÊý 35function Str_Byte(str){ 36 var newStr = 0; 37// newStr=str.replace(/[^\u7F51\u949B\u5DE5\u4F5C\u5BA4]/g, '***');
38 newStr=str.replace(/[^\u0000-\u00ff]/g, '***'); 39 return newStr.length; 40} 41 42// ¼ÆËã×Ö·û´®µÄ×Ö½ÚÊý 43/*function Str_Byte(str){ 44 strLen = str.length; 45 //str=str.replace(/[^\w\u4E00-\u9FA5]/g, '') 46 str=str.replace(/[^\x00-\xff]/g, ''); 47 strLen2 = str.length; 48 strTotalLen = strLen2 + (strLen - strLen2) * 2; 49 return strTotalLen; 50}*/ 51 52function ToInt(str){ 53 var newInt = parseInt(str); 54 if(isNaN(newInt)) { newInt = 0; } 55 return newInt; 56} 57 58function ToFloat(str){ 59 var newFloat = parseFloat(str); 60 if(isNaN(newFloat)) { newFloat = 0; } 61 return newFloat; 62} 63 64function ToGetStr(name){ 65 var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); 66 var r = window.location.search.substr(1).match(reg); 67 if(r!=null)return unescape(r[2]); return ''; 68} 69 70function ToGetPara(str,name){ 71 var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); 72 var r = (str +'').match(reg); 73 if(r!=null)return unescape(r[2]); return ''; 74} 75 76// ¼ì²âÓÊÏäµÄºÏ·¨ÐÔ¡£ 77function IsMail(str){ 78 if (str.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1){ 79 return true; 80 }else{ 81 return false; 82 } 83} 84 85// ¼ì²âÊÖ»úºÅµÄºÏ·¨ÐÔ¡£ 86function IsPhone(str){ 87 if (str.search(/^1\d{10}$/)!=-1){ 88 return true; 89 }else{ 90 return false; 91 } 92} 93 94// ¼ì²âÎļþ¿òÊÇ·ñΪͼƬÎļþ 95function IsImgFile(fileValue){ 96 var re = new RegExp("\.(gif|jpg|jpeg|png|bmp)","ig"); 97 return re.test(fileValue) 98} 99 100// ¼ì²âÊÇ·ñΪhttp¡¢httpsÐÒéÍøÖ· 101function IsHttpUrl(urlStr){ 102 if (urlStr.substr(0,7).toLowerCase()=="http://" || urlStr.substr(0,8).toLowerCase()=="https://"){ 103 return true; 104 }else{ 105 return false; 106 } 107} 108 109function IsAbsUrl(urlStr){ 110 if (urlStr.substr(0,7).toLowerCase()=="http://" || urlStr.substr(0,8).toLowerCase()=="https://" || urlStr.substr(0,1)=="/"){ 111 return true; 112 }else{ 113 return false; 114 } 115} 116 117function FiltHtmlTag(str) { 118 str = str.replace(/<\/?[^>]*>/g,''); // È¥³ýHTML tag 119 str = str.replace(/(\t|\r|\n| |\ |\ )/g,''); // È¥³ý¿Õ¸ñ¡¢»»ÐС¢ÖƱí·û 120 return str; 121} 122 123 124// ¹ýÂË×Ö·û´® 125// Ó¦ÓÃÀý×Ó onkeyup="if (this.value!=FiltChar(this.value)){this.value=FiltChar(this.value)}" 126// Ó¦ÓÃÀý×Ó onkeyup="this.value=FiltChar(this.value)" 127function FiltChar(str){ 128 return str.replace(/[^\w\u4E00-\u9FA5]/g, ''); 129} 130 131// ¹ýÂËСÊý 132// Ó¦ÓÃÀý×Ó onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" 133// Ó¦ÓÃÀý×Ó onkeyup="this.value=FiltDecimal(this.value)" 134function FiltDecimal(str){ 135 return str.replace(/[^\d*\.?\d{0,2}$]/g,'') 136} 137 138// ¹ýÂËСÊý±£Áô2λСÊý 139// Ó¦ÓÃÀý×Ó onkeyup="if (this.value!=FiltDecimal2(this.value)){this.value=FiltDecimal2(this.value)}" 140// Ó¦ÓÃÀý×Ó onkeyup="this.value=FiltDecimal2(this.value)" 141function FiltDecimal2(str){ 142 return str.replace(/(^\d*\.?\d{0,2}).*/g,'$1') 143} 144 145// ¹ýÂËÕûÊý 146// Ó¦ÓÃÀý×Ó onkeyup="if (this.value!=FiltInt(this.value)){this.value=FiltInt(this.value)}" 147// Ó¦ÓÃÀý×Ó onkeyup="this.value=FiltInt(this.value)" 148function FiltInt(str){ 149 return str.replace(/\D/g,'') 150} 151 152// ¹ýÂË·ÇÊý×Ö¡¢×Öĸ 153// Ó¦ÓÃÀý×Ó onkeyup="if (this.value!=FiltABCNum(this.value)){this.value=FiltABCNum(this.value)}" 154// Ó¦ÓÃÀý×Ó onkeyup="this.value=FiltABCNum(this.value)" 155function FiltABCNum(str){ 156 return str.replace(/[^A-Za-z0-9]/ig,'') 157} 158 159// ¹ýÂË·ÇÊý×Ö¡¢×Öĸ¡¢Ï»®Ïß 160// Ó¦ÓÃÀý×Ó onkeyup="if (this.value!=FiltAbcNum_(this.value)){this.value=FiltAbcNum_(this.value)}" 161// Ó¦ÓÃÀý×Ó onkeyup="this.value=FiltAbcNum_(this.value)" 162function FiltAbcNum_(str){ 163 return str.replace(/[^A-Za-z0-9_]/ig,'') 164} 165 166// Éú³ÉËæ»úÊý 167// num£ºÉú³É¸öÊý 168function RndNum(num) { 169 var a = new Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "Z", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"); 170 var b = "", c; 171 for(i=1; i<=num; i++){ 172 c = Math.floor(Math.random() * a.length); 173 b = b + a[c]; 174// a = a.del(c); 175 } 176 return b; 177} 178 179// ¼ÓÔØJSÎļþ 180function LoadJsFile(fileId,filePath,mode){ 181 var scriptTag = document.getElementById(fileId); 182 var headObj = document.getElementsByTagName('head').item(0); 183 if(scriptTag){ 184 if (mode==1){ 185 headObj.removeChild(scriptTag); 186 jsFile = document.createElement('script'); 187 jsFile.src = filePath; 188 jsFile.type = 'text/javascript'; 189// jsFile.defer = 'defer'; 190 jsFile.id = fileId; 191 if (fileId == "kindeditorJs"){ 192 jsFile.charset = "UTF-8"; 193 } 194 headObj.appendChild(jsFile); 195 } 196 }else{ 197 jsFile = document.createElement('script'); 198 jsFile.src = filePath; 199 jsFile.type = 'text/javascript'; 200// jsFile.defer = 'defer'; 201 jsFile.id = fileId; 202 if (fileId == "kindeditorJs"){ 203 jsFile.charset = "UTF-8"; 204 } 205 headObj.appendChild(jsFile); 206 } 207} 208 209// ¼ÓÔØCSSÎļþ 210function LoadCssFile(fileId,filePath,mode){ 211 var cssTag = document.getElementById(fileId); 212 var headObj = document.getElementsByTagName('head').item(0); 213 if(cssTag){ 214 if (mode==1){ 215 headObj.removeChild(cssTag); 216 cssFile = document.createElement('link'); 217 cssFile.href = filePath; 218 cssFile.rel = 'stylesheet'; 219 cssFile.type = 'text/css'; 220 cssFile.id = fileId; 221 headObj.appendChild(cssFile); 222 } 223 }else{ 224 cssFile = document.createElement('link'); 225 cssFile.href = filePath; 226 cssFile.rel = 'stylesheet'; 227 cssFile.type = 'text/css'; 228 cssFile.id = fileId; 229 headObj.appendChild(cssFile); 230 } 231} 232 233// µã»÷¿ªÆôÒþ²ØÇø£¬ÔÙµã»÷Òþ²Ø 234function ClickShowHidden(idStr){ 235 if ($id(idStr).style.display == ''){ 236 $id(idStr).style.display = 'none'; 237 }else{ 238 $id(idStr).style.display = ''; 239 } 240 try { 241 WindowHeight(0); 242 }catch (e) {} 243} 244 245 246// µã»÷µ¯³ö¸¡²ã 247var djt; 248function ShowMengceng(str, sec){ 249 if (sec > 0){ 250 var djSec = 0; 251 // djt = window.setInterval("djSecFunc()",1000); 252 djt = window.setInterval(function(){ 253 djSec += 1; 254 $("#floatSec").html(' '+ djSec +'s'); 255 if (djSec > sec){ 256 window.clearInterval(djt); 257 HiddenMengceng(); 258 } 259 },1000); 260 } 261 //Çå³ý֮ǰµÄÑùʽ 262 $("#fullScreen,#floatLayer").remove(); 263 $("body").append( 264 //Õ¼¾ÝÕû¸öÆÁÄ»Div 265 "<div id='fullScreen'></div>"+ 266 //¸¡²ãÇø 267 "<div id='floatLayer'>"+ str +"<span id='floatSec'></span></div>" 268 ); 269} 270 271// Òþ²Ø¸¡²ã 272function HiddenMengceng(){ 273 window.clearInterval(djt); 274 $("#fullScreen,#floatLayer").remove(); 275} 276 277 278// ÏÂÀ¿òÄÚÈÝÔØÈëÊý×é±äÁ¿ 279function SelectOptionArr(selectName){ 280 var SelectOptionArray = new Array(); 281 282 for (soi=0; soi<document.getElementById(selectName).options.length; soi++){ 283 SelectOptionArray[document.getElementById(selectName).options[soi].value] = document.getElementById(selectName).options[soi].text; 284 } 285 return SelectOptionArray; 286} 287 288// ÏÂÀ¿òÄÚÈݼìË÷ 289function SelectOptionSearch(sourceID,selectName,arrObj){ 290 document.getElementById(selectName).options.length=0; 291 for (var key in arrObj){ 292 if (arrObj[key].lastIndexOf(document.getElementById(sourceID).value)>=0){ 293 document.getElementById(selectName).options.add(new Option(arrObj[key],key)); 294 } 295 } 296} 297 298// ÇåÀíÏÂÀ¿òÄÚÈÝ 299function SelectOptionClear(selectName,defText){ 300 document.getElementById(selectName).options.length=0; 301 document.getElementById(selectName).options.add(new Option(defText,"")); 302 document.getElementById(selectName).value = ""; 303} 304 305// ¹â±ê´ýµÄµØ·½Ìí¼Ó×Ö·û´® 306function FocusAddText(inputId,str){ 307 var ubb=document.getElementById(inputId); 308 var ubbLength=ubb.value.length; 309 ubb.focus(); 310 if(typeof document.selection !="undefined"){ 311 document.selection.createRange().text=str; 312 }else{ 313 ubb.value=ubb.value.substr(0,ubb.selectionStart)+str+ubb.value.substring(ubb.selectionStart,ubbLength); 314 } 315} 316 317// ¸´ÖÆÄÚÈÝ(»ñÈ¡IDËùÔÚµÄvalue) 318function ValueToCopy(id){ 319 copy = $id(id).value 320 if (window.clipboardData){ 321 window.clipboardData.setData("Text", copy); 322 }else if(navigator.userAgent.indexOf("Opera") != -1){ 323 window.location = copy; 324 }else if(window.netscape){ 325 try { 326 netscape.security.PrivilegeManager 327 .enablePrivilege("UniversalXPConnect"); 328 }catch (e){ 329 alert("ÄãʹÓõÄFireFoxä¯ÀÀÆ÷,¸´Öƹ¦Äܱ»ä¯ÀÀÆ÷¾Ü¾ø£¡\nÇëÔÚä¯ÀÀÆ÷µØÖ·À¸ÊäÈë¡°about:config¡±²¢»Ø³µ¡£\nÈ»ºó½«¡°signed.applets.codebase_principal_support¡±Ë«»÷£¬ÉèÖÃΪ¡°true¡±"); 330 return; 331 } 332 var clip = Components.classes['@mozilla.org/widget/clipboard;1'] 333 .createInstance(Components.interfaces.nsIClipboard); 334 if (!clip) 335 return; 336 var trans = Components.classes['@mozilla.org/widget/transferable;1'] 337 .createInstance(Components.interfaces.nsITransferable); 338 if (!trans) 339 return; 340 trans.addDataFlavor('text/unicode'); 341 var str = new Object(); 342 var len = new Object(); 343 var str = Components.classes["@mozilla.org/supports-string;1"] 344 .createInstance(Components.interfaces.nsISupportsString); 345 str.data = copy; 346 trans.setTransferData("text/unicode", str, copy.length * 2); 347 var clipid = Components.interfaces.nsIClipboard; 348 if (!clip) 349 return false; 350 clip.setData(trans, null, clipid.kGlobalClipboard); 351 }else{ 352 alert("ÄãµÄä¯ÀÀÆ÷²»Ö§³ÖÒ»¼ü¸´Öƹ¦ÄÜ"); 353 return; 354 } 355 alert("¸´ÖƳɹ¦") 356 return false; 357} 358 359// webPathPart±äÐÎ 360function WppSign(str){ 361 return str.replace(/\.\.\//g,"a"); 362} 363 364if (typeof(webPathPart) == "undefined"){ webPathPart = ""; } 365 366// ¸Ä±äÑéÖ¤Âë 367function ChangeCode(){ 368 try { 369 $id("showcode").src=webPathPart +"inc/VerCode"+ SYS_verCodeMode +".asp?mudi="+ Math.random(); 370 $id("verCode").value = ""; 371 $id("verCode").focus(); 372 }catch (e) {} 373} 374 375// µã»÷ÑéÖ¤Âë¿ò»ñÈ¡ÑéÖ¤Âë 376function GetVerCode(str){ 377 try { 378 if ($id("showVerCode").innerHTML.lastIndexOf('VerCode')==-1){ 379 $id("showVerCode").innerHTML = "<img id='showcode' src='"+ webPathPart +"inc/VerCode"+ SYS_verCodeMode +".asp?mudi="+ Math.random() +"' align='top' style='cursor:pointer;' onclick='ChangeCode()' alt='µã»÷¸ü»»' />"; 380 }else if (str == "change"){ 381 ChangeCode(); 382 } 383 }catch (e) {} 384} 385 386 387// ¸Ä±äÑéÖ¤Âë 388function PopupChangeCode(){ 389 try { 390 $id("popVerCodeImg").src=webPathPart +"inc/VerCode"+ SYS_verCodeMode +".asp?mudi="+ Math.random(); 391 $id("popVerCode").value = ""; 392 $id("popVerCode").focus(); 393 }catch (e) {} 394} 395 396// µã»÷ÑéÖ¤Âë¿ò»ñÈ¡ÑéÖ¤Âë 397function PopupGetVerCode(str){ 398 try { 399 if ($id("popVerCodeStr").innerHTML.lastIndexOf('VerCode')==-1){ 400 $id("popVerCodeStr").innerHTML = "<img id='popVerCodeImg' src='"+ webPathPart +"inc/VerCode"+ SYS_verCodeMode +".asp?mudi="+ Math.random() +"' align='top' style='cursor:pointer;' onclick='PopupChangeCode()' alt='µã»÷¸ü»»' />"; 401 }else if (str == "change"){ 402 PopupChangeCode(); 403 } 404 }catch (e) {} 405} 406 407function WebCurrAnchor(str){ 408 webCurrUrl = document.location.href; 409 if (webCurrUrl.indexOf("#")>-1){ 410 document.location.href=webCurrUrl.substring(0,webCurrUrl.lastIndexOf("#")) +"#"+ str; 411 }else{ 412 document.location.href=webCurrUrl +"#"+ str; 413 } 414} 415 416// ¶¥²¿»áÔ±×¨Çø 417function TopUser(){ 418 if (webTypeName!="api"){ 419 $.ajaxSetup({cache:false}); 420 $.get(webPathPart +"users.asp", function(result){ 421 document.getElementById("topUserBox").innerHTML = result.replace(/\"\+ webPathPart \+\"/g,webPathPart); 422 }); 423 } 424 425 return false; 426 427} 428 429// ¶¥²¿Ê±¼ä 430function TopTime(){ 431 var day = new Array(); 432 day[0] = "ÐÇÆÚÈÕ"; 433 day[1] = "ÐÇÆÚÒ»"; 434 day[2] = "ÐÇÆÚ¶þ"; 435 day[3] = "ÐÇÆÚÈý"; 436 day[4] = "ÐÇÆÚËÄ"; 437 day[5] = "ÐÇÆÚÎå"; 438 day[6] = "ÐÇÆÚÁù"; 439 var now = new Date(); 440 var yy = now.getFullYear(); 441 var mo = now.getMonth()+1; 442 var dd = now.getDate(); 443 var ww = day[now.getDay()]; 444 var hh = now.getHours(); 445 var mm = now.getMinutes(); 446 var ss = now.getTime() % 60000; 447 ss = (ss - (ss % 1000)) / 1000; 448 var cl = ''; 449 if (now.getDay() == 0) cl = ''; 450 if (now.getDay() == 6) cl = ''; 451 $id('topTimeBox').innerHTML = '<span style=\'color:#848484;\'>'+ cl +yy + 'Äê' + mo + 'ÔÂ' + dd + 'ÈÕ ' + ww + '</span>'; 452} 453 454// ¶¥²¿½ÚÈÕ 455function TopFestival(){ 456 $id('topFestivalBox').innerHTML = jieriData; 457} 458 459// ¶¥²¿114À²ÌìÆøÔ¤±¨ 460function Weather114la(num){ 461 if (num==11){ 462 $id('topWeatherBox').innerHTML = "<iframe allowtransparency='true' frameborder='0' width='317' height='28' scrolling='no' style='margin-top:3px;' src='http://tianqi.2345.com/plugin/widget/index.htm?s=3&z=1&t=1&v=0&d=1&bd=0&k=000000&f
462=&q=1&e=0&a=1&c=58847&w=317&h=28&align=left'></iframe>"; 463 }else{ 464 $id('topWeatherBox').innerHTML = "<iframe allowtransparency='true' frameborder='0' width='524' height='28' scrolling='no' style='margin-top:3px;' src='http://tianqi.2345.com/plugin/widget/index.htm?s=3&z=1&t=0&v=0&d=2&bd=0&k=&f=&q=1&e=0&a=1&c=58847&w=524&h=28&align=left'></iframe>"; 465 } 466} 467 468// ¼ÓÈëÊղؼР469function AddFavorite(sURL, sTitle){ 470 try{ 471 window.external.addFavorite(sURL, sTitle); 472 }catch (e){ 473 try{ 474 window.sidebar.addPanel(sTitle, sURL, ""); 475 }catch (e){ 476 alert("¼ÓÈëÊÕ²ØÊ§°Ü£¬ÇëʹÓÃCtrl+D½øÐÐÌí¼Ó"); 477 } 478 } 479} 480 481// ÉèΪÊ×Ò³ 482function SetHome(obj,vrl){ 483 try{ 484 obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl); 485 }catch(e){ 486 if(window.netscape) { 487 try { 488 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 489 }catch (e){ 490 alert("´Ë²Ù×÷±»ä¯ÀÀÆ÷¾Ü¾ø£¡\nÇëÔÚä¯ÀÀÆ÷µØÖ·À¸ÊäÈë¡°about:config¡±²¢»Ø³µ\nÈ»ºó½« [signed.applets.codebase_principal_support]µÄÖµÉèÖÃΪ'true',Ë«»÷¼´¿É¡£"); 491 } 492 var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); 493 prefs.setCharPref('browser.startup.homepage',vrl); 494 }else{ 495 alert("ÄúµÄä¯ÀÀÆ÷²»Ö§³Ö£¬Çë°´ÕÕÏÂÃæ²½Öè²Ù×÷£º1.´ò¿ªä¯ÀÀÆ÷ÉèÖá£2.µã»÷ÉèÖÃÍøÒ³¡£3.ÊäÈ룺"+ vrl +"µã»÷È·¶¨¡£"); 496 } 497 } 498} 499 500// ÉèÖÃRSSÍøÖ· 501function SetRssUrl(){ 502 $id('rssValue').value=$id('rssUrl').value +"?typeStr="+ $id('rssTypeStr').value +"&maxNum="+ $id('rssMaxNum').value; 503} 504 505// QQ¿Í·þÖ´ÐÐ 506function qqServerStart(){ 507 try { 508 var destDiv = $("#qqServerBox"); 509 destDiv.css('display', ''); 510 var startPos = destDiv.position().top; 511 var divHeight = destDiv.outerHeight(); 512 513 $(window).scroll(function (){ 514 scrTop = $(window).scrollTop(); 515 if( startPos < scrTop){ 516 topPos = startPos+(scrTop - startPos)+50; 517 $("#qqServerBox").css("position", "absolute").css("top", topPos +"px").css('zIndex', '500'); 518 } 519 }); 520 }catch (e) {} 521} 522 523// QQ¿Í·þÉìËõµã»÷ 524function qqServerClick(){ 525 if( $(".qqServer-open").css("display") == "none" ){ 526 $(".qqServer-open").css("display",""); 527 $(".qqServer-close").css("display","none"); 528 }else{ 529 $(".qqServer-open").css("display","none"); 530 $(".qqServer-close").css("display",""); 531 } 532} 533 534// ҳͷËÑË÷¿òÏÔʾĬÈÏÖµ 535function RefFormWord(){ 536 if ($id('refContent').value == ''){ 537 $id('refContent').value = refContentDef; 538 $id('refContent').style.color = '#a59ea3'; 539 } 540} 541 542// ҳͷËÑË÷¿ò²»ÏÔʾĬÈÏÖµ 543function RefFormNoWord(){ 544 if ($id('refContent').value == refContentDef){ 545 $id('refContent').value = ''; 546 $id('refContent').style.color = '#000000'; 547 } 548} 549 550// ҳͷËÑË÷±íµ¥¼ì²â 551function CheckRefForm(){ 552 refContStr = $id("refContent").value; 553 if (refContStr == '' || refContStr == refContentDef){ 554 alert("ÇëÊäÈëÒªËÑË÷µÄ¹Ø¼ü×Ö"); 555 //$id("refContent").value='';$id("refContent").focus(); 556 return false; 557 } 558 switch ($id("refMode").value){ 559 case "theme": case "content": case "source": case "writer": 560 // $.ajaxSetup({cache:false}); 561 // $.get(webPathPart +"read.asp?mudi=getUrlencode&str="+ escape(refContStr), function(result){ 562 result = escape(refContStr); 563 // if (SYS_newsListUrlMode=="static-3.x"){ 564 // document.location.href=jsPathPart + SYS_newsListFileName +"/list_refer-"+ $id("refMode").value +"-"+ result +".html"; 565 // }else 566 if (SYS_newsListUrlMode=="dyn-2.x" || SYS_newsListUrlMode=="html-2.x" || SYS_newsListUrlMode=="static-3.x"){ 567 if (typeof(SYS_htmlUrlSel)=="undefined"){ SYS_htmlUrlSel=""; } 568 if (SYS_htmlUrlSel!="1"){ SYS_newsListFileName="news"; } 569 document.location.href=jsPathPart +"news/?list_refer-"+ $id("refMode").value +"-"+ result +".html"; 570 }else{ 571 document.location.href=jsPathPart +"newsList.asp?typeStr=refer&refType="+ $id("refMode").value +"&refContent="+ result; 572 } 573 // }); 574 return false; 575 break; 576 577 case "baidu": 578 bdzhannei_domain = ""; 579 bdzhannei_id = ""; 580 try { 581 bdzhannei_domain = $id('zhannei_domain').value; 582 bdzhannei_id = $id('zhannei_id').value; 583 }catch (e) {} 584 if (bdzhannei_domain==""){ bdzhannei_domain="zhannei.baidu.com"; } 585 $id("referForm").action="http://"+ bdzhannei_domain +"/cse/search?s="+ bdzhannei_id +"&entry=1&q="+ refContStr; 586 $id("referForm").method="post"; 587 $id("referForm").target="_blank"; 588 return true; 589 break; 590 591 default: 592 return false; 593 break; 594 } 595} 596 597// È«¾ÖÖ´ÐÐÄÚÈÝ 598function WinLoadRun(str){
599 if (typeof(SYS_isClose)=="undefined"){ SYS_isClose=20; } 600 if (SYS_isClose==20){ // ÍøÕ¾¿ªÆô 601 602 }else if (SYS_isClose==10){ // ÍøÕ¾¹Ø±Õ 603 document.write(""+ 604 "<!DOCTYPE html>"+ 605 "<html>"+ 606 "<head>"+ 607 "<title>ÍøÕ¾ÔÝʱ¹Ø±ÕÖÐ...</title>"+ 608 "</head>"+ 609 "<body>"+ 610 "<table align='center' cellpadding='0' cellspacing='0'><tr><td align='left' style='font-size:14px;'>"+ SYS_closeNote +"</td></tr></table>"+ 611 "</body>"+ 612 "</html>"); 613 } 614 615 if (US_isUserSys==1 && US_isLogin==1){ TopUser(); } 616 if (isTopTime!=""){ TopTime(); } 617 if (isTopFestival=="true"){ TopFestival(); } 618 if (isTopWeather!=""){ Weather114la(isTopWeather); } 619 620 if (typeof(SYS_isAppWap) == "undefined"){ SYS_isAppWap = 0; } 621 if (typeof(SYS_appWapUrl) == "undefined"){ SYS_appWapUrl = ""; } 622 try { 623 // ³õʼ»¯ËÑË÷¿ò 624 RefFormWord(); 625 $('#refContent').blur(function (){ 626 RefFormWord(); 627 }); 628 $('#refContent').click(function (){ 629 RefFormNoWord(); 630 }); 631 632 if (SYS_isAppWap==1 && SYS_appWapUrl.length>0){ 633 LoadJsFile("qrcodeFile",webPathPart +"js/inc/qrcode.min.js",0); 634 $('#topWapBtn').mouseover(function (){ 635 // <img src='http://qr.liantu.com/api.php?text="+ SYS_appWapUrl +"&logo=&w=150&m=8'/> 636 $id('wapQrBox').innerHTML=""+ 637 "<div style='position:absolute;border:1px #000 solid;background:#ffffff;'>"+ 638 "<div id='wapQrImg' style='padding:10px 10px 3px 10px;'></div>"+ 639 "<div style='text-align:center;color:red;font-weight:bold;'>ʹÓÃÊÖ»úɨÃè·ÃÎÊ</div>"+ 640 "</div>"+ 641 ""; 642 var qrcode = new QRCode(document.getElementById("wapQrImg"), { width:135, height:135 }); 643 qrcode.makeCode(SYS_appWapUrl); 644 $id('wapQrBox').style.display=""; 645 }); 646 $('#topWapBtn').mouseout(function (){ 647 $id('wapQrBox').style.display="none"; 648 }); 649 } 650 }catch (e) {} 651 652 // µ¥¶ÀÒ³»áÔ±ÏµÍ³Ò³Ãæ 653 if (webTypeName=="usersWeb"){ 654 if (typeof(webHref)=="undefined"){ webHref=""; } 655 if (typeof(webMudi)=="undefined"){ webMudi=""; } 656 if (typeof(webBackUrl)=="undefined"){ webBackUrl=""; } 657 if (webHref!="" && webMudi!=""){ 658 setTimeout("CheckJsPopup(); CheckJsUsers(); CheckJsNicEdit(); PopupUserWeb('"+ webHref +"&backUrl="+ webBackUrl +"','"+ webMudi +"');",500); 659 } 660 661 // ¿ì½ÝµÇÂ¼Ò³Ãæ 662 }else if (webTypeName=="api"){ 663 CheckJsUsers(); 664 // setTimeout("CheckUserName(document.getElementById('username').value);",500); 665 666 } 667 668 // Ö©ÖëÅÀÐÐ 669 /* if (typeof(SYS_isRobot)=="undefined"){ SYS_isRobot=0; } 670 if (SYS_isRobot==1){ 671 LoadJsFile("zhizhu",webPathPart +"robot.asp?webUrl="+ document.location.href +"",0); 672 } */ 673 674 675 // ÊÇ·ñ¸üР676 if (typeof(todayDate)=="undefined"){ todayDate=""; } 677 if (typeof(lastDate)=="undefined"){ lastDate=""; } 678 if (todayDate!=lastDate){ 679 AjaxGetDeal(webPathPart +"configDeal.asp?rnd="+ todayDate); 680 } 681 682 // ¼ÓÔØÃɲ㴰¿Ú 683 try { 684 CheckJsPopup(); 685 }catch (e) {} 686 687 // ÊÇ·ñ¼ÓÔØ»áÔ±JSÎļþ 688 try { 689 if (US_isUserSys==1){ 690 CheckJsUsers(); 691 } 692 }catch (e) {} 693 694 if (typeof(SYS_isFloatAd)=="undefined"){ SYS_isFloatAd=0; } 695 if (SYS_isFloatAd==1){ 696 // ¶Ôclass=floatWinµÄÔªËØ½øÐÐÖÇÄܸ¡¶¯¶¨Î» 697 $.fn.smartFloat = function() { 698 var position = function(element) { 699 var top = element.position().top, pos = element.css("position"); 700 var fWinTop = parseInt($("#floatWinTop").val()); 701 if (isNaN(fWinTop)){ fWinTop=0; } 702 $(window).scroll(function() { 703 var scrolls = $(this).scrollTop(); 704 if (scrolls > top) { 705 if (window.XMLHttpRequest) { 706 element.css({ 707 position: "fixed", 708 top: fWinTop 709 }); 710 } else { 711 element.css({ 712 top: scrolls+fWinTop 713 }); 714 } 715 }else { 716 element.css({ 717 position: pos, 718 top: top+fWinTop 719 }); 720 } 721 }); 722 }; 723 return $(this).each(function() { 724 position($(this)); 725 }); 726 }; 727 //°ó¶¨ 728 $(".floatWin").smartFloat(); 729 } 730 731} 732 733// µ×²¿JSÊä³ö 734function JsWriteBottom(){ 735 // QQ¿Í·þ 736 if (typeof(SYS_isQqServer)=="undefined"){ SYS_isQqServer=0; } 737 if (SYS_isQqServer>10){ qqSerState1Str="";qqSerState2Str="none"; }else{ qqSerState1Str="none";qqSerState2Str=""; } 738 if (SYS_isQqServer>0){ 739 if (typeof(SYS_qqServerCode)=="undefined"){ SYS_qqServerCode=""; } 740 document.write(""+ 741 "<div id=\"qqServerBox\" class=\"qqServerStyle"+ (SYS_isQqServer>10 ? SYS_isQqServer-10 : SYS_isQqServer) +"\" style=\"display:none;\">"+ 742 "<div class=\"qqServer-open\" style=\"display:"+ qqSerState1Str +";\">"+
743 " <div class=\"qqServerBg\">"+ 744 " <div class=\"qqServerTop\">"+ 745 " <div class=\"qqServer-button\" onclick='qqServerClick();'></div>"+ 746 " <div class=\"qqServerContent\">"+ SYS_qqServerCode +"</div><div class=\"clear\"></div>"+ 747 " </div>"+ 748 " </div>"+ 749 " <div class=\"qqServerBottom\"></div>"+ 750 "</div>"+ 751 "<div class=\"qqServer-close pointer\" style=\"display:"+ qqSerState2Str +";\" onclick='qqServerClick();'>"+ 752 "</div>"+ 753 "</div>"); 754 qqServerStart(); 755 } 756 757} 758 759 760 761// ͨÓÃAjaxÌá½»±íµ¥ 762function CheckAjaxForm(formName){ 763 AjaxPostDeal(formName); 764 return false; 765} 766 767// Ajaxµ¼º½Á´½Ó 768function AjaxNavHref(){ 769 var outputID = arguments[0] ? arguments[0] : ""; 770 var urlStr = arguments[1] ? arguments[1] : ""; 771 var pageNum = arguments[2] ? arguments[2] : ""; 772 773 if (outputID==""){ outputID="dialogBody"; } 774 if (urlStr==""){ urlStr=document.location.href; } 775 if (! isNaN(parseInt(pageNum))){ pageNum="&page="+ pageNum; }else{ pageNum=""; } 776 777 document.getElementById(outputID).innerHTML="<br /><br /><center style='font-size:14px;'><img src='"+ webPathPart +"inc_img/onload.gif' style='margin-right:5px;' />Êý¾Ý¼ÓÔØÖÐ...</center><br /><br />"; 778 $.ajaxSetup({cache:false}); 779 $.get(webPathPart + urlStr + pageNum, function(result){ 780 document.getElementById(outputID).innerHTML=result; 781 try { 782 backNavBtn = document.getElementById("backAjaxNavHeader").href; 783 if (backNavBtn.indexOf ("#")!=-1){ 784 webCurrUrl = document.location.href; 785 if (webCurrUrl.indexOf ("#")>-1){ 786 webCurrUrl=webCurrUrl.substring(0,webCurrUrl.lastIndexOf("#")); 787 } 788 webCurrUrl=webCurrUrl +"#"+ backNavBtn.substring(backNavBtn.lastIndexOf("#")+1,backNavBtn.length); 789// alert(webCurrUrl); 790 document.getElementById("backAjaxNavHeader").href = webCurrUrl; 791 setTimeout("document.getElementById('backAjaxNavHeader').click();",300); 792 } 793 }catch (e) {} 794 }); 795 796} 797 798// ·ÖÒ³Á´½Ó 799function ListPageHref(pageNum,mode1Url){ 800 if (pageNum<2){ 801 pageUrl = mode1Url.replace("_[page]","").replace("[page]",pageNum); 802 if (pageUrl.substr(pageUrl.length-10)=="index.html"){ pageUrl = pageUrl.substr(0,pageUrl.length-10); } 803 document.location.href=pageUrl; 804 }else{ 805 document.location.href=mode1Url.replace("[page]",pageNum); 806 } 807} 808 809 810ajaxDealStr = "Êý¾Ý´¦ÀíÖÐ..."; 811ajaxLoadStr = "Êý¾Ý¶ÁÈ¡ÖÐ..."; 812 813// POST±íµ¥AJAX´¦Àí 814function AjaxPostDeal(formName){ 815 try { 816 document.getElementById("loadingStr").innerHTML = "<span style='font-size:14px;'><img src='"+ webPathPart +"inc_img/onload.gif' style='margin-right:5px;' />"+ ajaxDealStr +"</span>"; 817 }catch (e) {} 818 819 formNameObj = document.getElementById(formName); 820 var formNameUrl = formNameObj.getAttribute("action"), formNameContent = formValueToStr(formNameObj); 821 $.post(formNameUrl,formNameContent,function(result){ 822 try { 823 document.getElementById("loadingStr").innerHTML = ""; 824 }catch (e) {} 825 // alert('['+ result.replace(/<.*?(script[^>]*?)>/gi,"").replace(/<\/.*?script.*?>/gi,"").replace(/(<meta[^>]*>|<\/meta>)/gi,"") +']'); 826 eval(result.replace(/<.*?(script[^>]*?)>/gi,"").replace(/<\/.*?script.*?>/gi,"").replace(/(<meta[^>]*>|<\/meta>)/gi,"")); 827 try { 828 document.getElementById("loadingStr").innerHTML = ""; 829 }catch (e) {} 830 }); 831 return false; 832} 833 834// ͨ¹ý±íµ¥name»ñÈ¡¸Ã±íµ¥ËùÓÐÔªËØ²¢×é³ÉGET×Ö·û´® 835function formValueToStr(formObj) { 836 var qstr = "", and = "", elem, value; 837 for(var i = 0; i< formObj.length; ++i) { 838 elem = formObj[i]; 839 if (elem.name!='') { 840 value=undefined; 841 switch(elem.type) { 842 case "select-one": 843 if(elem.selectedIndex > -1) { 844 value = elem.options[elem.selectedIndex].value; 845 } 846 else { 847 value = ""; 848 } 849 break; 850 case"select-multiple": 851 var selMul=elem.options; 852 for(var w=0;w<selMul.length;++w){ 853 if(selMul[w].selected){ 854 qstr += and+elem.name+"="+escape(selMul[w].value); 855 and = "&"; 856 } 857 } 858 break; 859 case "checkbox": 860 case "radio": 861 if (elem.checked == true) { 862 value = elem.value; 863 } 864 break; 865 default: 866 value = elem.value; 867 } 868 if(value!=undefined){ 869 value = escape(value); 870 qstr += and + elem.name + "=" + value; 871 and = "&"; 872 } 873 } 874 } 875 return qstr; 876} 877 878// GETÌá½»AJAX´¦Àí 879function AjaxGetDeal(urlStr){ 880 $.ajaxSetup({cache:false}); 881 $.get(urlStr, function(result){ 882 eval(result.replace(/<.*?(script[^>]*?)>/gi,"").replace(/<\/.*?script.*?>/gi,"").replace(/(<meta[^>]*>|<\/meta>)/gi,"")); 883 }); 884 return false; 885} 886 887// GETÌá½»AJAX´¦Àí 888function AjaxGetDealToAlert(urlStr){ 889 $.ajaxSetup({cache:false}); 890 $.get(urlStr, function(result){ 891 alert(result.replace(/<.*?(script[^>]*?)>/gi,"").replace(/<\/.*?script.*?>/gi,"")); 892 }); 893 return false; 894} 895
896// GETÌá½»AJAX´¦Àí·µ»ØÖµµ½input±êÇ©Àï 897function AjaxGetDealToInput(urlStr, outputID, dealMode){ 898 $.ajaxSetup({cache:false}); 899 $.get(urlStr, function(result){ 900 if (dealMode == 'base64'){ result = base64decode(result); } 901 document.getElementById(outputID).value = result; 902 try{ 903 WindowHeight(0); 904 }catch (e){} 905 }); 906 return false; 907} 908 909// GETÌá½»AJAX´¦Àí·µ»ØÖµµ½id±êǩϠ910function AjaxGetDealToId(urlStr,outputID){ 911 $.ajaxSetup({cache:false}); 912 $.get(urlStr, function(result){ 913 document.getElementById(outputID).innerHTML = result; 914 }); 915 916 return false; 917} 918 919// GETÌá½»AJAX´¦Àí 920function AjaxGetDealToIdNo(urlStr,outputID,badWords){ 921 $.ajaxSetup({cache:false}); 922 $.get(urlStr, function(result){ 923 if (result.lastIndexOf(badWords)!=-1){ 924 eval(result.replace(/<.*?(script[^>]*?)>/gi,"").replace(/<\/.*?script.*?>/gi,"").replace(/(<meta[^>]*>|<\/meta>)/gi,"")); 925 }else{ 926 document.getElementById(outputID).innerHTML = result; 927 } 928 }); 929 return false; 930} 931 932// GETÌá½»AJAX´¦Àí£¨ÔÊÐíÖ´ÐÐJS£© 933function AjaxGetDealToIdJs2(urlStr,outputID){ 934 $.ajaxSetup({cache:false}); 935 $.get(urlStr, function(result){ 936 document.getElementById(outputID).innerHTML = result; 937//<script src="../tools/fckeditor/flvPlayer/swfobject.js" type="text/javascript"></script> 938 var jsFileStr=""; 939 var jsFileArr=result.match(/src\s*=\s*[\""|\']?\s*[^>\""\'\s]*\.js/gi); 940 if(jsFileArr!=null){ 941 for(var i=0;i<jsFileArr.length;i++){
942 //jsFileStr += jsFileArr[i].replace(/src\s*=\s*[\""|\']?(\s*[^>\""\'\s]*\.js)/gi,"$1"); 943 LoadJsFile("contJsFile"+ i,jsFileArr[i].replace(/src\s*=\s*[\""|\']?(\s*[^>\""\'\s]*\.js)/gi,"$1"),0); 944 } 945 } 946 //alert(jsFileStr); 947 948 var jsStr=""; 949 var jsArr=result.match(/<\s*(script[^>]*)>([\s\S][^<]*)<\/\s*script>/gi); 950 if(jsArr!=null){ 951 for(var i=0;i<jsArr.length;i++){ 952 jsStr += jsArr[i]; 953 } 954 } 955 jsStr = jsStr.replace(/<.*?(script[^>]*?)>/gi,"").replace(/<\/.*?script.*?>/gi,""); 956 window.setTimeout(jsStr,1000); 957 958 try { 959 VoteStyle(); 960 }catch (e) {} 961 }); 962 963 return false; 964} 965 966// GETÌá½»AJAX´¦Àí£¨ÔÊÐíÖ´ÐÐJS£© 967function AjaxGetDealToIdJs(urlStr,outputID){ 968 $.ajaxSetup({cache:false}); 969 $.get(urlStr, function(result){ 970 set_innerHTML(outputID,result); 971 try { 972 VoteStyle(); 973 }catch (e) {} 974 }); 975 976 return false; 977} 978 979 980 981/* innerhtml.js 982 * Copyright Ma Bingyao <[email protected]> 983 * Version: 1.9 984 * LastModified: 2006-06-04 985 * This library is free. You can redistribute it and/or modify it. 986 */ 987 988var global_html_pool = []; 989var global_script_pool = []; 990var global_script_src_pool = []; 991var global_lock_pool = []; 992var innerhtml_lock = null; 993var document_buffer = ""; 994 995// jsÊä³öÔÊÐíÖ´ÐÐjs½Å±¾£¬obj_id£ºinnerHTMLµÄID£»html£ºÊä³ö×Ö·û´®£»time£ºÑÓʱ¶àÉÙÃëÖ´ÐУ¬¿ÉÒÔºöÂÔ 996function set_innerHTML(obj_id, html, time){ 997 if (innerhtml_lock == null) { 998 innerhtml_lock = obj_id; 999 } 1000 else if (typeof(time) == "undefined") { 1001 global_lock_pool[obj_id + "_html"] = html; 1002 window.setTimeout("set_innerHTML('" + obj_id + "', global_lock_pool['" + obj_id + "_html']);", 10); 1003 return; 1004 } 1005 else if (innerhtml_lock != obj_id) { 1006 global_lock_pool[obj_id + "_html"] = html; 1007 window.setTimeout("set_innerHTML('" + obj_id + "', global_lock_pool['" + obj_id + "_html'], " + time + ");", 10); 1008 return; 1009 } 1010 1011 function get_script_id() { 1012 return "script_" + (new Date()).getTime().toString(36) + Math.floor(Math.random() * 100000000).toString(36); 1013 } 1014 1015 document_buffer = ""; 1016 1017 document.write = function (str) { 1018 document_buffer += str; 1019 } 1020 document.writeln = function (str) { 1021 document_buffer += str + "\n"; 1022 } 1023 1024 global_html_pool = []; 1025 1026 var scripts = []; 1027 html = html.split(/<\/script>/i); 1028 for (var i = 0; i < html.length; i++) { 1029 global_html_pool[i] = html[i].replace(/<script[\s\S]*$/ig, ""); 1030 scripts[i] = {text: '', src: '' }; 1031 scripts[i].text = html[i].substr(global_html_pool[i].length); 1032 scripts[i].src = scripts[i].text.substr(0, scripts[i].text.indexOf('>') + 1); 1033 scripts[i].src = scripts[i].src.match(/src\s*=\s*(\"([^\"]*)\"|\'([^\']*)\'|([^\s]*)[\s>])/i); 1034 if (scripts[i].src) { 1035 if (scripts[i].src[2]) { 1036 scripts[i].src = scripts[i].src[2]; 1037 } 1038 else if (scripts[i].src[3]) { 1039 scripts[i].src = scripts[i].src[3]; 1040 } 1041 else if (scripts[i].src[4]) { 1042 scripts[i].src = scripts[i].src[4]; 1043 } 1044 else { 1045 scripts[i].src = ""; 1046 } 1047 scripts[i].text = ""; 1048 } 1049 else { 1050 scripts[i].src = ""; 1051 scripts[i].text = scripts[i].text.substr(scripts[i].text.indexOf('>') + 1); 1052 scripts[i].text = scripts[i].text.replace(/^\s*<\!--\s*/g, ""); 1053 } 1054 } 1055 1056 var s; 1057 if (typeof(time) == "undefined") { 1058 s = 0; 1059 } 1060 else { 1061 s = time; 1062 } 1063 1064 var script, add_script, remove_script; 1065 1066 for (var i = 0; i < scripts.length; i++) { 1067 var add_html = "document_buffer += global_html_pool[" + i + "];\n"; 1068 add_html += "document.getElementById('" + obj_id + "').innerHTML = document_buffer;\n"; 1069 script = document.createElement("script"); 1070 if (scripts[i].src) { 1071 script.src = scripts[i].src; 1072 if (typeof(global_script_src_pool[script.src]) == "undefined") { 1073 global_script_src_pool[script.src] = true; 1074 s += 2000; 1075 } 1076 else { 1077 s += 10; 1078 } 1079 } 1080 else { 1081 script.text = scripts[i].text; 1082 s += 10; 1083 } 1084 script.defer = true; 1085 script.type = "text/javascript"; 1086 script.id = get_script_id(); 1087 global_script_pool[script.id] = script; 1088 add_script = add_html; 1089 add_script += "document.getElementsByTagName('head').item(0)"; 1090 add_script += ".appendChild(global_script_pool['" + script.id + "']);\n"; 1091 window.setTimeout(add_script, s); 1092 remove_script = "document.getElementsByTagName('head').item(0)"; 1093 remove_script += ".removeChild(document.getElementById('" + script.id + "'));\n"; 1094 remove_script += "delete global_script_pool['" + script.id + "'];\n"; 1095 window.setTimeout(remove_script, s + 10000); 1096 } 1097 1098 var end_script = "if (document_buffer.match(/<\\/script>/i)) {\n"; 1099 end_script += "set_innerHTML('" + obj_id + "', document_buffer, " + s + ");\n"; 1100 end_script += "}\n"; 1101 end_script += "else {\n"; 1102 end_script += "document.getElementById('" + obj_id + "').innerHTML = document_buffer;\n"; 1103 end_script += "innerhtml_lock = null;\n"; 1104 end_script += "}"; 1105 window.setTimeout(end_script, s); 1106} 1107 1108/* JS°æbase64±à½âÂëËã·¨¡£Ê¾Àý:
1109 * b64 = base64encode(data); 1110 * data = base64decode(b64); 1111 */ 1112var base64EncodeChars = [ 1113 "A", "B", "C", "D", "E", "F", "G", "H", 1114 "I", "J", "K", "L", "M", "N", "O", "P", 1115 "Q", "R", "S", "T", "U", "V", "W", "X", 1116 "Y", "Z", "a", "b", "c", "d", "e", "f", 1117 "g", "h", "i", "j", "k", "l", "m", "n", 1118 "o", "p", "q", "r", "s", "t", "u", "v", 1119 "w", "x", "y", "z", "0", "1", "2", "3", 1120 "4", "5", "6", "7", "8", "9", "+", "/" 1121]; 1122 1123var base64DecodeChars = [ 1124 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1125 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1126 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 1127 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, 1128 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1129 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, 1130 -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 1131 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 1132]; 1133 1134function base64encode(str) { 1135 var out, i, j, len; 1136 var c1, c2, c3; 1137 1138 len = str.length; 1139 i = j = 0; 1140 out = []; 1141 while (i < len) { 1142 c1 = str.charCodeAt(i++) & 0xff; 1143 if (i == len) 1144 { 1145 out[j++] = base64EncodeChars[c1 >> 2]; 1146 out[j++] = base64EncodeChars[(c1 & 0x3) << 4]; 1147 out[j++] = "=="; 1148 break; 1149 } 1150 c2 = str.charCodeAt(i++) & 0xff; 1151 if (i == len) 1152 { 1153 out[j++] = base64EncodeChars[c1 >> 2]; 1154 out[j++] = base64EncodeChars[((c1 & 0x03) << 4) | ((c2 & 0xf0) >> 4)]; 1155 out[j++] = base64EncodeChars[(c2 & 0x0f) << 2]; 1156 out[j++] = "="; 1157 break; 1158 } 1159 c3 = str.charCodeAt(i++) & 0xff; 1160 out[j++] = base64EncodeChars[c1 >> 2]; 1161 out[j++] = base64EncodeChars[((c1 & 0x03) << 4) | ((c2 & 0xf0) >> 4)]; 1162 out[j++] = base64EncodeChars[((c2 & 0x0f) << 2) | ((c3 & 0xc0) >> 6)]; 1163 out[j++] = base64EncodeChars[c3 & 0x3f]; 1164 } 1165 return out.join(''); 1166} 1167 1168function base64decode(str) { 1169 var c1, c2, c3, c4; 1170 var i, j, len, out; 1171 1172 len = str.length; 1173 i = j = 0; 1174 out = []; 1175 while (i < len) { 1176 /* c1 */ 1177 do { 1178 c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff]; 1179 } while (i < len && c1 == -1); 1180 if (c1 == -1) break; 1181 1182 /* c2 */ 1183 do { 1184 c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff]; 1185 } while (i < len && c2 == -1); 1186 if (c2 == -1) break; 1187 1188 out[j++] = String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4)); 1189 1190 /* c3 */ 1191 do { 1192 c3 = str.charCodeAt(i++) & 0xff; 1193 if (c3 == 61) return out.join(''); 1194 c3 = base64DecodeChars[c3]; 1195 } while (i < len && c3 == -1); 1196 if (c3 == -1) break; 1197 1198 out[j++] = String.fromCharCode(((c2 & 0x0f) << 4) | ((c3 & 0x3c) >> 2)); 1199 1200 /* c4 */ 1201 do { 1202 c4 = str.charCodeAt(i++) & 0xff; 1203 if (c4 == 61) return out.join(''); 1204 c4 = base64DecodeChars[c4]; 1205 } while (i < len && c4 == -1); 1206 if (c4 == -1) break; 1207 out[j++] = String.fromCharCode(((c3 & 0x03) << 6) | c4); 1208 } 1209 return out.join(''); 1210} 1211 1212 1213 1214 1215 1216 1217 1218 1219/* ¡¾¡¾¡¾¡¾popup.js¡¿¡¿¡¿¡¿ */ 1220// ´ò¿ªÃɲ㴰¿Ú 1221function OpenPopup(){ 1222 CheckJsPopup(); 1223 CheckJsUsers(); 1224 try { 1225 document.getElementById("dialogBody").innerHTML = "<br /><br /><br /><br /><br /><br /><center style='font-size:14px;'><img src='"+ webPathPart +"inc_img/onload.gif' style='margin-right:5px;' />"+ lang["ajaxLoadStr"] +"</center><br /><br /><br /><br /><br /><br /><br />"; 1226 CheckShadow(); 1227 }catch (e) {} 1228 1229 var str = arguments[0] ? arguments[0] : ""; 1230 var otherStr = arguments[1] ? arguments[1] : ""; 1231 var otherStr2 = arguments[2] ? arguments[2] : ""; 1232 1233 if (otherStr==undefined){ otherStr=""; } 1234 1235 userWebUrl = ''; 1236 if (US_isWeb==1 && document.location.href.indexOf('usersWeb.asp')==-1){ 1237 if (str=='reg' || str=='login' || str=='missPwd' || str=='userCenter' || str=='revInfo' || str=='addNews' || str=='revNews' || str=='newsManage' || str=='apiManage'){ 1238 userWebUrl = jsPathPart +"usersWeb.asp?mudi="+ str +"&backUrl="+ escape(document.location.href); 1239 document.location.href=userWebUrl; 1240// var a=window.open(userWebUrl); 1241 return false; 1242 } 1243 } 1244 1245 switch (str){ 1246 case "reg": 1247 waitSec = 0; 1248 popTitle = "»áÔ±×¢²á"; 1249 popWidth = 650; 1250 popHeight = 260; 1251 popHref = webPathPart +"users.asp?mudi=reg&webPathPart="+ WppSign(webPathPart) + otherStr; 1252 break; 1253 1254 case "login": 1255 popTitle = "»áÔ±µÇ¼"; 1256 popWidth = 400; 1257 popHeight = 160; 1258 popHref = webPathPart +"users.asp?mudi=login&webPathPart="+ WppSign(webPathPart) + otherStr; 1259 break; 1260 1261 case "missPwd": 1262 popTitle = "Íü¼ÇÃÜÂë"; 1263 popWidth = 400; 1264 popHeight = 160; 1265 popHref = webPathPart +"users.asp?mudi=missPwd&webPathPart="+ WppSign(webPathPart) + otherStr; 1266 break; 1267 1268 case "userCenter": 1269 popTitle = "»áÔ±ÖÐÐÄ"; 1270 popWidth = 850; 1271 popHeight = 400; 1272 popHref = webPathPart +"usersCenter.asp?mudi=&webPathPart="+ WppSign(webPathPart) + otherStr; 1273 break; 1274 1275 case "revInfo": 1276 popTitle = "ÐÞ¸ÄÐÅÏ¢"; 1277 popWidth = 850; 1278 popHeight = 400; 1279 popHref = webPathPart +"usersCenter.asp?mudi=revInfo&webPathPart="+ WppSign(webPathPart) + otherStr; 1280 break; 1281 1282 case "addNews": 1283 CheckJsNicEdit(); 1284 wNewsWaitTime = 0; 1285 popTitle = "·¢±íÎÄÕÂ"; 1286 popWidth = 850; 1287 popHeight = 500; 1288 popHref = webPathPart +"usersCenter.asp?mudi=addNews&webPathPart="+ WppSign(webPathPart) + otherStr; 1289 break; 1290 1291 case "revNews": 1292 CheckJsNicEdit(); 1293 wNewsWaitTime = 0; 1294 popTitle = "ÐÞ¸ÄÎÄÕÂ"; 1295 popWidth = 850; 1296 popHeight = 500; 1297 popHref = webPathPart +"usersCenter.asp?mudi=revNews&webPathPart="+ WppSign(webPathPart) + otherStr; 1298 break; 1299 1300 case "newsManage": 1301 popTitle = "ÎÄÕ¹ÜÀí"; 1302 popWidth = 850; 1303 popHeight = 400; 1304 popHref = webPathPart +"usersCenter.asp?mudi=newsManage&webPathPart="+ WppSign(webPathPart) + otherStr; 1305 break; 1306 1307 case "apiManage": 1308 popTitle = "Õ˺Űó¶¨"; 1309 popWidth = 850; 1310 popHeight = 400; 1311 popHref = webPathPart +"usersCenter.asp?mudi=apiManage&webPathPart="+ WppSign(webPathPart) + otherStr; 1312 break; 1313 1314 case "rss": 1315 popTitle = "RSS¶©ÔÄ"; 1316 popWidth = 550; 1317 popHeight = 240; 1318 popHref = webPathPart +"rss.asp?mudi=web&webPathPart="+ WppSign(webPathPart) + otherStr; 1319 break; 1320 1321 default: 1322 try {
1323 var pop=new Popup({ contentType:2,isReloadOnClose:false}); 1324 pop.close(); 1325 }catch (e) {} 1326 return false; 1327 break; 1328 } 1329 1330 if (document.location.href.indexOf('usersWeb.asp')!=-1){ 1331 if (popWidth==850){ popWidth=940; } 1332 try { 1333 $id('areaName').innerHTML = popTitle; 1334 }catch (e) {} 1335 try { 1336 $id('dialogBody').style.width= popWidth +'px'; 1337 }catch (e) {} 1338 PopupUserWeb(popHref,str); 1339 return false; 1340 } 1341 $.ajaxSetup({cache:false}); 1342 $.get(popHref, function(result){ 1343 var pop=new Popup({ contentType:2,isReloadOnClose:false,width:popWidth,height:popHeight}); 1344 pop.setContent("contentHtml",result); 1345 pop.setContent("title",popTitle); 1346 pop.build(); 1347 pop.show(); 1348// document.getElementById("dialogBody").innerHTML = result; 1349 PopupEvent(str); 1350 }); 1351} 1352 1353// 1354function PopupUserWeb(urlStr,str){ 1355 $.ajaxSetup({cache:false}); 1356 $.get(urlStr, function(result){ 1357 document.getElementById('dialogBody').innerHTML = result; 1358 PopupEvent(str); 1359 }); 1360 return false; 1361} 1362 1363var editorObjTime; 1364// ¼ÓÔØPopupºó´¥·¢µÄʼþ 1365function PopupEvent(str){ 1366 if (str=="addNews" || str=="revNews"){ 1367// LoadEditor('content',500); 1368 editorObjTime = setTimeout("LoadEditor('content',500);",500); 1369 CheckAddition(); 1370 try { 1371 $("#img").mouseover(function() { 1372 1373 }).hover(function() { 1374 $('#imgView').css({"display":""}); 1375 $id('imgView').src=$id('infoFileDir').value + $id('img').value; 1376 }, function(){ 1377 $('#imgView').css({"display":"none"}); 1378 }); 1379 1380 }catch (e) {} 1381 1382 }else if (str=="revInfo"){ 1383 CheckRevInfoType(); 1384 1385 }else if (str=="login"){ 1386//setTimeout("$id('username').focus();",500); 1387 1388 }else if (str=="rss"){ 1389 SetRssUrl(); 1390 1391 } 1392} 1393 1394 1395var isJsPopup=false,isJsNicEdit=false,isJsUsers=false,isJsUsersCenter=false; 1396var ke4Editor = []; 1397 1398// popup¼ÓÔØ 1399function CheckJsPopup(){ 1400 if (isJsPopup==false){ 1401 LoadJsFile("popupJs",webPathPart +"tools/popup/popup.js",0); 1402 LoadCssFile("popupCss",webPathPart +"tools/popup/popup.css",0); 1403 LoadCssFile("popupStyleCss",webPathPart +"tools/popup/skin/"+ SYS_skinPopup +"/style.css",0); 1404 isJsPopup=true; 1405 } 1406} 1407 1408// »áÔ±JS¼ÓÔØ 1409function CheckJsUsers(){ 1410 if (isJsUsers==false){ 1411 LoadJsFile("usersJs",webPathPart +"js/users.js",0); 1412 LoadJsFile("usersCenterJs",webPathPart +"js/usersCenter.js",0); 1413 isJsUsers=true; 1414 } 1415} 1416 1417 1418 1419// ±à¼Æ÷¼ÓÔØ 1420function CheckJsNicEdit(){ 1421 if (isJsNicEdit==false){ 1422 LoadJsFile("kindeditorJs",webPathPart +"tools/kindeditor4/kindeditor-all-min.js",0); 1423 isJsNicEdit=true; 1424 } 1425} 1426 1427// ¼ÓÔØ±à¼Æ÷ 1428function LoadEditor(str,minSec) { 1429 CheckJsNicEdit(); 1430 setTimeout("InitEditor('"+ str +"');",minSec); 1431} 1432 1433function InitEditor(inputId){ 1434 /* if (modeStr.indexOf('|miniMenu|')!=-1){ 1435 itemsVal=[ 1436 'source', '|','cut', 'copy', 'paste', '|', 'justifyleft', 'justifycenter', 'justifyright', 1437 'fontname', 'fontsize', 'forecolor', '|', 'bold', 1438 'italic', 'underline', 'strikethrough', 'removeformat', '|', 'link', 'unlink', 'image' 1439 ]; 1440 }else{ */ 1441 // , '|', 'fullscreen', '|', 'about' 1442 itemsVal=[ 1443 'source', '|', 'undo', 'redo', '|', 'code', 'selectall','cut', 'copy', 'paste', 1444 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 1445 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 1446 'superscript', 'clearhtml', 'quickformat', '/', 1447 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 1448 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 1449 'flash', 'media', 'insertfile', 'table', 'hr', 'baidumap', 'anchor', 'link', 'unlink' 1450 ]; 1451 // } 1452 ke4Editor[inputId] = KindEditor.create("#"+ inputId,{ 1453 allowImageUpload : false, 1454 allowFlashUpload : false, 1455 allowMediaUpload : false, 1456 allowFileUpload : false, 1457 allowFileManager : false, 1458 afterBlur:function(){ this.sync(); }, 1459 minWidth : 650, 1460 minHeight : 220, 1461 newlineTag : 'p', 1462 items : itemsVal, 1463 designMode : true, 1464/* 1465 colorTable : [ 1466 ["#000000","#003300","#006600","#009900","#00cc00","#00ff00","#330000","#333300","#336600","#339900","#33cc00","#33ff00","#660000","#663300","#666600","#669900","#66cc00","#66ff00","#000000"], 1467 ["#000033","#003333","#006633","#009933","#00cc33","#00ff33","#330033","#333333","#336633","#339933","#33cc33","#33ff33","#660033","#663333","#666633","#669933","#66cc33","#66ff33","#333333"], 1468 ["#000066","#003366","#006666","#009966","#00cc66","#00ff66","#330066","#333366","#336666","#339966","#33cc66","#33ff66","#660066","#663366","#666666","#669966","#66cc66","#66ff66","#666666"], 1469 ["#000099","#003399","#006699","#009999","#00cc99","#00ff99","#330099","#333399","#336699","#339999","#33cc99","#33ff99","#660099","#663399","#666699","#669999","#66cc99","#66ff99","#999999"], 1470 ["#0000cc","#0033cc","#0066cc","#0099cc","#00cccc","#00ffcc","#3300cc","#3333cc","#3366cc","#3399cc","#33cccc","#33ffcc","#6600cc","#6633cc","#6666cc","#6699cc","#66cccc","#66ffcc","#cccccc"], 1471 ["#0000ff","#0033ff","#0066ff","#0099ff","#00ccff","#00ffff","#3300ff","#3333ff","#3366ff","#3399ff","#33ccff","#33ffff","#6600ff","#6633ff","#6666ff","#6699ff","#66ccff","#66ffff","#ffffff"], 1472 ["#990000","#993300","#996600","#999900","#99cc00","#99ff00","#cc0000","#cc3300","#cc6600","#cc9900","#cccc00","#ccff00","#ff0000","#ff3300","#ff6600","#ff9900","#ffcc00","#ffff00"], 1473 ["#990033","#993333","#996633","#999933","#99cc33","#99ff33","#cc0033","#cc3333","#cc6633","#cc9933","#cccc33","#ccff33","#ff0033","#ff3333","#ff6633","#ff9933","#ffcc33","#ffff33"], 1474 ["#990066","#993366","#996666","#999966","#99cc66","#99ff66","#cc0066","#cc3366","#cc6666","#cc9966","#cccc66","#ccff66","#ff0066","#ff3366","#ff6666","#ff9966","#ffcc66","#ffff66"], 1475 ["#990099","#993399","#996699","#999999","#99cc99","#99ff99","#cc0099","#cc3399","#cc6699","#cc9999","#cccc99","#ccff99","#ff0099","#ff3399","#ff6699","#ff9999","#ffcc99","#ffff99"], 1476 ["#9900cc","#9933cc","#9966cc","#9999cc","#99cccc","#99ffcc","#cc00cc","#cc33cc","#cc66cc","#cc99cc","#cccccc","#ccffcc","#ff00cc","#ff33cc","#ff66cc","#ff99cc","#ffcccc","#ffffcc"], 1477 ["#9900ff","#9933ff","#9966ff","#9999ff","#99ccff","#99ffff","#cc00ff","#cc33ff","#cc66ff","#cc99ff","#ccccff","#ccffff","#ff00ff","#ff33ff","#ff66ff","#ff99ff","#ffccff","#ffffff"] 1478 ], 1479*/ 1480 cssPath : [jsPathPart +'tools/kindeditor.css'] 1481 }); 1482 1483} 1484 1485// »ñÈ¡±à¼Æ÷ÖÐHTMLÄÚÈÝ 1486function GetEditorHTML(EditorName) { 1487 return ke4Editor[EditorName].html(); 1488} 1489 1490// »ñÈ¡±à¼Æ÷ÖÐÎÄ×ÖÄÚÈÝ 1491function GetEditorText(EditorName) { 1492 return ke4Editor[EditorName].text(); 1493} 1494 1495// ÉèÖÃ±à¼Æ÷ÖÐÄÚÈÝ
1496function SetEditorHtml(EditorName, ContentStr) { 1497 ke4Editor[EditorName].html(ContentStr); 1498} 1499 1500// ²åÈë×Ö·û´®µ½±à¼Æ÷ÖÐ 1501function InsertStrToEditor(EditorName, ContentStr) { 1502 ke4Editor[EditorName].insertHtml(ContentStr); 1503} 1504 1505// ͬ²½±à¼Æ÷Êý¾Ý 1506function SyncEditor(EditorName) { 1507 ke4Editor[EditorName].sync(); 1508} 1509 1510 1511// µ÷Óó©ÑÔ²å¼þÎļþ£¨·ÏÆú£© 1512function UseChangyanJs(cy_appid,cy_conf,appNum){ 1513 document.write('<scr'+'ipt type="text/javascript" charset="utf-8" src="h'+'tt'+'ps:'+'//changyan.sohu.com/upload/changyan.js"></scr'+'ipt>'); 1514 if (appNum != '0'){ 1515 // ʵÑéÊÒ²å¼þ 1516 document.write('<scr'+'ipt type="text/javascript" charset="utf-8" src="h'+'tt'+'ps:'+'//changyan.itc.cn/js/lib/jquery.js"></scr'+'ipt>'); 1517 document.write('<scr'+'ipt type="text/javascript" charset="utf-8" src="h'+'tt'+'ps:'+'//changyan.sohu.com/js/changyan.labs.https.js?appid='+ cy_appid +'"></scr'+'ipt>'); 1518 }/* */ 1519 1520 $(function (){ 1521 window._config = { showScore: true }; 1522 window.changyan.api.config({ 1523 appid: cy_appid, 1524 conf: cy_conf 1525 }); 1526 }); 1527 1528} 1529 1530 1531// ÃÜÂë¼ÓÃÜ 1532function EncPwdData(pwdName){ 1533 if ($id(pwdName).value == $id('pwdEnc').value){ return false; } 1534 $.ajaxSetup({cache:false, async:false}); 1535 $.get(webPathPart +"readDeal2.asp?mudi=encPwd&str="+ base64encode($id(pwdName).value) +"&exp=35", function(result){ 1536 var strArr = (result +'||||').split("|"); 1537 if (strArr[3].length > 3){ 1538 $id('pwdMode').value = strArr[1]; 1539 $id('pwdKey').value = strArr[2]; 1540 $id('pwdEnc').value = strArr[3]; 1541 $id(pwdName).value = strArr[3]; 1542 try{ 1543 $id(pwdName +'2').value = strArr[3]; 1544 }catch (e){ } 1545 } 1546 // alert($id('pwdMode').value +'|'+ $id('pwdKey').value +'|'+ $id(pwdName).value); 1547 }); 1548 1549} 1550 1551// »áÔ±Í˳ö 1552function UserExit(){ 1553 if (confirm('ÄúÈ·¶¨ÒªÍ˳ö£¿')==true){ 1554 AjaxGetDeal(webPathPart +'users_deal.asp?mudi=exit'); 1555 } 1556} 1557 1558// ÆÀÂÛ/ÁôÑÔ ²È¶¥+1 1559function UserVote(type, id, num){ 1560 AjaxGetDeal(webPathPart +'deal.asp?mudi=userVote&type='+ type +'&dataID='+ id +'&selItem='+ num); 1561}
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.