
var PopUp = Class.create();
	
	PopUp.prototype = {
		
		id: "",
		//dim_body: null,
		dim: null,
		
		initialize: function(id,srcImg,link) {
			this.id = id;
			this.img = srcImg;
			this.link = link;
			this.init();
			
		},
		
		getId: function() {
			return this.id
		},
		
		init: function() {
			
			this.dim_body = Element.getDimensions(document.body); //{h:screen.height,w:screen.width}
			this.dim = {height:document.body.clientHeight,width:document.body.clientWidth}

			var oG = document.createElement("DIV");
				oG.id = "bubble_2"+this.id;
				
				
				with (oG.style) {
					position = "absolute";
					top = 0 +"px"
					left = 0 +"px"
					backgroundColor = "#ffffff";
					height =this.dim_body.height;
					width = this.dim_body.width;
					zIndex = "100001";
					
					filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";
					
					opacity = "0.50"
					
				}
				//alert("w="+oG.style.width+" h="+oG.style.height)
			
			document.body.appendChild(oG);
			
			var oD = document.createElement("DIV");
				oD.id = "bubble"+this.id;
				
				//var dim = {h:screen.height,w:screen.width}
				
			with (oD.style) {
				position = "absolute";
				top = (this.dim.height-420)/2 +"px"
				left = (this.dim.width-560)/2 +"px"
				backgroundColor = "#ffffff";
				height = 420+"px";
				width = 560+"px";
				border = "2px solid #cccccc";
				zIndex = "100001";

			}
			
			if(this.dim.height < 420 ){
				$("body").style.overflowY = "";
				$("body").scroll = "yes";
				oD.style.top = "0px";
				
			}
			//alert("w="+oD.style.width+" h="+oD.style.height+" body h="+$("body").style.height)
			
			oD.innerHTML = '<div id="bubble_all" style="height:420px;width:560px;">'
								+'<div id="bubble_body" style="top:0px; left:0px; position:absolute; width:560px; height:420px;" oborder:2px #cccccc solid;">'
									+'<a '+(this.link!=""? ('href="'+this.link+'"') : '')+'><img alt="Click aqui para ir a la promoci&oacute;n" src="'+this.img+'" width="560" height="420" border="0"></a>'
								+'</div>'
								+'<div style="top:2px; left:541px; width:14px; height:14px;position:absolute;">'
									+'<img alt="Cerrar ventana" style="width:14px; height:14px;" src="/imagenes/close_black.gif" align="right" onclick="pop_up.hide()" />'
								+'</div>'
								+'<div style="top:406px; left:522px; width:35px; height:12px; background-color:#339900; position:absolute;">'
									//+'<img src="/imagenes/close_black.jpg" align="right"  />'
									+'<div title="Cerrar ventana" onmouseover="this.style.cursor=\'default\';" style="color:#fcfcfc; font-family: Verdana, Arial, Helvetica, sans-serif; font-size:10px;" onclick="pop_up.hide()">Cerrar</div>'
								+'</div>'
							+'</div>'
			
					
			document.body.appendChild(oD);
			
		},
		
		show: function(){
			
			$("bubble"+this.id).style.display = ""
			$("bubble_2"+this.id).style.display = ""
			$("body").style.overflow = "hidden";
			$("body").scroll = "no"
		},
		
		hide:function(){
			$("bubble"+this.id).style.display = "none"
			$("bubble_2"+this.id).style.display = "none"
			$("body").style.overflow = "auto";
			$("body").scroll = "yes";
		}
	};

