	// Global JavaScript Document

	document.write('<scr' + 'ipt src="/library/js/sniffer.js" type="text/javascript"><\/scr' + 'ipt>');
	document.write('<scr' + 'ipt src="/library/js/udm-functions.js" type="text/javascript"><\/scr' + 'ipt>');
	
	var path_f_pics = "/library/img/environment/";
	array_f_pics = 
	[
		"bg_footer.jpg",
		"bg_footer_1.jpg"
	]

	for(i=0;i<array_f_pics.length;i++) array_f_pics[i] = path_f_pics + array_f_pics[i]

	var im;
	function randomPic()
	{
		im = Math.floor(array_f_pics.length * Math.random());
		return array_f_pics[im];
	}


	onload = function()
	{
		if(is_ie) correctPNG()
		//
		local_init();
		if(window.scrollMs) startScroll();
		setElement();
		
		//
		onresize = function()
		{
			setElement();
		}
		
		// 
		gb("footer-pic").style.backgroundImage = "url("+randomPic()+")";
	}

	function gn(type,id,p)
	{
		el = document.createElement(type);
		el.id = id;
		if(p) document.getElementById(p).appendChild(el)
		else document.body.appendChild(el)
	}
	function gb(id){return document.getElementById(id)}


	function setElement()
	{
		f = gb("global"); y = 0;


		// Bug in Firefox with scrollbar
		/*
		// Set Main height
		mh = document.documentElement.clientHeight - (gb("container").offsetHeight + gb("picture-infront").offsetHeight + (gb("nav").offsetHeight + 15 ) + gb("footer").offsetHeight);
		if((gb("container").offsetHeight + gb("picture-infront").offsetHeight + (gb("nav").offsetHeight + 15) + gb("footer").offsetHeight + gb("main").offsetHeight) < document.documentElement.clientHeight)
		{
			gb("main").style.height = mh + "px";
		}
		*/

		if(window.scrollMs)
		{
			// Set position of the scroll band
			gb("container").style.left = ((getPageOffsetLeft(f)) + "px");
			gb("container").style.top = ((getPageOffsetTop(f) + y) + "px");
		}
	}

	function getPageOffsetLeft(el)
	{
		var x;
		// Return the x coordinate of an element relative to the page.
		x = el.offsetLeft;
		if(el.offsetParent != null) x += getPageOffsetLeft(el.offsetParent)
		return x;
	}
	
	function getPageOffsetTop(el)
	{
		var y;
		// Return the x coordinate of an element relative to the page.
		y = el.offsetTop;
		if(el.offsetParent != null) y += getPageOffsetTop(el.offsetParent);
		return y;
	}
	
	function GetOffset(obj,coord)
	{	
		var val = obj["offset"+coord] ;
		if(coord == "Top") val += obj.offsetHeight;
		while((obj = obj.offsetParent) != null)
		{
			val += obj["offset"+coord];
			if(obj.border && obj.border != 0) val++;
		}
		return val;
	}
	
	function getSelectTag()
	{
		return document.getElementsByTagName("select").length;
	}

	
	// Correctly handle PNG transparency in Win IE 5.5 or higher.
	// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004

	function correctPNG() 
   	{
		for(var i=0; i<document.images.length; i++)
		{
			var img = document.images[i]
			var imgName = img.src.toUpperCase()
			if(imgName.substring(imgName.length-3, imgName.length) == "PNG")
			{
				var imgID = (img.id) ? "id='" + img.id + "' " : ""
				var imgClass = (img.className) ? "class='" + img.className + "' " : ""
				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
				var imgStyle = "display:inline-block;" + img.style.cssText 
				if(img.align == "left") imgStyle = "float:left;" + imgStyle
				if(img.align == "right") imgStyle = "float:right;" + imgStyle
				if(img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
				var strNewHTML = "<span " + imgID + imgClass + imgTitle
				+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
				+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
				
				img.outerHTML = strNewHTML
				i = i-1
			}
		}
    }

