// JavaScript Document
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
var Type = 'Z';
function StartFloat() {
if(document.getElementById) {

	document.getElementById('AdFloater').style.visibility = 'visible';
	var a=findPos(document.getElementsByTagName('body')[0]);
	document.getElementById('AdFloater').style.left =a[0]+(document.body.clientWidth-document.getElementById('AdFloater').clientWidth);
	Type = 'C';
}
else if(document.all) {
	document.all.AdFloater.style.pixelLeft = document.body.clientWidth - document.all.AdFloater.offsetWidth;

	document.all.AdFloater.style.visibility = 'visible';
	Type = 'A';
	}
else if(document.layers) {
	document.AdFloater.left = window.innerWidth - document.AdFloater.clip.width - 16;
	document.AdFloater.visibility = 'show';
	Type = 'B';
	}

window.onscroll = Float;
}
function Float() {
	if (Type == 'A') {
		document.all.AdFloater.style.pixelTop = document.body.scrollTop;
		document.all.AdFloaterL.style.pixelTop = document.body.scrollTop;
	}
	else if (Type == 'B') {
		document.AdFloater.top = window.pageYOffset;
		document.AdFloaterL.top = window.pageYOffset;
	}
	else if (Type == 'C') {
		if(window.pageYOffset)
		{
			document.getElementById('AdFloater').style.top =window.pageYOffset+ 'px'
			document.getElementById('AdFloaterL').style.top =window.pageYOffset+ 'px'
		}
		else
		{
			document.getElementById('AdFloater').style.top = iecompattest().scrollTop+ 'px';
			document.getElementById('AdFloaterL').style.top = iecompattest().scrollTop+ 'px';
		}
	}
}
function iecompattest()
{
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}
