
//<!--- Version Mark = ild 2006-08-14 1:47 PM --->

/*
build in function:
	cfpw_change(ObjName,url);	changes the url in the targeted powerWin
	cfpw_popup(ObjName);	shows the targeted powerWin
	cfpw_close(ObjName);	hides the targeted powerWin
*/
function cfpw_center(ObjName){
	ObjWin = document.getElementById(ObjName + '_b');
	ObjShadow = document.getElementById(ObjName + '_s');
	ObjWidth = parseInt(ObjWin.style.width);
	ObjHeight = parseInt(ObjWin.style.height);
	DocumentW = currentDocW();
	DocumentH = currentDocH();
	
	ObjWin.style.left = (DocumentW - ObjWidth) / 2;
	ObjWin.style.top = (DocumentH - ObjHeight) / 2 - 80;
	ObjShadow.style.left = (DocumentW - ObjWidth) / 2 + 8;
	ObjShadow.style.top = (DocumentH - ObjHeight) / 2 + 8 -80;
	
	if(parseInt(ObjWin.style.top) < 0){
		ObjWin.style.top = 15;
		ObjShadow.style.top = 23;	
	}
	cfpw_KeepScreen(ObjName);
}

function cfpw_nada(){

}
function cfpw_KeepScreen(ObjName){
	ObjWin = document.getElementById(ObjName + '_b');
	ObjShadow = document.getElementById(ObjName + '_s');
	if (ObjWin.style.top != document.body.scrollTop + parseInt(ObjWin.style.top)){
		ObjWin.style.top = document.body.scrollTop + parseInt(ObjWin.style.top);
		ObjShadow.style.top = document.body.scrollTop + parseInt(ObjShadow.style.top);
	}
}

function cfpw_myclose(ObjName, url){
	cfpw_change(ObjName,"");
	cfpw_close(ObjName);
}

function resizePopup(ids,rx,ry){
	if(w3c){
		d.gEl=d.getElementById;
		d.gEl(ids+"_extWA").style.display="block";
		d.gEl(ids+"_rs").style.left=Math.max(rx,((ie5)?88:92))+'px';
		d.gEl(ids+"_rs").style.top=Math.max(ry,((ie5)?68:72))+'px';
		d.gEl(ids+"_b").style.width=Math.max(rx+((ie5)?12:8),100)+'px';
		d.gEl(ids+"_b").style.height=Math.max(ry+((ie5)?12:8),80)+'px';
		d.gEl(ids+"_t").style.width=Math.max(rx+((ie5)?4:3),((ns6)?95:92))+'px';
		d.gEl(ids+"_btt").style.left=parseInt(d.gEl(ids+"_t").style.width)-48+'px';
		d.gEl(ids+"_s").style.width=Math.max(rx+12,((ie5)?100:104))+'px';
		d.gEl(ids+"_s").style.height=Math.max(ry+((ie5)?12:13),((ie5)?80:86))+'px';
		d.gEl(ids+"_c").style.width=Math.max(rx-((ie5)?-5:5),((ie5)?92:87))+'px';
		d.gEl(ids+"_c").style.height=Math.max(ry-((ie5)?24:28),44)+'px';
		d.gEl(ids+"_max").h=parseInt(d.gEl(ids+"_b").style.height);
	}
}

function currentDocW(){
		if (IE4 || IE5)
			return(parseInt(document.body.clientWidth));
		else if(NN4)
			return(parseInt(window.innerWidth));
		else if(NN6)
			return(parseInt(window.innerWidth));
		else if(IE6 || IE7)
			return(parseInt(document.body.clientWidth));
}
function currentDocH(){
		if (IE4 || IE5)				
			return(parseInt(window.screen.availHeight));
		else if(NN4)
			return(parseInt(window.innerHeight));
		else if(NN6)
			return(parseInt(document.body.clientHeight));
		else if(IE6 || IE7)
			return(parseInt(document.body.clientHeight));
}