divid = 'flashcontent';
oldWidth=oldHeight=0;

widthType = "percent";
heightType = "percent";

curWidth = 0;
curHeight = 0;

function setFlashWidth(newW, type)
{
	widthType = type;
	if(type == "percent") {
		document.getElementById(divid).style.width = newW+"%";
	}else if(type == "pixel") {
		curWidth = newW;
		document.getElementById(divid).style.width = newW+"px";
	}
}
function setFlashHeight(newH, type)
{
	heightType = type;
	if(type == "percent") {
		document.getElementById(divid).style.height = newH+"%";		
	}else if(type == "pixel") {
		curHeight = newH;
		document.getElementById(divid).style.height = newH+"px";
	}
}
function setFlashSize(newW, newH, widthType, heightType)
{
	if(newW) setFlashWidth(newW, widthType);
	if(newH) setFlashHeight(newH, heightType);
}
function backToTop() 
{
	window.scrollTo(0,0);
}
function doAlert(value)
{
	alert(value);
}
function changeTitle(value)
{
	document.title = title+" / "+value;
}

function setFlashMinSize(minW,minH){

	if (swfobject.hasFlashPlayerVersion(playerVersion)) {
	
		if(navigator.appName=="Microsoft Internet Explorer")
		{
			// IE do not know min-values
						
			ieW = minW + 'px';
			ieH = minH + 'px';
			if(document.documentElement.clientWidth > minW){
				ieW = '100%';
			}
			if(document.documentElement.clientHeight > minH){
				ieH = '100%';
			}		
			swfobject.createCSS("#flashcontent", "width:" + ieW + "; height:" + ieH + ";");	
		}
		else
		{
			swfobject.createCSS("#flashcontent", "min-width:" + minW + "px; min-height:" + minH + "px;");
		}
	}

}

function ieResize(){
	
	if(navigator.appName=="Microsoft Internet Explorer"){
		dWidth=(window.innerWidth ? window.innerWidth : document.body.offsetWidth);
		dHeight=(window.innerHeight ? window.innerHeight : document.body.offsetHeight);
		dObj = document.getElementById('flashcontent');
				
		if(oldWidth==dWidth && oldHeight==dHeight) return;
		
		
		if(widthType == "percent")
		{
			if(dWidth<minWidth && parseInt(dObj.style.width) != minWidth) {
				dObj.style.width=minWidth+"px";
			}
			else if(dWidth>minWidth && dObj.style.width != "100%") {
				dObj.style.width="100%";
			}
			
		}
		else
		{
			dObj.style.width=curWidth+"px";
		}
		
		if(heightType == "percent")
		{
			if(dHeight < minHeight && parseInt(dObj.style.height)!=minHeight) {											
				dObj.style.height=minHeight+"px";
			}
			else if(dHeight>minHeight && dObj.style.height != "100%") {
				dObj.style.height="100%";
			}
		}
		else
		{
			dObj.style.height=curHeight+"px";
		}
		
		oldWidth = dWidth;
		oldHeight = dHeight;
	}
}
