﻿var isset = false;
function resizeSWF(){

	var bodyHeight = jQuery("#MainInnerWrapper").height();
	var windowHeight = window.innerHeight;
	if(isNaN(windowHeight)){
		windowHeight = document.documentElement.clientHeight;
	}
    
	var offset = 0;//80;
	//if it's ie6 then add to the offset
	if (navigator.userAgent.toLowerCase().indexOf("safari") != -1){ 
		offset = 0;//80;
	}

	//if the body is larger than the window
	//set the background swf to the body height
	if(window.location.search.toLowerCase().indexOf("mode=") == -1){
		if(bodyHeight > windowHeight){
			jQuery("#BackImage").attr("height", bodyHeight + offset);
		}
		//else set the swf size to windowheight
		else {
			jQuery("#BackImage").attr("height", windowHeight + offset);
		}
	}
}

jQuery(document).ready(function(){
	//resizeSWF();
	setTimeout("resizeSWF()","1250");
});

window.onresize = function() {
    resizeSWF();
}
