var logowidth = 129
var logoheight = 317

var logoimage = new Image(logowidth,logoheight)
logoimage.src = "images/bg_gears.jpg"

var Hoffset = 0
var Voffset = 0

var ie = document.all&&navigator.userAgent.indexOf("Opera")==-1

var gears_obj = ie? document.all.gearsImg : document.getElementById? document.getElementById("gearsImg") : document.gearsImg

function insertimage() {
	if (ie||document.getElementById)
		gears_obj.innerHTML='<img src="'+logoimage.src+'" width="'+logowidth+'" height="'+logoheight+'" border="0" usemap="#admin">'
	else if (document.layers) {
		gears_obj.document.write('<img src="'+logoimage.src+'" width="'+logowidth+'" height="'+logoheight+'" border="0" usemap="#admin">');
		gears_obj.document.close();
	}
}

function positionGears(){
	var dsocleft=ie? document.body.scrollLeft : pageXOffset
	var dsoctop=ie? document.body.scrollTop : pageYOffset
	var window_width=ie? document.body.clientWidth : window.innerWidth-20
	var window_height=ie? document.body.clientHeight : window.innerHeight

	if (ie||document.getElementById){
		gears_obj.style.left=parseInt(dsocleft)+parseInt(window_width)-logowidth-Hoffset
		gears_obj.style.top=parseInt(dsoctop)+parseInt(window_height)-logoheight-Voffset
	}
	else if (document.layers){
		gears_obj.left=dsocleft+window_width-Hoffset-logowidth
		gears_obj.top=dsoctop+window_height-logoheight-Voffset
	}
}

function initGears() {
	foo=setInterval("positionGears()",50);
	insertimage();
}

if (ie||document.getElementById||document.layers)
window.onload = initGears