var tcolor={ cColor:"#93A1AD", //蒙皮颜色 bColor:"#93A1AD", //背景颜色 tColor:"#93A1AD", //标题背景颜色,边框颜色 wColor:"#FFFFFF" //标题文字颜色 }; function popclose() { var a = parent.document.getElementById("dialogBoxClose"); a.click(); } function uploadimg() { pop("js/uploadimg.jsp","上传图片",300,77) } function pop(purl,ptitle,pwidth,pheight) { var pop=new Popup({ contentType:1,isReloadOnClose:false,width:pwidth,height:pheight}); pop.setContent("contentUrl",purl); pop.setContent("title",ptitle); pop.build(); pop.show(); } if(!Array.prototype.push){ Array.prototype.push=function(){ var startLength=this.length; for(var i=0;i'; var close=''; var cB='filter: alpha(opacity='+this.info.coverOpacity+');opacity:'+this.info.coverOpacity/100+';'; var cover=''; var mainBox=''+''; if(!this.config.isBackgroundCanClick){G('dialogCase').innerHTML=cover+mainBox;G('dialogBoxBG').style.height=document.body.scrollHeight} else G('dialogCase').innerHTML=mainBox;Event.observe(G('dialogBoxClose'),"click",this.reset.bindAsEventListener(this),false); if(this.config.isSupportDraging){dropClass=new Dragdrop(this.config.width,this.config.height,this.info.shadowWidth,this.config.isSupportDraging,this.config.contentType);G("dialogBoxTitle").style.cursor="move"};this.lastBuild()},lastBuild:function(){var confirm='
'+this.info.confirmCon+'
 
'; var alert='
'+this.info.alertCon+'
'; var baseZIndex=10001+this.info.overlay*10;var coverIfZIndex=baseZIndex+4; if(this.config.contentType==1){var openIframe=""; var coverIframe="
";G("dialogBody").innerHTML=openIframe+coverIframe} else if(this.config.contentType==2){G("dialogBody").innerHTML=this.info.contentHtml}else if(this.config.contentType==3){G("dialogBody").innerHTML=confirm;Event.observe(G('dialogOk'),"click",this.forCallback.bindAsEventListener(this),false); Event.observe(G('dialogCancel'),"click",this.close.bindAsEventListener(this),false)}else if(this.config.contentType==4){G("dialogBody").innerHTML=alert;Event.observe(G('dialogYES'),"click",this.close.bindAsEventListener(this),false)}},reBuild:function(){G('dialogBody').height=G('dialogBody').clientHeight;this.lastBuild()},show:function(){this.hiddenSome();this.middle();if(this.config.isShowShadow)this.shadow()},forCallback:function(){return this.info.callBack(this.info.parameter)},shadow:function(){var oShadow=G('dialogBoxShadow');var oDialog=G('dialogBox');oShadow['style']['position']="absolute";oShadow['style']['background']="#000";oShadow['style']['display']="";oShadow['style']['opacity']="0.2";oShadow['style']['filter']="alpha(opacity=20)";oShadow['style']['top']=oDialog.offsetTop+this.info.shadowWidth;oShadow['style']['left']=oDialog.offsetLeft+this.info.shadowWidth;oShadow['style']['width']=oDialog.offsetWidth;oShadow['style']['height']=oDialog.offsetHeight},middle:function(){if(!this.config.isBackgroundCanClick)G('dialogBoxBG').style.display=''; var oDialog=G('dialogBox'); oDialog['style']['position']="absolute"; oDialog['style']['display']=''; //取得页面的宽度和高度 var sClientWidth=document.body.clientWidth; var sClientHeight=document.body.clientHeight; var sScrollTop=document.body.scrollTop; // var sleft=(sClientWidth/2)-(oDialog.offsetWidth/2); var iTop=-80+(sClientHeight/2+sScrollTop)-(oDialog.offsetHeight/2); var sTop=iTop>0?iTop:(sClientHeight/2+sScrollTop)-(oDialog.offsetHeight/2); if(sTop<1)sTop="20";if(sleft<1)sleft="20"; oDialog['style']['left']=sleft+"px"; //左侧位置 oDialog['style']['top']=330+"px" //顶部位置 }, reset:function(){if(this.config.isReloadOnClose){top.location.reload()};this.close()},close:function(){G('dialogBox').style.display='none'; if(!this.config.isBackgroundCanClick)G('dialogBoxBG').style.display='none'; if(this.config.isShowShadow)G('dialogBoxShadow').style.display='none';G('dialogBody').innerHTML=''; this.showSome()},hiddenSome:function(){var tag=this.info.someHiddenTag.split(","); if(tag.length==1&&tag[0]=="")tag.length=0; for(var i=0;iparseInt(this.oObj.style.top)+25)iTop=iTop+12;this.oObj.style.left=iLeft;this.oObj.style.top=iTop;if(this.showShadow){G('dialogBoxShadow').style.left=iLeft+this.shadowWidth;G('dialogBoxShadow').style.top=iTop+this.shadowWidth};this.dragData={x:Event.pointerX(event),y:Event.pointerY(event)};document.body.style.cursor="move"},mouseup:function(event){if(!this.IsDraging)return;if(this.contentType==1)G("iframeBG").style.display="none";document.onmousemove=null;document.onmouseup=null;var mousX=Event.pointerX(event)-(document.documentElement.scrollLeft||document.body.scrollLeft);var mousY=Event.pointerY(event)-(document.documentElement.scrollTop||document.body.scrollTop);if(mousX<1||mousY<1||mousX>document.body.clientWidth||mousY>document.body.clientHeight){this.oObj.style.left=this.backData["x"];this.oObj.style.top=this.backData["y"];if(this.showShadow){G('dialogBoxShadow').style.left=this.backData.x+this.shadowWidth;G('dialogBoxShadow').style.top=this.backData.y+this.shadowWidth}};this.IsDraging=false;document.body.style.cursor="";Event.stopObserving(document,"selectstart",this.returnFalse,false)},returnFalse:function(){return false}};