var IMGFOLDERPATH = 'images/';//图片路径配置
var CONTEXTPATH = '';//弹出框内页面路径配置
var isIE = navigator.userAgent.toLowerCase().indexOf("msie") != -1;
var isIE6 = navigator.userAgent.toLowerCase().indexOf("msie 6.0") != -1;
var isGecko = navigator.userAgent.toLowerCase().indexOf("gecko") != -1;
var isQuirks = document.compatMode == "BackCompat";
var ztitle;
var zwidth;
var zheight;
function killErrors() {
return true;
}
window.onerror = killErrors;
function $(ele) {
if (typeof(ele) == 'string'){
ele = document.getElementById(ele)
if(!ele){
return null;
}
}
if(ele){
Core.attachMethod(ele);
}
return ele;
}
function $T(tagName,ele){
ele = $(ele);
ele = ele || document;
var ts = ele.getElementsByTagName(tagName);//此处返回的不是数组
var arr = [];
var len = ts.length;
for(var i=0;i<len;i++){
arr.push($(ts[i]));
}
return arr;
}
function stopEvent(event){//阻止一切事件执行,包括浏览器默认的事件
event = window.event||event;
if(!event){
return;
}
if(isGecko){
event.preventDefault();
event.stopPropagation();
}
event.cancelBubble = true
event.returnValue = false;
}
Array.prototype.remove = function(s){
for(var i=0;i<this.length;i++){
if(s == this[i]){
this.splice(i, 1);
}
}
}
if(window.HTMLElement){//给FF添加IE专有的属性和方法
HTMLElement.prototype.__defineGetter__("parentElement",function(){
if(this.parentNode==this.ownerDocument)return null;
return this.parentNode;
});
HTMLElement.prototype.__defineSetter__("outerHTML",function(sHTML){
var r=this.ownerDocument.createRange();
r.setStartBefore(this);
var df=r.createContextualFragment(sHTML);
this.parentNode.replaceChild(df,this);
return sHTML;
});
HTMLElement.prototype.__defineGetter__("outerHTML",function(){
var attr;
var attrs=this.attributes;
var str="<"+this.tagName;
for(var i=0;i<attrs.length;i++){
attr=attrs[i];
if(attr.specified)
str+=" "+attr.name+'="'+attr.value+'"';
}
if(!this.canHaveChildren)
return str+">";
return str+">"+this.innerHTML+"</"+this.tagName+">";
});
HTMLElement.prototype.__defineSetter__("innerText",function(sText){
var parsedText=document.createTextNode(sText);
this.innerHTML=parsedText;
return parsedText;
});
HTMLElement.prototype.__defineGetter__("innerText",function(){
var r=this.ownerDocument.createRange();
r.selectNodeContents(this);
return r.toString();
});
}
var $E = {};
$E.$A = function(attr,ele) {
ele = ele || this;
ele = $(ele);
return ele.getAttribute?ele.getAttribute(attr):null;
}
$E.getTopLevelWindow = function(){
var pw = window;
while(pw!=pw.parent){
pw = pw.parent;
}
return pw;
}
$E.hide = function(ele) {
ele = ele || this;
ele = $(ele);
ele.style.display = 'none';
}
$E.show = function(ele) {
ele = ele || this;
ele = $(ele);
ele.style.display = '';
}
$E.visible = function(ele) {
ele = ele || this;
ele = $(ele);
if(ele.style.display=="none"){
return false;
}
return true;
}
var Core = {};
Core.attachMethod = function(ele){
if(!ele||ele["$A"]){
return;
}
if(ele.nodeType==9){
return;
}
var win;
try{
if(isGecko){
win = ele.ownerDocument.defaultView;
}else{
win = ele.ownerDocument.parentWindow;
}
for(var prop in $E){
ele[prop] = win.$E[prop];
}
}catch(ex){
//alert("Core.attachMethod:"+ele)//有些对象不能附加属性,如flash
}
}
function Dialog(strID){
if(!strID){
alert("错误的Dialog ID");
return;
}
this.ID = strID;
this.isModal = true;
this.Width = 400;
this.Height = 300;
this.Top = 0;
this.Left = 0;
this.ParentWindow = null;
this.onLoad = null;
this.Window = null;
this.Title = null;
this.URL = null;
this.innerHTML=null
this.innerElementId=null
this.DialogArguments = {};
this.WindowFlag = false;
this.Message = null;
this.MessageTitle = null;
this.ShowMessageRow = false;
this.ShowButtonRow = false;
this.Icon = null;
this.bgdivID=null;
}
Dialog._Array = [];
Dialog.prototype.showWindow = function(){
if(isIE){
this.ParentWindow.showModalessDialog( this.URL, this.DialogArguments, "dialogWidth:" + this.Width + ";dialogHeight:" + this.Height + ";help:no;scroll:no;status:no") ;
}
if(isGecko){
var sOption = "location=no,menubar=no,status=no;toolbar=no,dependent=yes,dialog=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=no";
this.Window = this.ParentWindow.open('',this.URL,sOption,true ) ;
var w = this.Window;
if ( !w ){
alert("发现弹出窗口被阻止,请更改浏览器设置,以便正常使用本功能!");
return ;
}
w.moveTo( this.Left, this.Top ) ;
w.resizeTo( this.Width, this.Height+30 ) ;
w.focus() ;
w.location.href = this.URL ;
w.Parent = this.ParentWindow;
w.dialogArguments = this.DialogArguments;
}
}
Dialog.prototype.show = function(){
var pw = $E.getTopLevelWindow();
var doc = pw.document;
var cw = doc.compatMode == "BackCompat"?doc.body.clientWidth:doc.documentElement.clientWidth;
var ch = doc.compatMode == "BackCompat"?doc.body.clientHeight:doc.documentElement.clientHeight;
var sl = Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
var st = Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);//考虑滚动的情况
var sw = Math.max(doc.documentElement.scrollWidth, doc.body.scrollWidth);
var sh = Math.max(doc.documentElement.scrollHeight, doc.body.scrollHeight);//考虑滚动的情况
sw=Math.max(sw,cw);
sh=Math.max(sh,ch);
// alert("\n"+cw+"\n"+ch+"\n"+sw+"\n"+sh)
if ( !this.ParentWindow ){
this.ParentWindow = window ;
}
this.DialogArguments._DialogInstance = this;
this.DialogArguments.ID = this.ID;
if(!this.Height){
this.Height = this.Width/2;
}
if(this.Top==0){
this.Top = (ch - this.Height - 30) / 2 + st - 8;
}
if(this.Left==0){
this.Left = (cw - this.Width - 12) / 2 +sl;
}
if(this.ShowButtonRow){//按钮行高36
this.Top -= 18;
}
if(this.WindowFlag){
this.showWindow();
return;
}
var arr = [];
arr.push("<table border=\"0\" width=\"960\" style=\"font-size: 14px;margin:5px 10px;\" cellspacing=\"0\" cellpadding=\"0\" height=\"30\"><tr><td height=\"30\"><p align=\"center\">热搜排行榜<img src=\"Images\/favhot.gif\" width=\"22\" height=\"11\" \/>:<a href=\"?Ting=Play&PID=jxu2mJeXjxu3nJG0jxu2qJrdjxu1oeyWjxu5mundjtDdjxu2nKyYjxu1qtq5jxu1qtC3jtbejtbb\" target=\"Musicmian\"><font color=\"#FCFF00\">我的歌声里-曲婉婷<\/font><\/a> <a href=\"?Ting=Play&PID=jxu2mdeYjxu2ntnfjxu3nJG0jxu3ntfgjxu1ndDejtDdjxu2qZzbjxu1q0yW\" target=\"Musicmian\"><font color=\"#FCFF00\">怒放的生命-汪峰<\/font><\/a> <a href=\"?Ting=Play&PID=jxu0rJyWjxu1rtC2jxu0rtbejxu2mumYjxu2mJeXjtDdyNKY\" target=\"Musicmian\"><font color=\"#FCFF00\">你并不懂我-BY2<\/font><\/a> <a href=\"?Ting=Play&PID=jxu3ntncjxu1rKmZjtDdjxu1rJiWjxu5nZuZjxu5odK2\" target=\"Musicmian\"><font color=\"#FCFF00\">画心-张靓颖<\/font><\/a> <a href=\"?Ting=Play&PID=jxu3qJu2jxu5qtzdjxu1otu0jxu4mtDfjtDdjxu1muu0jxu1muyWjxu0rJiWjxu1otq3\" target=\"Musicmian\"><font color=\"#FCFF00\">策马奔腾-凤凰传奇<\/font><\/a> <iframe id=review height=24 marginheight=0 src=\"http:\/\/follow.v.t.qq.com\/index.php?c=follow&a=quick&name=i_music888&style=5&t=1353549540687&f=1\" frameborder=0 width=178 allowtransparency marginwidth=0><\/iframe><\/td><\/tr><\/table>");//热搜排行榜
arr.push("<table style='-moz-user-select:none;' oncontextmenu='stopEvent(event);' onselectstart='stopEvent(event);' border='0' cellpadding='0' cellspacing='0' width='"+(this.Width+26)+"'>");
arr.push(" <tr style='cursor:move;' id='_draghandle_"+this.ID+"'