// JavaScript Document

<!--

/*
if(	(navigator.userAgent.match(/iPhone/i))
		||
	(navigator.userAgent.match(/iPod/i))
		||
	(navigator.userAgent.match(/iPad/i))
		||
	(navigator.userAgent.match(/blackberry/i))
		||
	(navigator.userAgent.match(/android/i))
		||
	(navigator.userAgent.match(/IEMobile/i)) )
{
	
	//if(navigator.userAgent.match(/IEMobile/i)) alert(navigator.userAgent);
	location.replace("http://www.youtube.com/user/BlinderCommercials");
}
*/

function getViewPort()
{
	//http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/
	var viewportwidth;
	var viewportheight;
	
	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	if (typeof window.innerWidth != 'undefined')
	{
	  viewportwidth = window.innerWidth,
	  viewportheight = window.innerHeight
	}
	
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	else if (typeof document.documentElement != 'undefined'
	 && typeof document.documentElement.clientWidth !=
	 'undefined' && document.documentElement.clientWidth != 0)
	{
	   viewportwidth = document.documentElement.clientWidth,
	   viewportheight = document.documentElement.clientHeight
	}
	
	// older versions of IE
	else
	{
	   viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
	   viewportheight = document.getElementsByTagName('body')[0].clientHeight
	}

	return [viewportwidth, viewportheight];
}

//-->

//	called by flash to extend according to tiles
function resizeContentDiv(height)
{
	//alert(document.getElementById("flash"));
	//document.getElementById("content").style.width = getViewPort()[0]+"px";
	if(getViewPort()[1] > height) height = getViewPort()[1];
	document.getElementById("content").style.height = height+"px";
	//alert("ok " + document.getElementById("flash").style.height);
}

function scrollUp()
{
	window.scroll(0,0);	
}

//	handle user changing window size
window.onresize=function()
{
	//var currentWidth = document.getElementById("content").style.width;
	//var currentHeight = document.getElementById("content").style.height;
	//resizeContentDiv(getViewPort()[1]);
}

//-->