// JavaScript Document

host = "/";

var jsFiles = new Array (
			host + "Scripts/jswf.js",
			host + "Scripts/winlite-v2.js"
	);

$.include(jsFiles,
		  
function () {
	$(document).ready(
		function () {
			$("*").each(
				function () {
					if ($(this).css("float") !== "none") $(this).css("display", "inline");
				}
			);
			//
			//
			$(".swfPub").each(function () {
				var txt = $(this).text();
				var ar = txt.split("&");
				var src = ar[0];
				var options = {
					src : host + src,
					wmode : 'opaque'
				}
				var w = ar[1];
				var h = ar[2];
				if (w != "x") options.width = w;
				if (h != "x") options.height = h;
				$(this).html('');
				$(this).css({
					zIndex:1
				});
				$(this).flash(options);
				//
				//
				var iPub = $(this).parent(".iPub");
				var mask = $(this).parent().parent(".publicidade").find(".divBtnMask");
				var wD = iPub.width();
				var hD = iPub.height();
				var xD = iPub.offset().left;
				var yD = iPub.offset().top;
				mask.css({
					position: "absolute",
					left:xD,
					top:yD,
					width:wD,
					height:hD,
					backgroundColor : "#000000",
					opacity : 0
				});
			});
			$(".linkImgMaisCliq, .linkImgCatMais").css({
				float :"left",
				overflow : "hidden",
				cursor : "pointer",
				border : 0
			});
			$(".linkImgMaisCliq, .linkImgCatMais").hover(
				function () {
					$(this).css({
						border : "3px solid #f30"
					});
					$("img", this).css({
						margin :  -3
					});
				}, 
				function () {
					$(this).css("border", "none");
					$("img", this).css({
						margin :  0
					});
				}
			);
			//
			//
			$("#destaques").flash({
				src: host + "flash/destaque.swf",
				height:"310",
				width:"510",
				wmode:"opaque"
			});
			var logo = $("#uk");
			logo.css({
				width : 42,
				height : 60,
				position : 'fixed',
				right : 0,
				zIndex : 5,
				top : "100%",
				marginTop : -80
			});
			logo.data("cima", "false");
			logo.hover(
				function () {
					logo.data("cima", "true");
					logo.css ({
						width : 135,
						height : 60
					});
				},
				function () {
					logo.data("cima", "false");
					setTimeout(
						function () {
							if (logo.data("cima") == "false") {
								logo.css ({
									width : 42,
									height : 60
								});
							}
						},2000);
				}
			);
			logo.flash({
				src : host + "flash/logoUnika.swf",
				width : '100%',
				height : '100%',
				wmode : 'transparent'
		   });			
		}
	);
});

function horaCerta() {
	var data = new Date();
	var ano = data.getFullYear();
	var dat = data.getDate();
	var mes = data.getMonth();
	var hora = data.getHours();
	var dia = data.getDay();
	var minuto = data.getMinutes();
	var segundo = data.getSeconds();
	
	var	arrayDia = Array(
		"Domingo",
		"Segunda-Feira",
		"Terça-Feira",
		"Quarta-Feira",
		"Quinta-Feira",
		"Sexta-Feira",
		"Sábado"
	);
	
	var arrayMes = Array(
		"Janeiro",
		"Fevereiro",
		"Março",
		"Abril",
		"Maio",
		"Junho",
		"Julho",
		"Agosto",
		"Setembro",
		"Outubro",
		"Novembro",
		"Dezembro"
	);
	
	mes = arrayMes[mes];
	dia = arrayDia[dia];
	
	hora = (hora<10) ? "0"+hora : hora;
	minuto = (minuto<10) ? "0"+minuto : minuto;
	segundo = (segundo<10) ? "0"+segundo : segundo;
	
	var formato = "Sombrio / SC, " + dia + ", " + dat + " de " + mes + " de " + ano + " - " + hora + ":" + minuto + ":" + segundo;
	
	$("#data_hoje").html(formato);
	
	setTimeout(horaCerta,1000);
}

horaCerta();
