var minWidth2=1002;
var minHeight2=660;
function getViewportSize() {
	var size = [0, 0];
	if (typeof window.innerWidth != "undefined") {
		size = [window.innerWidth, window.innerHeight];
	}
	else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) {
		size = [document.documentElement.clientWidth, document.documentElement.clientHeight];
	}
	else {
		size = [document.getElementsByTagName("body")[0].clientWidth, document.getElementsByTagName("body")[0].clientHeight];
	}
	return size;
}
function createFullBrowserFlash() {
	if(document.getElementById("animacao") != undefined){
		swfobject.createCSS("html", "height:100%;");
		swfobject.createCSS("body", "height:100%;");
		swfobject.createCSS("#animacao", "margin:0; width:100%; height:100%; min-width:"+minWidth2+"px; min-height:"+minHeight2+"px;");
		window.onresize = function() {
			var el = document.getElementById("animacao");
			var size = getViewportSize();
			el.style.width = size[0] < minWidth2 ? minWidth2+"px" : "100%";
			el.style.height = size[1] < minHeight2 ? minHeight2+"px" : "100%";
		};
		window.onresize();
	}
}
if (swfobject.hasFlashPlayerVersion("6.0.0")) {
	swfobject.addDomLoadEvent(createFullBrowserFlash);
}

/* ========================================================================================== */ 

var minWidth=1002;
var minHeight=630;
function createCSS(selector, declaration) {
	// test for IE
	var ua = navigator.userAgent.toLowerCase();
	var isIE = (/msie/.test(ua)) && !(/opera/.test(ua)) && (/win/.test(ua));

	// create the style node for all browsers
	var style_node = document.createElement("style");
	style_node.setAttribute("type", "text/css");
	style_node.setAttribute("media", "screen"); 

	// append a rule for good browsers
	if (!isIE) style_node.appendChild(document.createTextNode(selector + " {" + declaration + "}"));

	// append the style node
	document.getElementsByTagName("head")[0].appendChild(style_node);

	// use alternative methods for IE
	if (isIE && document.styleSheets && document.styleSheets.length > 0) {
		var last_style_node = document.styleSheets[document.styleSheets.length - 1];
		if (typeof(last_style_node.addRule) == "object") last_style_node.addRule(selector, declaration);
	}
};

function getViewportSize() {
	var size = [0, 0];
	if (typeof window.innerWidth != "undefined") {
		size = [window.innerWidth, window.innerHeight];
	}
	else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) {
		size = [document.documentElement.clientWidth, document.documentElement.clientHeight];
	}
	else {
		size = [document.getElementsByTagName("body")[0].clientWidth, document.getElementsByTagName("body")[0].clientHeight];
	}
	return size;
}
function redimensionajanela() {
	//alert ('teste');
	document.getElementById('site').style.minHeight = '100%';
	var el = document.getElementById("site");
	createCSS("html", "height:100%;");
	createCSS("body", "height:100%;");
	createCSS("#site", "margin:0; width:100%; height:100%; min-width:"+minWidth+"px; min-height:"+minHeight+"px;");
	window.onresize = function() {
		//alert (el);
		var el = document.getElementById("site");
		var size = getViewportSize();
		el.style.width = size[0] < minWidth ? minWidth+"px" : "100%";
		el.style.height = size[1] < minHeight ? minHeight+"px" : "100%";
	};
}
function quebraredimensiona() {
	var el = document.getElementById("site");
		window.onresize = function() {
	}
	createCSS("html", "height:inherit;");
	createCSS("body", "height:inherit");
	createCSS("#site", "margin:0; width:inherit; height:inherit; min-width: 100%; min-height:100%;");
}