
function detect_browsers() {

	isDOM = (document.getElementById) ? 1:0; //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
	Explorer4 = (document.all && document.all.item) ? 1:0; //Microsoft Internet Explorer 4+
	Netscape = (document.layers) ? 1:0; //Netscape 4.*
	Opera = (window.opera) ? 1:0; //Opera
	Opera5 = (Opera && isDOM) ? 1:0; //Opera 5+
	Explorer5 = (isDOM && Explorer4) ? 1:0; //MSIE 5+
	Konqueror = (isDOM && navigator.appName == 'Konqueror'); // Konqueror
	Mozilla = (isDOM && !Explorer4 && !Opera) ? 1:0; //Mozilla & Netscape 6.*
}


function windowPos() {

		self.onError = null; // ignore errors (FIXME)

	detect_browsers();
	if (Explorer5) {
		winWidth = document.body.clientWidth;
	} else if (Netscape || Mozilla || Opera5 || Opera || Konqueror) {
		winWidth = window.innerWidth;
	}

	if (winWidth < 760) {
		winWidth = 760;
	}
	if (Explorer5) {
		document.all.sliding.style.pixelLeft = (winWidth/2) + fromCenter;
		document.all.sliding.style.pixelTop =110;
	} else if (Netscape) {
		document.sliding.left = (winWidth / 2) + fromCenter - 6;
		document.sliding.top=110;

	} else if (Opera5 || Konqueror) {
		document.getElementById("sliding").pixelLeft = (winWidth / 2) + fromCenter;
		document.getElementById("sliding").pixelTop =110;

	} else if (Opera || Mozilla) {
		document.getElementById("sliding").style.left = (winWidth / 2) + fromCenter - 8;
		document.getElementById("sliding").pixelTop =110;

	}
}

function sliding_start() {
	self.onError = null; // ignore errors (FIXME)

	detect_browsers();

	Yb = 0;
	if (Explorer5) {
		winWidth = document.body.clientWidth;
	}

	if (Netscape || Mozilla || Opera5 || Opera || Konqueror) {
		winWidth = window.innerWidth;
	}

	if (winWidth < 760) {
		winWidth = 760;
	}

	// Default object location for different browsers
	if (Explorer5) {
		locationX = Math.floor((winWidth / 2) + fromCenter) - 2;

	} else if (Netscape) {
		locationX = (winWidth / 2) + fromCenter - 6;

	} else if (Opera5 || Konqueror) {
		locationX = Math.floor((winWidth / 2) + fromCenter);

	} else if (Opera || Mozilla) {
		locationX = Math.floor((winWidth / 2) + fromCenter) - 8;
	}

	locationY = 110; // from page top
/*
	// choose right element type for object
	if (Explorer5 || Mozilla || Opera5 || Opera || Konqueror) {
		htmltag = '<div ID="sliding" style="left: ' + locationX + 'px; top: 0px; width: ' + sbwidth + 'px; height: ' + sbheight + 'px; position: absolute;">' + sbanner + '</div>';

	} else if (Netscape) {
		htmltag = '<layer name="sliding" left="' + locationX + '" top= "' + locationY +'" width="' + sbwidth + '" height ="' + sbheight + '" >' + sbanner + '</layer>';
	}
*/
	//document.write (htmltag);

	//window.setInterval("windowPos()", 10);

}

var sbanner, sbwidth, sbheight; // 's' is for Sliding
// start loop if screen width is bigger then 800 and banner is defined
if (screen.width>800 ) {

	var fromCenter = 380; // Change this to move object left or right
	var winWidth;
	//sliding_start();
	windowPos();
}

