dl = document.layers;
da = document.all;
ge = document.getElementById;
ws = window.sidebar;
var msg='';
function nem(){return true};
window.onerror = nem;
var t64;
/********************************************************************

Popup Windows - V 4.2
Author: Brian Gosselin
Site URL: http://scriptasylum.com
Read the "releasenotes.txt" for supported features and release notes.

************** EDIT THE LINES BELOW AT YOUR OWN RISK ****************/
var showonstart = false;
var popOnce	= false;
var shadowcolor	=	"black";
var oldOK	= true;
//var scrollbarColor = "";

var w3c=(document.getElementById)? true: false;
var ns4=(document.layers)?true:false;
var ie5=(w3c && document.all)? true : false;
var ns6=(w3c && !document.all)? true: false;
var d=document;
currIDb=null; xoff=0; yoff=0;
currRS=null; rsxoff=0; rsyoff=0;
oldac=null; newac=null; zdx=1; mx=0; my=0;

function preloadBttns(){
var btns=new Array();
btns[0]=new Image(); btns[0].src="/cfpowertools/cfpowerwindows/images/min.gif";
btns[1]=new Image(); btns[1].src="/cfpowertools/cfpowerwindows/images/max.gif";
btns[2]=new Image(); btns[2].src="/cfpowertools/cfpowerwindows/images/close.gif";
btns[3]=new Image(); btns[3].src="/cfpowertools/cfpowerwindows/images/resize.gif";
}
preloadBttns();

//******* START OF EXPOSED FUNCTIONS. THESE CAN BE USED IN HYPERLINKS. *******\\

function cfpw_close(id){
if(w3c){
d.getElementById(id+'_b').style.display='none';
d.getElementById(id+'_s').style.display='none';
}}

function cfpw_popup(id){
if(w3c){
var bx=d.getElementById(id+'_b');
var sh=d.getElementById(id+'_s');
bx.style.display='block';
sh.style.display='block';
sh.style.zIndex=++zdx;
bx.style.zIndex=++zdx;
changez(bx);
}}

function cfpw_change(id,text){
if(!document.getElementById(id+'_b').isExt){
var d=document.getElementById(id+'_c');
if(ns6)d.style.overflow="hidden";
d.innerHTML=text;
if(ns6)d.style.overflow="block";
}else document.getElementById(id+'_ifrm').src=text;
}

//******* END OF EXPOSED FUNCTIONS *******\\

function minimize(){
if(w3c){
var minimized = true;
d.getElementById(this.winID+"_b").style.height=(ie5)? '28px':'24px';
d.getElementById(this.winID+"_s").style.height='28px';
d.getElementById(this.winID+"_c").style.display='none';
d.getElementById(this.winID+"_rs").style.display='none';
ns6bugfix();
}}

function restore(){
if(w3c){
d.getElementById(this.winID+"_b").style.height=this.h+'px';
d.getElementById(this.winID+"_s").style.height=(ie5)? this.h+'px':this.h+5+'px';
d.getElementById(this.winID+"_c").style.display='block';
d.getElementById(this.winID+"_rs").style.display='block';
ns6bugfix();
}}

function ns6bugfix(){
if(ns6)setTimeout('self.resizeBy(0,1); self.resizeBy(0,-1);', 100);
}

function trackmouse(evt){
mx=(ie5)?event.clientX+d.body.scrollLeft:evt.pageX;
my=(ie5)?event.clientY+d.body.scrollTop:evt.pageY;
if(!ns6)movepopup();
if((currIDb!=null)||(currRS!=null))return false;
}

function movepopup(){
if((currIDb!=null)&&w3c){
var x=mx+xoff;
var y=my+yoff;
currIDb.style.left=x+'px';
currIDs.style.left=x+8+'px';
currIDb.style.top=y+'px';
currIDs.style.top=y+8+'px';
}
if((currRS!=null)&&w3c){
var rx=mx+rsxoff;
var ry=my+rsyoff;
var c=currRS;
d.gEl=d.getElementById;
d.gEl(c.winID+"_extWA").style.display="block";
c.style.left=Math.max(rx,((ie5)?88:92))+'px';
c.style.top=Math.max(ry,((ie5)?68:72))+'px';
d.gEl(c.winID+"_b").style.width=Math.max(rx+((ie5)?12:8),100)+'px';
d.gEl(c.winID+"_b").style.height=Math.max(ry+((ie5)?12:8),80)+'px';
d.gEl(c.winID+"_t").style.width=Math.max(rx+((ie5)?4:3),((ns6)?95:92))+'px';
d.gEl(c.winID+"_btt").style.left=parseInt(d.gEl(c.winID+"_t").style.width)-48+'px';
d.gEl(c.winID+"_s").style.width=Math.max(rx+12,((ie5)?100:104))+'px';
d.gEl(c.winID+"_s").style.height=Math.max(ry+((ie5)?12:13),((ie5)?80:86))+'px';
d.gEl(c.winID+"_c").style.width=Math.max(rx-((ie5)?-5:5),((ie5)?92:87))+'px';
d.gEl(c.winID+"_c").style.height=Math.max(ry-((ie5)?24:28),44)+'px';
d.gEl(c.winID+"_max").h=parseInt(d.gEl(c.winID+"_b").style.height);
}
return false;
}

function stopRS(){
d.getElementById(this.winID+"_extWA").style.display="none";
currRS=null;
}

function startRS(evt){
var ex=(ie5)?event.clientX+d.body.scrollLeft:evt.pageX;
var ey=(ie5)?event.clientY+d.body.scrollTop:evt.pageY;
rsxoff=parseInt(this.style.left)-ex;
rsyoff=parseInt(this.style.top)-ey;
currRS=this;
if(ns6)d.getElementById(this.winID+"_c").style.overflow='hidden';
return false;
}

function changez(v){
var th=(v!=null)?v:this;
if(oldac!=null)d.getElementById(oldac.winID+"_t").style.backgroundColor=oldac.inactivecolor;
if(ns6)d.getElementById(th.winID+"_c").style.overflow='auto';
oldac=th;
d.getElementById(th.winID+"_t").style.backgroundColor=th.activecolor;
d.getElementById(th.winID+"_s").style.zIndex=++zdx;
th.style.zIndex=++zdx;
d.getElementById(th.winID+"_rs").style.zIndex=++zdx;
}

function stopdrag(){
currIDb=null;
document.getElementById(this.winID+"_extWA").style.display="none";
ns6bugfix();
}

function grab_id(evt){
var ex=(ie5)?event.clientX+d.body.scrollLeft:evt.pageX;
var ey=(ie5)?event.clientY+d.body.scrollTop:evt.pageY;
xoff=parseInt(d.getElementById(this.winID+"_b").style.left)-ex;
yoff=parseInt(d.getElementById(this.winID+"_b").style.top)-ey;
currIDb=d.getElementById(this.winID+"_b");
currIDs=d.getElementById(this.winID+"_s");
d.getElementById(this.winID+"_extWA").style.display="block";
return false;
}

function subBox(x,y,w,h,bgc,id){
var v=d.createElement('div');
v.setAttribute('id',id);
v.style.position='absolute';
v.style.left=x+'px';
v.style.top=y+'px';
v.style.width=w+'px';
v.style.height=h+'px';
if(bgc!='')v.style.backgroundColor=bgc;
v.style.visibility='visible';
v.style.padding='0px';
return v;
}

function get_cookie(Name) {
var search=Name+"=";
var returnvalue="";
if(d.cookie.length>0){
offset=d.cookie.indexOf(search);
if(offset!=-1){
offset+=search.length;
end=d.cookie.indexOf(";",offset);
if(end==-1)end=d.cookie.length;
returnvalue=unescape(d.cookie.substring(offset,end));
}}
return returnvalue;
}
//function xxxxx(domain,x,y,xoffset,yoffset,w,h,winID,text,bgcolor,textcolor,fontstyleset,title,titlecolor,titletextcolor,bordercolor,borderbgImage,titlebgImage,scrollcolor,isdrag,isresize,isExt,powerFrame){
function PowerWin(domain,winAlign,maximize,x,y,xoffset,yoffset,w,h,winID,text,bgcolor,textcolor, fontstyleset,title,titlecolor,titletextcolor,bordercolor,borderbgImage,titlebgImage,titleUnselected,isdrag,isresize,isExt,powerFrame,scroll,scrollbarColor){
if (maximize)
	{
	w = screen.availWidth-44;
    h = screen.availHeight-190;
	x = 5;
	y = 5;
}
if (winAlign == "center")
	{
	y = (screen.availWidth / 2) - (w);
	x = (screen.availHeight /2) - (h);
	}
//function popUp(x,y,w,h,cid,text,bgcolor,textcolor,fontstyleset,title,titlecolor,titletextcolor,bordercolor,scrollcolor,shadowcolor,showonstart,isdrag,isresize,oldOK,isExt,popOnce){
var okPopUp=false;
if (popOnce){
if (get_cookie(winID)==""){

okPopUp=true;
d.cookie=winID+"=yes"
}
}
else okPopUp=true;
if(okPopUp){
if(w3c){
w=Math.max(w,100);
h=Math.max(h,80);
//var rdiv=new subBox(w-((ie5)?12:8),h-((ie5)?12:8),7,7,'',cid+'_rs');
var rdiv=new subBox(w-((ie5)?12:8),h-((ie5)?12:8),7,7,'',winID+'_rs',titlebgImage,borderbgImage);
if(isresize){
//rdiv.innerHTML='<img src="resize.gif" width="7" height="7">';
rdiv.innerHTML='<img src="' + domain + '/cfpowertools/cfpowerwindows/images/resize.gif" width="7" height="7">';
rdiv.style.cursor='se-resize';
}
var tw=(ie5)?w:w+4;
var th=(ie5)?h:h+6;
//var shadow=new subBox(x+8,y+8,tw,th,shadowcolor,cid+'_s');
var shadow=new subBox(x+8,y+8,tw,th,shadowcolor,winID+'_s',titlebgImage,borderbgImage);
if(ie5)shadow.style.filter="alpha(opacity=50)";
else shadow.style.MozOpacity=.5;
shadow.style.zIndex=++zdx;
//var outerdiv=new subBox(x,y,w,h,bordercolor,cid+'_b');
var outerdiv=new subBox(x,y,w,h,bordercolor,winID+'_b',titlebgImage,borderbgImage);
outerdiv.style.borderStyle="outset";
outerdiv.style.borderWidth="2px";
outerdiv.style.borderColor=bordercolor;
//
outerdiv.style.backgroundImage="url('"+borderbgImage+"')";
//
outerdiv.style.zIndex=++zdx;
tw=(ie5)?w-8:w-5;
th=(ie5)?h+4:h-4;
//var titlebar=new subBox(2,2,tw,20,titlecolor,cid+'_t');
var titlebar=new subBox(2,2,tw,20,titlecolor,winID+'_t',titlebgImage,borderbgImage);
titlebar.style.overflow="hidden";
titlebar.style.cursor="move";
titlebar.style.borderStyle="outset";
titlebar.style.borderWidth="1px";
titlebar.style.backgroundImage="url('"+titlebgImage+"')";

//var tmp=(isresize)?'<img src="min.gif" width="16" height="16" id="'+winID+'_min"><img src="max.gif" width="16" height="16"  id="'+winID+'_max">':'';
var tmp=(isresize)?'<img src="' + domain + '/cfpowertools/cfpowerwindows/images/min.gif" width="16" height="16" id="'+winID+'_min"><img src="' + domain + '/cfpowertools/cfpowerwindows/images/max.gif" width="16" height="16"  id="'+winID+'_max">':'';

//titlebar.innerHTML='<span style="position:absolute; left:3px; top:1px; font:bold 10pt sans-serif; color:'+titletextcolor+'; height:18px; overflow:hidden; clip-height:16px;">'+title+'</span><div id="'+winID+'_btt" style="position:absolute; width:48px; height:16px; left:'+(tw-48)+'px; top:2px; text-align:right">'+tmp+'<img src="close.gif" width="16" height="16" id="'+winID+'_cls"></div>';
titlebar.innerHTML='<span style="position:absolute; left:3px; top:1px; font:bold 10pt sans-serif; color:'+titletextcolor+'; height:18px; overflow:hidden; clip-height:16px;">'+title+'</span><div id="'+winID+'_btt" style="position:absolute; width:48px; height:16px; left:'+(tw-48)+'px; top:2px; text-align:right;cursor:pointer">'+tmp+'<img src="/cfpowertools/cfpowerwindows/images/close.gif" width="16" height="16" id="'+winID+'_cls"></div>';

tw=(ie5)?w-7:w-13;
var content=new subBox(2,24,tw,h-36,bgcolor,winID+'_c');
content.style.borderColor=bordercolor;
content.style.borderWidth="2px";

if(isExt){
// Added by SS
if (ie5) iframeSize = "100%";
if (ns6) iframeSize = "98%";
content.innerHTML='<iframe align="center" id="'+winID+'_ifrm" src="'+text+'" width="'+iframeSize+'" height="'+iframeSize+'" scrolling="'+scroll+'"></iframe>';
// End Add
content.style.overflow="hidden";

}else{
if(ie5)content.style.scrollbarBaseColor=scrollbarColor;
content.style.borderStyle="inset";
content.style.overflow="auto";
content.style.padding="0px 2px 0px 4px";
content.innerHTML=text;
content.style.font=fontstyleset;
content.style.color=textcolor;
}
//var extWA=new subBox(2,24,0,0,'',winID+'_extWA');
var extWA=new subBox(2,24,0,0,'',winID+'_extWA',titlebgImage,borderbgImage);

extWA.style.display="none";
extWA.style.width='100%';
extWA.style.height='100%';
outerdiv.appendChild(titlebar);
outerdiv.appendChild(content);
outerdiv.appendChild(extWA);
outerdiv.appendChild(rdiv);
d.body.appendChild(shadow);
d.body.appendChild(outerdiv);
d.gEl=d.getElementById;
if(!showonstart)cfpw_close(winID);
var wB=d.gEl(winID+'_b');
wB.winID=winID;
wB.isExt=(isExt)?true:false;
var wT=d.gEl(winID+'_t');
wT.winID=winID;
if(isresize){
var wRS=d.gEl(winID+'_rs');
wRS.winID=winID;
var wMIN=d.gEl(winID+'_min');
wMIN.winID=winID;
var wMAX=d.gEl(winID+'_max');
wMAX.h=h;
wMAX.winID=winID;
wMIN.onclick=minimize;
wMAX.onclick=restore;
wRS.onmousedown=startRS;
wRS.onmouseup=stopRS;
}
var wCLS=d.gEl(winID+'_cls'); //8
var wEXTWA=d.gEl(winID+'_extWA'); //11
wB.activecolor=titlecolor;
wB.inactivecolor=scrollbarColor;
if(oldac!=null)d.gEl(oldac.winID+"_t").style.backgroundColor=oldac.inactivecolor;
oldac=wB;
if(winID == "audioview"|| winID == "videoview")
wCLS.onclick=new Function("cfpw_myclose('"+winID+"');");
else if(winID =="ImageProperty"|| winID =="Hyperlink")
wCLS.onclick= new Function("cfpw_nada();");
else
wCLS.onclick=new Function("cfpw_close('"+winID+"');");
wB.onmousedown=function(){ changez(this) }
if(isdrag){
wT.onmousedown=grab_id;
wT.onmouseup=stopdrag;
}
}else{
if(oldOK){
var ctr=new Date();
ctr=ctr.getTime();
var t=(isExt)?text:'';
var posn=(ns4)? 'screenX='+x+',screenY='+y: 'left='+x+',top='+y;
var win=window.open(t , "abc"+ctr , "status=no,menubar=no,width="+w+",height="+h+",resizable="+((isresize)?"yes":"no")+",scrollbars=yes,"+posn);
if(!isExt){
t='<html><head><title>'+title+'</title></head><body bgcolor="'+bgcolor+'"><font style="font:'+fontstyleset+'; color:'+textcolor+'">'+text+'</font></body></html>';
win.document.write(t);
win.document.close();
}}}}}

if(ns6)setInterval('movepopup()',40);

if(w3c){
d.onmousemove=trackmouse;
d.onmouseup=new Function("currRS=null");
}
