/* ------------------------------------------------------------ */
function doOnResize(){
	if(Element.visible("pad")){
		setPadSize();
	}
}
/* ------------------------------------------------------------ */
function setPadSize(){
		cw = document.body.clientWidth;
		ch = document.body.clientHeight;
		tw = (cw<200 ? (screen.availWidth-20) 	 : cw );
		th = (ch<200 ? (screen.availHeight-100) : ch );
  		$("pad").style.width	= (tw<400 ? 800 : tw )+"px";
		$("pad").style.height	= (th<400 ? 600 : th )+"px";
} 
function doPadShow(s,e){
	
	if(s){
		setPadSize();
		Element.show("pad");
		new Effect.Opacity($("pad"), {duration:1.2, from:0.05, to:0.92});
		if(typeof(e)!='undefined'){
			e.style.zIndex=1000; 
			e.style.position="absolute"; 
			Element.setOpacity(e,0.05);
			new Effect.Opacity(e, {duration:0.8, from:0.05, to:1.0});
		}
	}
	else {
	 if(typeof(e)!='undefined'){
		 new Effect.Fade($("pad"), {duration:1.0, from:0.92, to:0.05});
		 setTimeout(function(){Element.hide("pad");},700);
	 }
	}
}
/* ------------------------------------------------------------ */
function doCardInitPos(e){
	cw = document.body.clientWidth;
	ch = document.body.clientHeight;
 	ew = e.style.width.replace("px",""); 	ew = ew ? ew : 640;
	eh = e.style.height.replace("px","");	eh = eh ? eh : 100;
	e.style.left	= ((cw-ew)/2.) + "px";
	e.style.top	= 50 + "px";
}
/* ------------------------------------------------------------ */
function getFrameDoc(nm){
 	var iFrame 	= $(nm);  
	var d 		= iFrame.contentDocument ? iFrame.contentDocument : iFrame.Document;
return d;
}
/* ------------------------------------------------------------ */

