
 /////////////////////////////////////////////////////////////////////

 var FloatLayers       = new Array();
 var FloatLayersByName = new Array();
 var docRef = (document.documentElement) ? document.documentElement : document.body;
 var isMSIE = (navigator.appName=="Microsoft Internet Explorer") ? true : false;

 function addFloatLayer(n,offX,offY,spd){new FloatLayer(n,offX,offY,spd);}
 function getFloatLayer(n){return FloatLayersByName[n];}
 function alignFloatLayers(){for(var i=0;i<FloatLayers.length;i++)FloatLayers[i].align();}

 function getXCoord(el) {
         x=0;
         while(el){
                 x+=el.offsetLeft;
                 el=el.offsetParent;
         }
         return x;
 }
 function getYCoord(el) {
         y=0;
         while(el){
                 y+=el.offsetTop;
                 el=el.offsetParent;
         }
         return y;
 }

 function getClientWidth() {
 	return docRef.clientWidth;
 }
 
 function getClientHeight() {
 	return docRef.clientHeight;
 }
 
 function getScrollTop() {
 	if( typeof( window.pageYOffset ) == 'number' ) {
     		return window.pageYOffset;
			} else {
     		return docRef.scrollTop;
			}
 }
 function getScrollLeft() {
 	if( typeof( window.pageXOffset ) == 'number' ) {
     		return window.pageXOffset;
			} else {
     		return docRef.scrollLeft;
			}
 }

 /////////////////////////////////////////////////////////////////////

 FloatLayer.prototype.setFloatToTop=setTopFloater;
 FloatLayer.prototype.setFloatToBottom=setBottomFloater;
 FloatLayer.prototype.setFloatToLeft=setLeftFloater;
 FloatLayer.prototype.setFloatToRight=setRightFloater;
 FloatLayer.prototype.initialize=defineFloater;
 FloatLayer.prototype.adjust=adjustFloater;
 FloatLayer.prototype.align=alignFloater;

 function FloatLayer(n, offX, offY, spd) {
         this.index=FloatLayers.length;

         FloatLayers.push(this);
         FloatLayersByName[n] = this;

         this.name    = n;
         this.floatX  = 0;
         this.floatY  = 0;
         this.tm      = null;
         this.steps   = spd;
         this.alignHorizontal=(offX>=0) ? leftFloater : rightFloater;
         this.alignVertical  =(offY>=0) ? topFloater : bottomFloater;
         this.ifloatX = 0;
         this.ifloatY = 0;
 }

 /////////////////////////////////////////////////////////////////////

 function defineFloater(){
         this.layer  = document.getElementById(this.name);
         this.width  = this.layer.offsetWidth;
         this.height = this.layer.offsetHeight;
         this.prevX  = this.layer.offsetLeft;
         this.prevY  = this.layer.offsetTop;
 }

 function adjustFloater() {
         this.layer.style.left = 0 + 'px';
         
         this.layer.style.top = (getScrollTop() + (getClientHeight() - this.height)) + 'px';
 }

 function setLeftFloater(){this.alignHorizontal=leftFloater;}
 function setRightFloater(){this.alignHorizontal=rightFloater;}
 function setTopFloater(){this.alignVertical=topFloater;}
 function setBottomFloater(){this.alignVertical=bottomFloater;}

 function leftFloater(){this.floatX = getScrollLeft() + this.ifloatX;}
 function topFloater(){this.floatY = getScrollTop() + this.ifloatY;}
 function rightFloater(){
 	this.floatX = getScrollLeft() + 
 	getClientWidth() - this.ifloatX - this.width;
 }
 function bottomFloater(){
 	this.floatY = getScrollTop() + 
 	getClientHeight() - this.ifloatY - this.height;
 }

 function alignFloater(){
 	if(this.layer==null)this.initialize();
         this.alignHorizontal();
         this.alignVertical();
        FloatLayers[this.index].adjust();
 }
 

 function addListener(element, event, listener, bubble) {
   if(element.addEventListener) {
     if(typeof(bubble) == "undefined") bubble = false;
     element.addEventListener(event, listener, bubble);
   } else if(this.attachEvent) {
     element.attachEvent("on" + event, listener);
   }
 }

 function reset_div(ch) {
 	if(isMSIE) {
     	var floater = getFloatLayer('adbar_div_container');
     
 		floater.layer.style.top = ((getScrollTop() + 
 		getClientHeight()) - ch) + 'px';
 		
 		getFloatLayer('adbar_div_container').initialize();
 	} else {
 		document.getElementById('adbar_div_container').style.top = (getClientHeight() - ch) + 'px';
 	}
 }

document.write('<div style="min-width:1024px;width:100%;z-index:999;" id="adbar_div_container">'+
		'<div id="div_extra" style="display:none;"></div>'+
		'<img src="###TRAC_PIXEL_CAM###" style="width:1px;height:1px;" />' +
		'<img src="###TRAC_PIXEL_CREAT###" style="width:1px;height:1px;" />' +
		
		'<object width="900" style="position:absolute;bottom:-40px;left:0px;" id="main_op_bar" height="180"><param name="start" value="3"><param name="movie" value="http://adbars.net/satm/3-21.swf"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="transparent"><param name="wmode" value="transparent"><embed wmode="transparent" src="http://adbars.net/satm/3-21.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="900" height="180"></embed></object>'+
		
 	'<div id="adbar_div_inner" style="height:40px;overflow:hidden;top:0px;margin-top:0px;width:100%;">'+

     '</div></div>');

function call_bar() {
	
}

function close_click() {
	//register_click_tracking(70);
	document.getElementById('adbar_div_container').style.display = 'none';
}

function logo_click() {
	//register_click_tracking(64);
	window.open('http://www.spaceandtime.eu.com/');
}

var is_video_div_show = false;
 function video_click() {
	if(!is_video_div_show){
		is_video_div_show = true;
		is_twit_div_show = false;
		is_qr_div_show = false;
		//register_click_tracking(104);
 		document.getElementById('div_extra').innerHTML = '<div style="width:600px;margin-left:200px;height:400px;">'+
	 	'<span style="float:left;"><iframe width="560" height="315" src="http://www.youtube.com/embed/1AlxbOgFBCc?autoplay=1" frameborder="0" allowfullscreen></iframe></span>'+
	 	'<a style="float:right;" onclick="javascript:video_click();" href="javascript:void();">'+
	 	'<img border="0" src="http://adbars.net/pricemin/close.png" alt="close" style="float:right;" />'+
	 	'</a></div>';
 		document.getElementById('div_extra').style.display = '';
 		reset_div(440);
	}else{
		is_video_div_show = false;
		document.getElementById('div_extra').style.display='none';
		document.getElementById('div_extra').innerHTML='';
		reset_div(40);
	}
 }

var is_flash_enabled = false;
function bar_alive() {
	is_flash_enabled = true;
}
function check_is_flash_enabled() {
	if(!is_flash_enabled) {
		document.getElementById('adbar_div_container').innerHTML = '<a href="javascript:void(0)" onclick="window.location.href =\'http://www.spaceandtime.eu.com/\';" >' + 
			'<img style="" src="http://adbars.net/satm/noflash.png" alt="" /></a>';
		reset_div(100);
	}
}
 
var is_qr_div_show = false;
 function qr_click() {
	if(!is_qr_div_show){
		is_qr_div_show = true;
		is_twit_div_show = false;
		is_video_div_show = false;
		//register_click_tracking(35);
 		document.getElementById('div_extra').innerHTML = '<div style="width:340px;margin-left:600px;height:300px;">'+
	 	'<span style="float:left;"><img border="0" src="http://adbars.net/satm/qr.png" alt="QR?" /></span>'+
	 	'<a style="float:right;" onclick="javascript:qr_click();" href="javascript:void();">'+
	 	'<img border="0" src="http://adbars.net/pricemin/close.png" alt="close" style="float:right;" />'+
	 	'</a></div>';
 		document.getElementById('div_extra').style.display = '';
 		reset_div(340);
	}else{
		is_qr_div_show = false;
		document.getElementById('div_extra').style.display='none';
		document.getElementById('div_extra').innerHTML='';
		reset_div(40);
	}
 }

var is_twit_div_show = false;
function twitter_click() {
	if(!is_twit_div_show){
		is_twit_div_show = true
		is_qr_div_show = false;
		is_video_div_show = false;
		//register_click_tracking(74);
 		document.getElementById('div_extra').innerHTML = '<div id="tweet_container" style="width:340px;margin-left:600px;height:350px;">'+
	 	'<span style="float:left;"><iframe scrolling="no" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" allowtransparency="true" height="300px" width="250px" src="http://adbars.net/satm/twitter.html"></iframe></span>'+
	 	'<a style="float:right;" onclick="javascript:twitter_click();" href="javascript:void();">'+
	 	'<img border="0" src="http://adbars.net/pricemin/close.png" alt="close" style="float:right;" />'+
	 	'</a></div>';
 		document.getElementById('div_extra').style.display = '';
 		reset_div(390);
	}else{
		is_twit_div_show = false;
		document.getElementById('div_extra').style.display='none';
		document.getElementById('div_extra').innerHTML='';
		reset_div(40);
	}
 }
 
 function register_click_tracking(id) {
     try{
         var xmlHttp = null;
         var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
         if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
             for (var i=0; i<activexmodes.length; i++){
                 try{
                     xmlHttp = new ActiveXObject(activexmodes[i])
                 }
                 catch(e){
                     //suppress error
                 }
             }
         }
         else if (window.XMLHttpRequest) { // if Mozilla, Safari etc {
             xmlHttp = new XMLHttpRequest();
         }
         xmlHttp.open( "GET", 'http://anuncia.adbars.net/delivery/?c=###TRAC_CAM###&s=###TRAC_SUP###&ct='+id, false );
         xmlHttp.send( null );
     }
     catch(e) {
         //suppress error
     }
 }
 
 if(isMSIE) {
	
	new FloatLayer('adbar_div_container', 0, -1, 10);
 	lay = document.getElementById('adbar_div_container');
 	lay.style.position='absolute';
 	lay.style.top=0 + 'px';
 	lay.style.left=0 + 'px';
 	getFloatLayer('adbar_div_container').initialize();
 
 	alignFloatLayers();
 
 	addListener(this, "resize", function() { alignFloatLayers(); });
 	addListener(this, "scroll", function() { alignFloatLayers(); });
 
 } else {
 	barRef = document.getElementById('adbar_div_container');
 	barRef.style.position = 'fixed';
 	barRef.style.left = '0px';
 	barRef.style.top = (getClientHeight() - 40) + 'px';
 }

setTimeout('check_is_flash_enabled()', 6000);



