var OBEUS_FIRST_CALL = (typeof OBEUS_PRESENT != 'undefined') ? 0 : 1;
var OBEUS_PRESENT = 1;
var _DC = document;
var OBEUS_U = escape(_DC.location.href);
var OBEUS_R = escape(_DC.referrer);
OBEUS_Set_Cookie = function(n,v,e,p,d,s){var t = new Date();t.setTime(t.getTime());if(e){e=e*1000*60;}var ed=new Date(t.getTime()+(e));document.cookie=n+"="+escape(v)+((e)?";expires="+ed.toGMTString():"")+((p)?";path="+p:"")+((d)?";domain="+d:"")+((s)?";secure":"");}
OBEUS_Get_Cookie = function(a){var b = document.cookie.split( ';' );var c = '';var n = '';var v = '';var f = false;for ( i = 0; i < b.length; i++ ) {c = b[i].split( '=' );n = c[0].replace(/^\s+|\s+$/g, '');if ( n == a ) {f = true;if ( c.length > 1 ) {v = unescape( c[1].replace(/^\s+|\s+$/g, '') );}return v;break;}c = null;n = '';}if ( !f ) {return null;}}
if (typeof OBEUS_STICKY_PID == 'undefined') {var OBEUS_STICKY_PID = null;}
if (typeof OBEUS_STICKY_KEY == 'undefined') {var OBEUS_STICKY_KEY = null;}
var OBEUS_STICKY_SKIP = OBEUS_Get_Cookie('OBEUS_STICKY_SKIP');
if (!OBEUS_STICKY_SKIP && OBEUS_STICKY_PID) {
	var OBEUS_Sticky_Ad = _DC.getElementById('OBEUS_Sticky_Ad');
	if (!OBEUS_Sticky_Ad) {
		OBEUS_str  = '';
		OBEUS_str += '<div id="OBEUS_Sticky_Ad" style="height: 23px; display: block;">';
		OBEUS_str += '<div id="OBEUS_Sticky_Ad_1" style="position: fixed; top:0; left:0; width: 100%; z-index: 100000;">';
		OBEUS_str += '<div id="OBEUS_Sticky_Ad_1_1" style="position: relative; width: 100%;">';

		OBEUS_str += '<div id="OBEUS_Sticky_Ad_2" style="position: absolute; width: 100%; z-index: 100000; top: 0; left: 0; height: 23px;">';
		OBEUS_str += '<iframe src="http://obeus.com/frame/'+OBEUS_STICKY_PID+'/?ch='+OBEUS_FIRST_CALL+'&pkey='+OBEUS_STICKY_KEY+'&_u='+OBEUS_U+'&_r='+OBEUS_R+'" width="100%" height="23" marginheight="0" marginwidth="0" frameborder="0" scrolling="no"></iframe>';
		OBEUS_str += '</div>';

		OBEUS_str += '<div id="OBEUS_Sticky_Ad_3" style="position: absolute; z-index: 100001; top: 5px; right: 5px; width: 14px; height: 14px; line-height: 14px; font-size: 1px;">';
		OBEUS_str += '<img height="14" width="14" border="0" style="cursor: pointer;" onclick="document.getElementById(\'OBEUS_Sticky_Ad\').style.display=\'none\';OBEUS_Set_Cookie(\'OBEUS_STICKY_SKIP\', 1, 60, \'/\');return false;" onmouseout="this.src=\'http://obeus.com/img/ad/cl0.gif\'" onmouseover="this.src=\'http://obeus.com/img/ad/clo0.gif\'" src="http://obeus.com/img/ad/cl0.gif" title="Close" id="OBEUS_Sticky_Ad_4" />';
		OBEUS_str += '</div>';

		OBEUS_str += '</div>';
		OBEUS_str += '</div>';
		OBEUS_str += '</div>';
		var OBEUS_BODY = _DC.getElementsByTagName('body').item(0);
		var OBEUS_newEl = _DC.createElement('div');
		OBEUS_newEl.innerHTML = OBEUS_str;
		//return;
		if ( OBEUS_BODY.childNodes.item(0) ) {
			OBEUS_BODY.insertBefore( OBEUS_newEl, OBEUS_BODY.childNodes.item(0) );
		} else {
			OBEUS_BODY.appendChild( _DC.createElement('div').innerHTML = str );
		}
		OBEUS_BODY = null;
		OBEUS_str = null;
		OBEUS_newEl = null;

		if (/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent)) {
			OBEUS_STICKY_AD_POS = function(){
				var top = 0;
				if (document.documentElement) {
					top = document.documentElement.scrollTop;
				} else if (document.body) {
					top = document.body.scrollTop;
				}
				document.getElementById('OBEUS_Sticky_Ad_1').style.position = 'absolute';
				document.getElementById('OBEUS_Sticky_Ad_1').style.top = top + 'px';
				if ( document.getElementById('OBEUS_Sticky_Ad').style.display != 'none' ) {
					setTimeout('OBEUS_STICKY_AD_POS()', 25);
				}
			}
			OBEUS_STICKY_AD_POS();
		}
	}
}
