



/*
$().ready(function ()
{
	/**
	* fix for IE < 7 since it doesn't properly handle either
	* (1) the CSS box model; or 
	* (2) position: absolute
	*//*
	if ( document.all && !window.XMLHttpRequest ) {
		$('#adBar').css('position', 'absolute');
		$('#adBar').css('top', '181px');
	}
});
*/







/*
window.onscroll = function()
{
	
	if( window.XMLHttpRequest ) { // IE 6 doesn't implement position fixed nicely...
		if (document.documentElement.scrollTop > 181 || self.pageYOffset > 181) {
			$('adBar').style.position = 'fixed'; 
			$('adBar').style.top = '0';
		} else if (document.documentElement.scrollTop < 181 || self.pageYOffset < 181) {
			$('adBar').style.position = 'absolute'; 
			$('adBar').style.top = 'auto';
		}
	}
}
*/

window.onscroll = function()
{
	var element = document.getElementById('adBar');
	
 	// note: you can use window.innerWidth and window.innerHeight to access the width and height of the viewing area
	//alert (document.documentElement.scrollTop);
	if( window.XMLHttpRequest ) { // IE 6 doesn't implement position fixed nicely...
		if (document.documentElement.scrollTop > 181 || self.pageYOffset > 181) {
			//alert("> than 181 "+document.documentElement.scrollTop+" "+self.pageYOffset);
			//$('#adBar').css('position', 'fixed');
			//$('#adBar').css('top', '0');
			//$('adBar').style.position = 'fixed'; 
			//$('adBar').style.top = '0';
			element.style.position = 'fixed'; 
			element.style.top = '10px';
			
		} else if (document.documentElement.scrollTop < 181 || self.pageYOffset < 181) {
			//alert("< than 181 "+document.documentElement.scrollTop+" "+self.pageYOffset);
			//$('#adBar').css('position', 'absolute');
			//$('#adBar').css('top', '181');
			//$('adBar').style.position = 'absolute'; 
			//$('adBar').style.top = '181';
			element.style.position = 'absolute'; 
			element.style.top = '181px';

		}
	}
}
