var minWidth = 1044; //COLOCAR LARGURA MÍNIMA DO FLASH PARA IE6
var minHeight = 720; // COLOCAR ALTURA MÍNIMA DO FLASH PARA IE6

/* ************************************************************** +document ready ************************************************************* */
$(document).ready(
	function(){
		if(notSupMaxPropert()) { //ie6
			flashMinMsieProperties();
		}
		rels();	
	}
);
/* ************************************************************** end document ready ************************************************************ */


/* *************************************************************** +window resize *************************************************************** */

$(window).resize(
	function(){
		if(notSupMaxPropert()) {
			flashMinMsieProperties();
		}
	}
);

/* *************************************************************** end window resize ************************************************************ */


/* *********************************************************** +document ready functions ********************************************************* */
function rels() {
	$("a[rel*=external]").attr("target", "_blank");
}
/* *********************************************************** end document ready functions ********************************************************* */


/* ******************************************************************* +ie hacks ******************************************************************* */
function flashMinMsieProperties() {
	var tWindow = $(window); // this window = esta janela 
	
	if(tWindow.width() <= minWidth) { 		
		$('html, body, #wrapper').css("width", minWidth + "px");
	}
	else {
		$('html, body, #wrapper').css("width","100%");
	}
	if(tWindow.height() <= minHeight) { 
		$('html, body, #wrapper').css("height", minHeight + "px");
	}
	else {
		$('html, body, #wrapper').css("height","100%");
	}
}

function notSupMaxPropert() { // não suporta CSS max properties
	if (typeof document.body.style.maxHeight === "undefined") return true;
	else return false;
}
/* ***************************************************************** end ie hacks ****************************************************************** */


/* +url parser */
function parseQueryString(queryString){
	var result = {};
	if (queryString == undefined) queryString = location.search ? location.search : '';
	if (queryString.charAt(0) == '?') queryString = queryString.substring(1);
	queryString = queryString.split('#')[0];
	queryString = queryString.replace('+', ' ');
	var queryComponents = queryString.split(/[&;]/g);
	for (var i = 0; i < queryComponents.length; i++){
		var keyValuePair = queryComponents[i].split('=');
		var key = decodeURIComponent(keyValuePair[0]);
		var value = decodeURIComponent(keyValuePair[1]);
		if (!result[key]) result[key] = [];
		result[key].push((keyValuePair.length == 1) ? '' : value);
	}
	return result;
}
/* end url parser */