var min_width = 1000; //800;
var min_height = 650;
var d = new Date();
var last_update = 0;


function resize() {
	//alert("resize");
	var wrapper_div;
	var flash_div;
	var current_width;
	var current_height;
	var mod;
	var is_ie;
	
	
	
	
	if(browser.isIE4up) {	//IE
		wrapper_div			= document.all['wrapper'];
		flash_div 			= document.all['flashcontent'];
		
		//if(browser.isIE5x){
			current_width 		= document.body.clientWidth;			// ie 5-6 quirks mode
			current_height 		= document.body.clientHeight;
		//}
		
		/*if(browser.isIE6up){
			current_width		= document.documentElement.clientWidth;
			current_height 		= document.documentElement.clientHeight;  	// only on ie 6+
		}*/
		mod					= 0;
		is_ie				= true;
		
		//alert("current_width: "+current_height);
		
	}else {					// OTHERS
		wrapper_div			= document.getElementById("wrapper");
		flash_div 			= document.getElementById("flashcontent");  
		current_width 		= window.innerWidth;
		current_height 		= window.innerHeight;
		mod 				= 2;
		is_ie				= false;
	}
	
	// set minimum width
	var w = (current_width < min_width) ? min_width : current_width;
	var corrected_width = new String(String(w-mod)+"px");
	
	// set the width
	//flash_div.style.width = corrected_width;
	
	
	
	// set minimum height 
	var h = (current_height < min_height) ? min_height : current_height;
	
	if (current_height < min_height) {
		window.status = "current_height: " + current_height + " corrected: " + corrected_height;
		//window.status = "ie resize: " + d.valueOf() + " [" + current_height + ", " + min_height + ", " + corrected_height + "]";

		// set the height
		if(!is_ie){
			//flash_div.style.height = corrected_height;
			wrapper_div.style.marginTop = "0px";
			wrapper_div.style.top = "0";
		}else{ // ie will fire it's own onresize, wait 10 milliseconds to break the endless loop
			var d2 = new Date();
			if( (d2.valueOf() - last_update) > 10){
				//flash_div.style.height = corrected_height;
				wrapper_div.style.marginTop = "0px";
				wrapper_div.style.top = "0";
			}
		}
	} else {
		wrapper_div.style.marginTop = "-325px";
		wrapper_div.style.top = "50%";
	}
	var corrected_height = new String(String(h-mod)+"px")
	

	
	last_update = d.valueOf();
}