/* 
Methods for resizing the flash stage at runtime.

setFlashWidth(divid, newW)
divid: id of the div containing the flash movie.
newW: new width for flash movie

setFlashWidth(divid, newH)
divid: id of the div containing the flash movie.
newH: new height for flash movie

setFlashSize(divid, newW, newH)
divid: id of the div containing the flash movie.
newW: new width for flash movie
newH: new height for flash movie

canResizeFlash()
returns true if browser supports resizing flash, false if not. 
*/



function setFlashWidth(newW){
	document.getElementById("flashcontent").style.width = newW+"px";
}
function setFlashHeight(newH){	
	newH = Math.ceil(newH)
	
	if(newH < getWindowHeight()){
		newH = getWindowHeight();
	}
	
	document.getElementById("flashcontent").style.height = newH+"px";
	document.getElementById("main").style.height = newH+"px";
}

function setFlashSize(newW, newH){
	setFlashWidth("flashcontent", newW);
	setFlashHeight("flashcontent", newH);
}

function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}

function getScroll() {
	var scrolledDown = window.scrollY;
	if (scrolledDown == null){
		scrolledDown = document.body.scrollTop
	}
	if (scrolledDown == null){
		scrolledDown = document.body.parentNode.scrollTop
	}
	return scrolledDown;
}

function setScroll(num) {
	
	window.scroll(0, num);
	
	if(num <= 0)
	{
		setTimeout(fakeScroll, 50)
	}
	
}


function fakeScroll()
{
	window.scroll(0, 1)
}

function getWindowHeight() {
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}



