// GetQueryString ***********************
Var locstringinclustring({{doc ument. location. href );
Function GetQueryString (str ){
Var rs = new RegExp ("(^ |)" + str + "= ([^ \ &] *) (\ & | $ )", "gi" cmd.exe c (LocString), tmp;
If (tmp = rs) return tmp [2];
Return "";
}
// VScroll displays the title ************************
Function _ ge (a) {return document. getElementById? Document. getElementById (a): null ;}
Function VScroll (){
Var m_box = null;
Var m_lineHeight = 0;
Var m_lineNum = 0;
Var m_splitStr = '';
Var m_speed = 0;
Var m_delay = 0;
Var m_pos = 0;
Var m_stopTimes = 0;
Var m_stop = false;
Function checkState (stateurl, info, loadnews ){
If (xmlhttp. readyState = 4 ){
Document. getElementById (info). innerHTML = loadnews;
If (xmlhttp. status = 200 ){
Var retext = xmlhttp. responseText. split ("$ ");
Document. getElementById (info). innerHTML = retext [1];
Switch (retext [0]) {
Case "usreg": if (stateurl! = "") Location. href = stateurl;
Break;
Case "uslogin": if (stateurl! = "") Location. href = stateurl;
Break;
Case "active": location. href = retext [2];
Break;
Case "errinfo": return false;
Break;
Default: document. getElementById (info). innerHTML = retext [0];
}
}
}
Else {
Document. getElementById (info). innerHTML = loadnews;
}
}
// AJAX_END
// Run the code
Function runEx (cod1 ){
Cod = document. getElementById (cod1)
Var code = cod. value;
If (code! = ""){
Var newwin = window. open ('','','');
Newwin. opener = null
Newwin.doc ument. write (code );
Newwin.doc ument. close ();
}
}
//
Function doCopy2 (ID ){
If (document. all ){
TextRange = document. getElementById (ID). createTextRange ();
TextRange.exe cCommand ("Copy ");
Alert ('copied successfully ');
}
Else {
Alert ("this function is only valid on IE ")
}
}
//
Function doCopy (obj ){
Var rng = document. body. createTextRange ();
Rng. moveToElementText (obj );
Rng. scrollIntoView ();
Rng. select ();
Rng.exe cCommand ("Copy ");
Rng. collapse (false );
}
Function doCopyUrl ()
{
Document. getElementById ("CopyUrl"). value = parent. location. href;
Document. getElementById ("CopyUrl"). select ();
Document.exe cCommand ("copy ");
Alert ("the URL is successfully copied to the clipboard! ")
}
// Save another code
Function doSave (obj ){
Var winname = window. open ('', '_ blank', 'top = 10000 ');
Winname.doc ument. open ('text/html ', 'replace ');
Winname.doc ument. writeln (obj. value );
Winname.document.execcommand('saveas', '', 'code.htm ');
Winname. close ();
}
Function findobj (n, d ){
Var p, I, x;
If (! D) d = document;
If (p = n. indexOf ("? ")> 0 & parent. frames. length ){
D = parent. frames [n. substring (p + 1100000000.doc ument;
N = n. substring (0, p );
}
If (x! = D [n] & d. all) x = d. all [n];
For (I = 0 ;! X & I <d. forms. length; I ++) x = d. forms [I] [n];
For (I = 0 ;! X & d. layers & I <d. layers. length; I ++) x = findobj (n, d.layerspolici#.doc ument );
If (! X & document. getElementById) x = document. getElementById (n );
Return x;
}
Function submitonce (theform ){
// If IE 4 + or NS 6 +
If (document. all | document. getElementById ){
// Screen thru every element in the form, and hunt down "submit" and "reset"
For (I = 0; I Var tempobj = theform. elements [I]
If (tempobj. type. toLowerCase () = "submit" | tempobj. type. toLowerCase () = "reset ")
// Disable em
Tempobj. disabled = true
}
}
}
Function openScript (url, width, height ){
Var Win = window. open (url, "openScript", 'width = '+ width +', height = '+ height +', resizable = 1, scrollbars = yes, menubar = no, status = yes ');
}
Function CheckAll (form ){
For (var I = 0; I Var e = form. elements [I];
If (e. name! = 'Chkall') e. checked = form. chkall. checked;
}
}
Function chkcookieed (){
If (getcookie ("username ")! = ""){
Var url = "/ajax. asp? Action = loginmenu ";
Url + = "& random =" + Math. random ();
AjaxPost (url, null, null, "top_login ","");
}
}
Function userlogout (){
Var url = "/AspCode. asp? GetType = logout ";
Url + = "& random =" + Math. random ();
AjaxPost (url, null, null, "top_login", "exiting ...");
Chkcookieed ();
Alert ('Welcome to the Alibaba West WEB development community again ...');
}
// Decrypt the Cookie
Function DecodeCookie (str)
{
Var strArr;
Var strRtn = "";
StrArr = str. split ("");
Try {
For (var I = strArr. length-1; I> = 0; I --)
StrRtn + = String. fromCharCode (eval (strArr [I]);
} Catch (e ){
}
Return strRtn;
}
Function isnumber (str ){
Var digits = "1234567890 ";
Var I = 0;
Var strlen = str. length;
While (I Var char = str. charAt (I );
If (digits. indexOf (char) =-1) return false; I ++;
}
Return true;
}
// Check for invalid characters
// Str characters to be checked
// Invalid badwords characters & | <> =
Function checkbadwords (str, badwords ){
If (typeof (str )! = "String" | typeof (badwords )! = "String "){
Return (false );
}
For (I = 0; I Bad = badwords. charAt (I );
For (j = 0; j If (bad = str. charAt (j )){
Return false;
Break;
}
}
}
Return true;
}
Function switchTag (tag, bar)
{
For (I = 1; I <6; I ++)
{
If ("tag" + I = tag)
{
Document. getElementById (tag). getElementsByTagName ("a") [0]. className = "selectli" + I;
Document. getElementById (tag). getElementsByTagName ("a") [0]. getElementsByTagName ("span") [0]. className = "selectspan" + I;
} Else {
Document. getElementById ("tag" + I). getElementsByTagName ("a") [0]. className = "";
Document. getElementById ("tag" + I). getElementsByTagName ("a") [0]. getElementsByTagName ("span") [0]. className = "";
}
If ("bar" + I = bar)
{
Document. getElementById (bar). className = "";
} Else {
Document. getElementById ("bar" + I). className = "hidebar ";
}
Document. getElementById ("bar"). className = bar;
}
}
Function switchNew (fornum, showname, lname, newid)
{
For (I = 1; I <fornum; I ++)
{
If (lname + I = newid)
{
Document. getElementById (newid). className = showname;
} Else {
Document. getElementById (lname + I). className = "hidebar ";
}
}
}
Function imgzoom (o ){
If (event. ctrlKey ){
Var zoom = parseInt (o. style. zoom, 10) || 100;
Zoom-= event. wheelDelta/12;
If (zoom> 0 ){
O. style. zoom = zoom + '% ';
}
Return false;
} Else {
Return true;
}
}
Function CheckAll (form)
{
For (var I = 0; I {
Var e = form. elements [I];
If (e. Name! = "ChkAll" & e. disabled! = True)
E. checked = form. chkAll. checked;
}
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service