// JavaScript Document

var callFlashFunction = function(nome,cena) {
         var isIE = navigator.appName.indexOf ("Microsoft") != -1;
         //if(isIE) var movieID = window["ofilme"];
		 if(isIE) var movieID = window.document.getElementById("ofilme");
         else var movieID = window.document["ofilme"];

		 movieID.SetVariable("_root.functionName", nome);
         movieID.SetVariable("_root.cena", cena);
         movieID.SetVariable("_root.flag", true);
};

jQuery.preloadImages = function() {
  for(var i=0; i<arguments.length; i++)   {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

$(function(){
	$.preloadImages("img/bg_vermelho.png","img/bg_azul.png","ani_home1.jpg","ani_home2.jpg","ani_home3.jpg","ani_home4.jpg","ani_home5.jpg","ani_home6.jpg","ani_home7.jpg");
	
	if($("#ani_carousel").length>0) { // plug-in Carousel (animação imagens)
		$("#ani_carousel").jMyCarousel({
			mouseWheel: true,
			visible: '100%',
			auto: true, 
			speed: 1000,
			evtStart: 'mouseout',
			evtStop: 'mouseover'
		});
	}
	
	$("a[href$=jpg]").click(function() { // links para imagens
		var tmpImg = new Image();
		tmpImg.src=$(this).attr("href");
		var wImg = $(tmpImg).attr("width");
		var hImg = $(tmpImg).attr("height");
		if (wImg<50) wImg=500;
		if (hImg<50) hImg=400;

		var hImg = $(tmpImg).attr("height");
		var atrJan = 'scrollbars=yes,resizable=yes,width='+(wImg+50)+',height='+(hImg+50);

		window.open($(this).attr("href"), 'popup',atrJan);
		return false;
	});
	
});

