function getIEversion(){
	ie_version = "";	
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
	 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
	 if (ieversion>=8){
	  browserVer= 8;
	 }else if (ieversion>=7){
	  browserVer= 7;
	 }else if (ieversion>=6){
	  browserVer=6;
	 }else if (ieversion>=5){
	  browserVer=5;
	 }
	 
	 if(browserVer < 7){
		//alert('You are using old web browser. Some errors may occure. IE' + browserVer);
		 ie_version = 'IE6';
	 
	 }
	
	}
	return ie_version;

}


function setFlashWidth(divid, newW, type)
{
	if(divid == 'mainflash'){divid = 'flashcontent';}
	if(type == "percent") {
		document.getElementById(divid).style.width = newW+"%";		
	}else if(type == "pixel") {
		document.getElementById(divid).style.width = newW+"px";
	}
}
function setFlashHeight(divid, newH, type)
{
	if(divid == 'mainflash'){divid = 'flashcontent';}
	if(type == "percent") {
		document.getElementById(divid).style.height = newH+"%";		
	}else if(type == "pixel") {
		document.getElementById(divid).style.height = newH+"px";
	}
}
function setFlashSize(divid, newW, newH, widthType, heightType)
{

	if(getIEversion() != 'IE6'){

		if(divid == 'mainflash'){divid = 'flashcontent';}
	
		if(newW) setFlashWidth(divid, newW, widthType);
		if(newH) setFlashHeight(divid, newH, heightType);
	
	}
}
function backToTop() 
{
	if(getIEversion() != 'IE6'){
		window.scrollTo(0,0);
	}
}
function setPosTo(y) 
{
	if(getIEversion() != 'IE6'){
		window.scrollTo(0,y);
	}
}
function doAlert(value)
{
	alert(value);
}

function setFlashMinSize(minW,minH){

	if (swfobject.hasFlashPlayerVersion("6.0.0") && getIEversion() != 'IE6') {
	
		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" && getIEversion() != 'IE6'){
		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(dWidth<minWidth && parseInt(dObj.style.width) != minWidth) {
			dObj.style.width=minWidth+"px";
		}
		else if(dWidth>minWidth && dObj.style.width != "100%") {
			dObj.style.width="100%";
		}

		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%";
		}
		oldWidth = dWidth;
		oldHeight = dHeight;
	}
}
oldWidth=oldHeight=0;	
