var wide_ilayer = {
	
	/* nastavitelne promenne */
	cookie_name : 'wide_ilayer',
	cookie_domain : null,
	cookie_hours : 1,
	layer_showtime : 11000,
	layer_mode : 'opaque',
	
	_tm_banner : null,
	_tm_layer : null,
	_dt_cookie : new Date(),
	_adId : new Date().getTime(),
	
	create : function() {
		//this._dt_cookie.setDate(this._dt_cookie.getDate()+this.cookie_days);
		this._dt_cookie.setTime(this._dt_cookie.getTime()+(this.cookie_hours+(60*1000)+(60*60*1000)));
		// create HTML
		document.write('<div id="'+this._adId+'-banner"><embed src="http://www.autoholubka.cz/minibanner.swf" quality="high"  WIDTH="199" HEIGHT="35" ALIGN="" allowScriptAccess="always" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></embed></div>');
		document.write('<div id="'+this._adId+'-layer" style="position:absolute;left:'+((760-630)/2)+'px;top:'+(10+10)+'px;display:none;z-index:2;"><embed id="'+this._adId+'-movie" src="http://www.autoholubka.cz/holubka_2.swf" quality="high" width="485" height="333" type="application/x-shockwave-flash" allowScriptAccess="always" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" wmode="'+this.layer_mode+'"></embed></div>');
		document.write('</div>');
		
		if ((document.cookie.indexOf(this.cookie_name) == -1 ) && (typeof(window.activeLayer) == "undefined")) {
			
			document.cookie = this.cookie_name + "=1; expires=" + this._dt_cookie.toGMTString() + ";path=/";
			if (document.cookie.indexOf(this.cookie_name) != -1 ){
				this.ilayer_display();
				window.activeLayer = 1
			}
		}
	},

	banner_over : function() {
		if (!this._tm_banner) this._tm_banner = setTimeout("wide_ilayer.ilayer_display()",500);
	},
	
	banner_out : function() {
		clearTimeout(this._tm_banner);
		this._tm_banner = 0;
	},
	
	ilayer_display : function () {

		document.getElementById(this._adId+'-layer').style.display = 'block';
		
		try {
			if(document.attachEvent && !window.opera) {
				var obj = document.getElementById(this._adId+'-movie');
				if (obj) {
					if (typeof obj.GotoFrame != "undefined") {
						obj.GoToFrame(0);
						obj.Play();
					}
				}
			}
		}
		catch(e) {}
		
		var Action_image = new Image;
		Action_image.src = "__ACTION__";
	
		this._tm_layer = setTimeout("wide_ilayer.ilayer_hide()",this.layer_showtime);
	},
	
	ilayer_hide : function() {
		try {
			if(document.attachEvent && !window.opera) {
				var obj = document.getElementById(this._adId+'-movie');
				if (obj) {
					if (typeof obj.GotoFrame != "undefined") {
						obj.Stop();
					}
				}
			}
		}
		catch(e) {}
		
		document.getElementById(this._adId+'-layer').style.display = 'none';
		
		clearTimeout(this._tm_banner); this._tm_banner = 0;
		clearTimeout(this._tm_layer); this._tm_layer = 0;
	}
}

wide_ilayer.create();
