var content = {};
var flashvars = {
	baseUrl: "http://nestle.icd.com.br/"
};
var params = {
	base:"swf/",
	menu: "false",
	scale: "noScale",
	allowFullscreen: "false",
	allowScriptAccess: "always",
	wmode: "opaque",
	bgcolor: "#FFFFFF"
};
var attributes = {
	//id:"NestleFast"
};

$(document).ready(function()
{
//	alert(screen.width);
//	alert(screen.height);
//	$("body").prepend('<p><a href="#" class="size1">size1</a><a href="#" class="size2">size2</a></p>');
//	$(".size1").click(function()
//	{
////		size("3000");
//		hide_window()
//		return false;
//	});
//	
//	$(".size2").click(function()
//	{
////		size("100%");
//		show_window("http://www.globo.com")
//		return false;
//	});
	hide_window();
		
	var size = $(window).height() - 48;
	swfobject.embedSWF("swf/index.swf", "altContent", "100%", size, "9.0.0", "swf/expressInstall.swf", flashvars, params, attributes);
	
	$(window).resize(function()
	{
		manageLayout();
	});
	
	var size1 = $(window).height();
	var size2 = window.innerHeight;
});


function manageLayout(){
	var size = $(window).height() - 48;	
	$("#altContent").height(size + "px");
}

function show_window(url)
{
//	window.open('/' + url + '/', 'palco'); 
	window.open( url, 'palco' );
	$(".jqmWindow").show();
}

function hide_window()
{
	$(".jqmWindow").hide();
	$(".jqmWindow iframe").attr("src","loader.html");
}

function size(value)
{
//	alert(value);
	var body = parseInt( screen.height );
	var size = parseInt( value );
	
	if(value == "100%")
		$("#NestleFast").height(value);
	else
		if(body <= size)
			$("#NestleFast").height(value + "px");


	try
	{
		var h = $("#NestleFast").height();
		document.getElementById("NestleFast").hideSky_flashFunction(h);
	}
	catch(err)
	{
		//alert("uups;")
	}
}

// FACEBOOK FUNCTIONS -------------------------------------------------
function invite() {
	open('http://quesomeesse.nestle.maya.im/invite.aspx');
}
function challenge(id) {
	open('http://quesomeesse.nestle.maya.im/challenge.aspx?id='+id);
}
// --------------------------------------------------------------------
