/******************************************************************\
					Cash-program, infopopScript
\******************************************************************/
var url_img="http://media.cash-program.com/gigapass/infopop/150x250/1.gif";
InfoPopFNC=function(){
	var vts;
	var divid;
	var defil;
	var timetoshow;
	var divname;
	
	var curX;
	var inc;
	
	var width;
	var height;
	var manuel=false;
	var max_height;
	
	this.width="150";
	this.height="250";
}


InfoPopFNC.prototype={
	createPop:function(){
		var UUID = new Date();
		UUID=UUID.getTime()+'x'+Math.floor(Math.random()*1000);
		this.divname='CP_infopop_'+UUID;
		
		document.write('<style type="text/css">'); 
		document.write('#'+this.divname+' { width:'+this.width+'px; position:absolute; right:0; z-index:1000; display:block; visibility:visible; overflow:hidden; }'); 
		document.write('html>body #'+this.divname+' { position: fixed; bottom:0px; }');
		document.write('html { background:url(null) fixed; }');
		document.write('* html #'+this.divname+' { top:expression((document.body.clientHeight - this.offsetHeight + document.body.scrollTop)+"px"); }'); 
		document.write('</style>'); 
		
		document.write('<div id="'+this.divname+'"></div>');
		document.getElementById(this.divname).innerHTML='<a href="http://www.gigapass.tv/index.php?wref=7251" target="_blank" style="padding:0px; margin:0px; border:0px;"><img src="'+url_img+'" width="'+this.width+'" height="'+this.height+'" style="padding:0px; margin:0px; border:0px;" /></a>';

		this.max_height=parseInt(this.height);

		this.inc=2;
		this.vts=10;
		this.curX=0;
		this.timetoshow=10;
		this.defil=1;
		this.__showandhide();
	},
	__showandhide:function(){
		var thisdiv=document.getElementById(this.divname);
		
		thisdiv.style.height=this.curX;
		this.curX+=this.inc*this.defil;
		var self=this;

		if(this.curX>=this.max_height && this.defil>0){
			thisdiv.style.height=this.max_height;
			this.curX=this.max_height;
			this.defil=-1;

			setTimeout(function(){self.__showandhide();},this.timetoshow*1000);
		}else{
			if(this.curX<=0 && this.defil < 0){
				thisdiv.style.visibility="hidden";thisdiv.style.display="none";
				setTimeout(function(){self.__review();},5000);
			}else setTimeout(function(){self.__showandhide();},this.vts);
		}
	},
	__review:function(){
		var thisdiv=document.getElementById(this.divname);
		
		thisdiv.style.height=0;
		this.curX=0;
		this.defil=1;
		thisdiv.style.visibility="visible";
		thisdiv.style.display="block";

		this.__showandhide();
	}
	
}
var infopop=new InfoPopFNC();
infopop.createPop();