/* 
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 min_Width = 'null';
var min_Height = 'null';
function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
}
function setFlashHeight(divid, newH){
	//alert(newH);
	document.getElementById(divid).style.height = newH+"px";		
}
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;
}

function reportSize() {
    myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
        if(myWidth < 960){
            document.getElementById('flashid').style.width = 960+"px";
        }else{
            document.getElementById('flashid').style.width = '100%';
        }
        
        if(myHeight < 695){
            document.getElementById('flashid').style.height = 695+"px";
            }else{
            document.getElementById('flashid').style.height = '100%';
        }

    } else {
        if( document.documentElement &&
            ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;
            
            if(myWidth < 960){
                document.getElementById('flashid').style.width = 960+"px";
                }else{
                document.getElementById('flashid').style.width = '100%';
            }
            
            if(myHeight < 695){
                document.getElementById('flashid').style.height = 695+"px";
                }else{
                document.getElementById('flashid').style.height = '100%';
            }

        } else {
            if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                myWidth = document.body.clientWidth;
                myHeight = document.body.clientHeight;
                
                if(myWidth < 960){
                    document.getElementById('flashid').style.width = 960+"px";
                    }else{
                    document.getElementById('flashid').style.width = '100%';
                }
                
                if(myHeight < 695){
                    document.getElementById('flashid').style.height = 695+"px";
                    }else{
                    document.getElementById('flashid').style.height = '100%';
                }

            }
        }
    }
}
function doTest(){
reportSize();
//document.getElementById("currentvalues").innerHTML = "Current inner: "+myWidth+"*"+myHeight;
}
function init(minW, minH){
    min_Width = minW;
    min_Height = minH;
    window.onresize = doTest;
    doTest();
}