/** * JS This is a public document * Mr.Fang QQ:184377367 www.ebycms.com * id Global.js */ //Access to a framework object $F = function(oFw){ return document.getElementById(oFw).value; } //By name to obtain an HTML element $N = function(em){ return document.getElementsByName(em); } //By access to an HTML element ID $ = function(em) { if (document.getElementById){ return document.getElementById(em); } else if (document.all){ return document.all[em]; } else if (document.layers){ return document.layers[em]; } else{ return null; } } //get this obj classname or set class $cls = function(em, g, c){ if (g == 'g'){ em.className = c; return true; }else { return em.className; } } function getClass(o) { return o.className; } function setClass(o,strClassName) { o.setAttribute('class', strClassName); } //Create an AJAX object function createAjax(){ if (window.XMLHttpRequest) { oAjax = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { oAjax = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ oAjax = new ActiveXObject("Micrsost.XMLHTTP"); } catch(e){} } } } function createAjaxs(){ if (window.XMLHttpRequest) { aj = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { aj = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ aj = new ActiveXObject("Micrsost.XMLHTTP"); } catch(e){} } } } function alertWin(title, w, h ,strFurl,intFw,intFh,t_pic){ var titleheight = "10px"; // 窗口标题高度 var bordercolor = "#709CD2"; // 提示窗口的边框颜色 var titlecolor = "#FFFFFF"; // 窗口标题颜色 var titlebgcolor = "#FFFFFF"; // 窗口标题背景色 var bgcolor = "#FFFFFF"; // 提示内容的背景色 var iWidth = document.documentElement.clientWidth; var iHeight = document.documentElement.clientHeight; var bgObj = document.createElement("div"); var _height = document.documentElement.clientHeight||document.body.clientHeight; var _top = (_height) ? (_height - 39)/2 + document.documentElement.scrollTop : 0; iHeight = _top+600; bgObj.style.cssText = "position:absolute;left:0px;top:0px;width:"+iWidth+"px;height:"+Math.max(document.body.clientHeight, iHeight)+"px;filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000;z-index:101;"; document.body.appendChild(bgObj); var msgObj=document.createElement("div"); msgObj.style.cssText = "position:absolute;font:11px '宋体';top:"+(iHeight-h)/2+"px;left:"+(iWidth-w)/2+"px;width:"+w+"px;height:"+h+"px;text-align:center;border:1px solid "+bordercolor+";background-color:"+bgcolor+";padding:1px;line-height:22px;z-index:102;"; var htmlCouent = ""; document.body.appendChild(msgObj); //msgObj.innerHTML = htmlCouent; var table = document.createElement("table"); msgObj.appendChild(table); table.style.cssText = "margin:0px;border:0px;padding:0px;"; table.cellSpacing = 0; var tr = table.insertRow(-1); var titleBar = tr.insertCell(-1); titleBar.style.cssText = "background-image: url('"+webroot+webstyleroot+"/images/ajax_login_title.gif'); background-repeat: no-repeat;width:100%;height:25px;text-align:left;padding:3px;margin:0px;font:bold 13px '宋体';border:0px solid " + bordercolor + ";cursor:move;" titleBar.style.paddingLeft = "10px"; titleBar.innerHTML = title; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; var docMouseMoveEvent = document.onmousemove; var docMouseUpEvent = document.onmouseup; titleBar.onmousedown = function() { var evt = getEvent(); moveable = true; moveX = evt.clientX; moveY = evt.clientY; moveTop = parseInt(msgObj.style.top); moveLeft = parseInt(msgObj.style.left); document.onmousemove = function() { if (moveable) { var evt = getEvent(); var x = moveLeft + evt.clientX - moveX; var y = moveTop + evt.clientY - moveY; if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) { msgObj.style.left = x + "px"; msgObj.style.top = y + "px"; } } }; document.onmouseup = function () { if (moveable) { document.onmousemove = docMouseMoveEvent; document.onmouseup = docMouseUpEvent; moveable = false; moveX = 0; moveY = 0; moveTop = 0; moveLeft = 0; } }; } var closeBtn = tr.insertCell(-1); closeBtn.style.cssText = "cursor:pointer; padding:2px;background-color:" + titlebgcolor; closeBtn.innerHTML = ""; closeBtn.onclick = function(){ document.body.removeChild(bgObj); document.body.removeChild(msgObj); } var msgBox = table.insertRow(-1).insertCell(-1); msgBox.style.cssText = "font:10pt '宋体';"; msgBox.colSpan = 2; msgBox.innerHTML = htmlCouent; // 获得Event对象,用于兼容IE和FireFox function getEvent() { return window.event || arguments.callee.caller.arguments[0]; } } function do_alert( msg ){ var _height = document.documentElement.clientHeight||document.body.clientHeight; var _top = (_height) ? (_height - 39)/2 + document.documentElement.scrollTop : 0; var msgObj=document.createElement('div'); msgObj.setAttribute('id', 'msgInfo'); msgObj.setAttribute('align', 'center'); msgObj.style.position = 'absolute'; msgObj.style.top = _top + 'px'; msgObj.style.left = '0'; msgObj.style.width = '100%'; msgObj.style.height = '33px'; msgObj.style.zIndex = '999'; msgObj.innerHTML = ''+ msg +''; document.body.appendChild(msgObj); setTimeout('close_alert()', 3000); } function close_alert(){ document.body.removeChild($('msgInfo')); } function selectAll(o){ for(var i=0;i<$N(o).length;i++) { $N(o)[i].checked=true; } } function selectBack(o){ for(var i=0;i<$N(o).length;i++) { $N(o)[i].checked==true?$N(o)[i].checked=false:$N(o)[i].checked=true; } } function kk(o,p) { var intChildLen = $(o).childNodes.length; for (i=0;i<=intChildLen;i++) { var obj = $(o).childNodes[i]; obj.style.display='block'; } } function jumpPege_back(strPage, intCid, oTag){ intCid == ''?0:intCid; var intPageNum = oTag.options[oTag.selectedIndex].value; var strUrl = location.href; if (strPage==1){ location.href='?album-cls-cid-'+intCid+'-page-'+intPageNum+'.html'; } else if (strPage==2){ location.href='?do=SplList&sid='+intCid+'&page='+intPageNum; } else if (strPage==3){ var strCut = strUrl.match(/key(=+)[0-9a-zA-Z\u4e00-\u9fa5]*/g); var arrPar = strCut[0].split('='); location.href='?do=so&key='+arrPar[1]+'&page='+intPageNum; } else if (strPage==4){ if ( strUrl.indexOf('best=true')!=-1 ){ location.href='?do=splmenu&cid='+intCid+'&best=true&page='+intPageNum; } else { if ( strUrl.indexOf('top=true')!=-1 ){ location.href='?do=splmenu&cid='+intCid+'&top=true&page='+intPageNum; } else { location.href='?do=splmenu&cid='+intCid+'&page='+intPageNum; } } } } function cus(o) { o.style.cursor='hand'; } function soSaveText(em){ var v = em.value; setTimeout('soDelText()',6000); } function soDelText(){ $('q').value=intMusicCount; } function getCookie(strName){ var arrCut = document.cookie.split(';'); var arrCutLen = arrCut.length; for (i=0;i