function checkBrowserFit(object, width, height, url){
    /* ---------------------------------------------------------------------------
       © Copyright 2004 Joseph Balderson & Joseph Balderson Design
       :: http://www.memoriesofsilence.com ::
       Please share this code, but always give credit where it's due.

       This function first determines the inner width and height of the browser
       in a cross browser-compatible way; then it checks, if the inner browser
       size is less than the min. size of our flash movie, make the DIV wrapper
       expand to fit the flash movie, forcing a document scroll (which cannot be
       accomplished from flash alone); otherwise max out the DIV size so our
       flash movie can expand to fit the window. This script is best activated
       with both onLoad() and onResize() event handlers in the BODY tag.

       Example: onLoad="checkBrowserFit('flashObj', 640, 620, 'none');"

       Function Parameters:
       'object' is the CSS id & name of the DIV tag wrapping the flash movie;
       'width' & 'height' are the minimum dimensions of the flash movie that
          we want the inside browser window to conform to;
       'url' is the redirect url for non-DOM-compliant browsers (may be a
          relative, root relative or absolute document path); if url='none'
          then redirect is inactive and the script fails silently. 

       This function should work in all IE5+ NS6+ Opera 6+ browsers.
    --------------------------------------------------------------------------- */
	// first check if the browser is DOM-compatible
	if (document.getElementById) {
	    // loop it twice to adjust for scrollbar appearance
	    for( i = 1; i <= 2; i++ ) {
		// GET BROWSER-COMPATIBLE INNER WIDTH & HEIGHT
		// code thanks to http://www.howtocreate.co.uk/tutorials/index.php?tut=0&part=16
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4&5 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		// TEST FOR FLASH OBJ <-> INNER BROWSER SIZING
		if (myWidth < width) {
			document.getElementById(object).style.width = width;
			horizScr = true; // horiz scrollbars are present
		} else {
			document.getElementById(object).style.width = "100%";
			horizScr = false;
		}
		if (myHeight < height) {
			document.getElementById(object).style.height = height;
		} else {
		    // account for IE 5 height quirk based on presence of horiz scrollbar
		    if (horizScr) {
			document.getElementById(object).style.height = "97%";
		    } else {
			document.getElementById(object).style.height = "100%";
		    }
		}
	    }
 	    //window.alert("innerWidth = " + myWidth + "; innerHeight = " + myHeight);
	} else if(url!='none') {
		// BROWSER REDIRECT for non-DOM compliant broswers
		window.location = url;
	}
}
function popBrowserSBars(width, height){
	window.alert("new width = " + width + " | new height = " + height);
	if (document.getElementById) {
		document.getElementById("flashObj").style.height = height;
		document.getElementById("flashObj").style.width = width;
	}
}
