
function onBrowserResize()
{
	var flashElement = document.getElementById('digit');
	
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
	    userBrowserWidth = window.innerWidth;
	    userBrowserHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    userBrowserWidth = document.documentElement.clientWidth;
	    userBrowserHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    userBrowserWidth = document.body.clientWidth;
	    userBrowserHeight = document.body.clientHeight;
	}
	
	flashElement.tellBrowserSize(userBrowserWidth, userBrowserHeight);
}

function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
 }

function flashRequestBrowserResizeCallback()
{
//	alert("flash req callback");
	var flashElement = document.getElementById('digit');
	var innerWidth = document.window.innerWidth;
	var innerHeight = document.window.innerHeight;
	
	flashElement.tellBrowserSize(innerWidth, innerHeight);
	
}

function resizeFlashStage(width, height){
	//get the element
	//alert("resize height " + height);
	var flashElement = document.getElementById('digit');
	//alert("flash element " + flashElement + " height " + height);
	flashElement.style.height = height;
	flashElement.style.width = width;
	
	document.bgColor = '#000000';
	
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
	    userBrowserWidth = window.innerWidth;
	    userBrowserHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    userBrowserWidth = document.documentElement.clientWidth;
	    userBrowserHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    userBrowserWidth = document.body.clientWidth;
	    userBrowserHeight = document.body.clientHeight;
	}
	
	flashElement.browserWindowResize(userBrowserWidth, userBrowserHeight);
}

function goHundred()
{
	var flashElement = document.getElementById('digit');
	flashElement.style.height = '100%';
	flashElement.style.width = '100%';
	
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
	    userBrowserWidth = window.innerWidth;
	    userBrowserHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    userBrowserWidth = document.documentElement.clientWidth;
	    userBrowserHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    userBrowserWidth = document.body.clientWidth;
	    userBrowserHeight = document.body.clientHeight;
	}
	
	flashElement.browserWindowResize(userBrowserWidth, userBrowserHeight);
}

function popUp(Url) 
{
	var day = new Date();
	var id = day.getTime();
	
	var windowWidth = 800;
	var windowHeight = 600;
	
	var topPos = (screen.availHeight/2)-(windowHeight/2);
	var leftPos = (screen.availWidth/2)-(windowWidth/2);
	
	var popUpResult = window.open(Url, id , 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=' + windowWidth + ',height=' + windowHeight + ',left = ' + leftPos + ',top = ' + topPos);

	if (popUpResult != null)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function openWindow(Url)
{
	var windowResult = window.open(Url, '_blank');
	
	if (windowResult != null)
	{
		return true;
	}
	else
	{
		return false;
	}
}