
	// JavaScript Document
	
	// Window Size
	
	function getWindowHeight() 
	{
		var windowHeight = 0;
		if(typeof(window.innerHeight) == 'number') windowHeight = window.innerHeight;
		else
		{
			if(document.documentElement && document.documentElement.clientHeight) windowHeight = document.documentElement.clientHeight;
			else if(document.body && document.body.clientHeight) windowHeight = document.body.clientHeight;
		}
		return windowHeight;
	}

	function setContent()
	{
		if(document.getElementById)
		{
			var windowHeight = getWindowHeight();
			if(windowHeight > 0)
			{
				var contentElement = document.getElementById("global");
				var logoElement = document.getElementById("amvs");
				var contentHeight = contentElement.offsetHeight;
				
				p = ((windowHeight / 2) - (contentHeight / 2));
				
				if(windowHeight - contentHeight > 0)
				{
					contentElement.style.position = "relative";
					contentElement.style.top =  p + "px";
					
				}
				else contentElement.style.position = "static";
				
				/*
				document.getElementById("amvs").style.top = (p + 350) + "px";
				document.getElementById("amvs").style.left = contentElement.offsetLeft + 5 + "px";
				document.getElementById("amvs").style.visibility = "visible";
				*/
			}
		}
	}

	function switchImage(imgName,imgSrc)
	{
  		if(imgSrc != "none") document.images[imgName].src = imgSrc;
	}

	function simplePreload()
	{ 
		var args = simplePreload.arguments;
		document.imageArray = new Array(args.length);
		for(var i=0;i<args.length;i++)
		{
			document.imageArray[i] = new Image;
			document.imageArray[i].src = args[i];
		}
	}
	
	// Preload
	path_home_images = "library/img/home/";
	simplePreload(path_home_images+'h_r2_c1_on.jpg',path_home_images+'h_r3_c3_on.jpg',path_home_images+'h_r4_c5_on.jpg',path_home_images+'h_r6_c10_on.jpg',path_home_images+'h_r2_c11_on.jpg')

	
	onload = global_init
	
	function global_init()
	{
		local_init()
	}
