/*
 *
 * GoldenWindow
 * Desenvolvedor: Fernando Arroyo
 * GoldenLight [ fernando.arroyo@goldenlight.biz ]
 * 06.08.2009
 *
 */

	var GoldenWindow=function(Parametros){
		
		/*
		 * Parametros - GoldenWindow
		 * 
		 * Conteudo
		 * Largura
		 * Altura
		 * 
		 */
		
		this.Executar=function(){
			GoldenWindowTelaConfirmacao	=document.createElement("div");
			GoldenWindowConteudo		=document.createElement("div");
			GoldenWindowFechar			=document.createElement("div");
			GoldenWindowLinkFechar		=document.createElement("a");
			GoldenWindowCamadaFechar	=document.createElement("span");
			
			GoldenWindowLinkFechar.setAttribute("href","javascript:void(0);");
			GoldenWindowLinkFechar.onclick=function(){
				document.body.removeChild(GoldenWindowTelaConfirmacao);
			}
			
			GoldenWindowCamadaFechar.innerHTML="x";
			with(GoldenWindowCamadaFechar.style){
				display="block";
				backgroundColor="#d8d8d8";
				fontWeight="bolder";
				color="#FFFFFF";
				padding="5px";
				paddingTop="0px";
				paddingBottom="2px";
			}
			GoldenWindowLinkFechar.appendChild(GoldenWindowCamadaFechar);
			GoldenWindowFechar.appendChild(GoldenWindowLinkFechar);
			with(GoldenWindowFechar.style){
				position="absolute";
				top="10px";
				if (Parametros.Largura) {
					left = (Parametros.Largura-30)+"px";
				}
				else{
					left = "370px";
				}
			}
			GoldenWindowConteudo.innerHTML=Parametros.Conteudo;
			with(GoldenWindowTelaConfirmacao){
				id="__GoldenWindow__";
				style.zIndex=999999;
				style.display="block";
				style.position="fixed";
				if(Parametros.Altura){
					style.top=((screen.height-Parametros.Altura)/2)+"px";
					style.height=Parametros.Altura+"px";
				}
				else{
					style.top=((screen.height-300)/2)+"px";
//					style.height="300px";
				}
				if(Parametros.Largura){
					style.left=((screen.width-Parametros.Largura)/2)+"px";
					style.width=Parametros.Largura+"px";
				}
				else{
					style.left=((screen.width-400)/2)+"px";
					style.width=400+"px";
				}
				style.fontFamily="Verdana";
				style.backgroundColor="#f4f4f4";
				style.border= "1px solid #d8d8d8";
				style.paddingBottom="10px";
				style.zIndex=999999;
				appendChild(GoldenWindowConteudo);
				appendChild(GoldenWindowFechar);
			}
			with(GoldenWindowConteudo.style){
				position="relative";
				float="left";
				padding="10px";
				fontSize="12px";
				marginTop="25px";
			}
			document.body.appendChild(GoldenWindowTelaConfirmacao);
		}
		
		this.Executar();
		
		this.Fechar=function(){
			document.body.removeChild(GoldenWindowTelaConfirmacao);
		}
	}