/* 
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. 
*/
var isSmaller;

window.onresize=function(){
	//document.title=window.innerHeight +" "+document.documentElement.clientHeight+" "+document.body.clientHeight;
	//document.getElementById("farmazone").style.height=document.body.clientHeight;
	
	
	
	
	var h=document.getElementById("farmazone").style.height;
	var b=h.split("px");
	
	//document.title=b[0]+" "+document.body.clientHeight;
	if( b[0]< document.body.clientHeight || document.getElementById("farmazone").style.height=="100%"){
		//document.title=document.getElementById("farmazone").style.height+" "+document.body.clientHeight;
		document.getElementById("farmazone").style.height=document.body.clientHeight;
		document.getElementById("tt").style.height=document.body.clientHeight;
	}
	
}

function getURL(){
	return document.URL;
}

function setFlashWidth(divid, newW){
	document.getElementById("farmazone").style.width = newW+"px";
}
function setFlashHeight(newH){
	
		//document.getElementById("tt").style.height = newH;
		
	//alert(newH);
	
	if(newH=="100%"){
		//document.title=newH;
		//document.body.style.overflow='hidden';
		document.getElementById("tt").style.height = document.body.clientHeight;
		document.getElementById("farmazone").style.height = document.body.clientHeight;
		
	}else{
		//document.body.style.overflow='visible';
		
		if(newH<document.body.clientHeight){
			document.getElementById("tt").style.height = document.body.clientHeight;
			document.getElementById("farmazone").style.height = document.body.clientHeight;
		}else{
			document.getElementById("tt").style.height = newH;
			document.getElementById("farmazone").style.height = newH;
		}
		
		////document.getElementById("tt").style.height = newH;
		//document.getElementById("farmazone").style.height = newH;
		
		//document.title=newH;
		
	}
	//alert(newH);
}
function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, 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;
}
