BETimer = null; function posiciona01(s){if(document.layers){return document.layers[s];}else if(document.all && !document.getElementById) {return document.all[s];}else {return document.getElementById(s);}} function posiciona02(s,x,y){_o = posiciona01(s);_o.style.width=x+'px';_o.style.height=y+'px';} /* Shadowbox */ obj = { close: function() { if(!active) return; // already closed active = false; listenKeys(false); // remove the content if(S.content){ S.content.remove(); S.content = null; } // clear slideshow variables if(typeof slide_timer == 'number') clearTimeout(slide_timer); slide_timer = null; slide_delay = 0; if(S.options.onClose) S.options.onClose(); S.skin.onClose(); S.revertOptions(); // reset troublesome elements to stored visibility settings each(v_cache, function(c){ c[0].style.visibility = c[1]; }); } } // captcha function RefreshImage(valImageId) { var objImage = document.images[valImageId]; if (objImage == undefined) { return; } var now = new Date(); objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString(); } // arrendondar DIVs function arredonde(objSettings, selector) { $(selector).each(function(){ if ($(this).find('img:first').height() < 10){ objectSelf = this; setTimeout(function(){ arredonde(objSettings, objectSelf); },1000); }else{ $(this) .find('img:first') .css({'width':$(this).find('img:first').width() + 'px','height':$(this).find('img:first').height() + 'px'}); $(this) .css({'background-image':'url('+$(this).find('img:first').attr('src')+')','width':$(this).find('img:first').width() + 'px','height':$(this).find('img:first').height() + 'px'}) .find('img:first') .attr('src','imgs/pix.gif'); curvyCorners(objSettings, this); } }); } /* Funções de cookie http://www.quirksmode.org/js/cookies.html */ function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length,c.length)).replace(/[+]/g,' '); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } var blank = new Image(); blank.src = '/legba/site/imgs/pix.gif'; function fixPng(png) { // get src var src = png.src; // set width and height if (!png.style.width) { png.style.width = $(png).width(); } if (!png.style.height) { png.style.height = $(png).height(); } // replace by blank image png.onload = function() { }; png.src = blank.src; // set filter (display original image) png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')"; } $(document).ready(function() { /* PNGs */ var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32"); if (badBrowser) $('img[src$=.png]').each(function() { if (!this.complete) this.onload = function() { fixPng(this) }; else fixPng(this); }); }); //Shadowbox = $.fn.extend(Shadowbox,obj); function createAudioPlayer(url,titulo){ if (url.toLowerCase().indexOf(".mp3") >= 0){ Shadowbox.open({ content: url, player: 'flv', title: (titulo == "" ? 'Áudio' : titulo), slideshowDelay:'0', continuous: false, language: 'pt-br', handleOversize: 'drag', enableKeys: false, width: '530', height: '0', options: { onFinish: function(){ $('#sb-wrapper').show(); }, flashVars: { autostart: true, volume: '100', quality: true, bufferlength: '12' } } }); }else{ Shadowbox.open({ content: url, player: 'wmp', title: (titulo == "" ? 'Áudio' : titulo), slideshowDelay:'0', continuous: false, language: 'pt-br', handleOversize: 'drag', enableKeys: false, width: '530', height: '0', options: { onFinish: function(){ $('#sb-wrapper').show(); } } }); // content: '
', // player: 'html', // title: 'Áudio', // slideshowDelay:'0', // continuous: false, // language: 'pt-br', // handleOversize: 'drag', // enableKeys: false, // width: '530', // height: '20', // options: { // onFinish: function(){ // $('#sb-wrapper').show(); // var cnt = $('#videoScreen')[0]; // var src = '/legba/libs/shadowbox/libraries/mediaplayer/wmvplayer.xaml'; // var cfg = { // autostart: 'true', // backcolor:'000000', // frontcolor:'CCCCCC', // lightcolor:'557722', // file:url, // height:'20', // volume:'100', // overstretch:'true', // showstop:'true', // width:'530' // }; // ply = new jeroenwijering.Player(cnt,src,cfg); // } // } } } function createVideoPlayer(url,titulo){ if (url.toLowerCase().indexOf(".flv") >= 0){ Shadowbox.open({ content: url, player: 'flv', title: (titulo == "" ? 'Vídeo' : titulo), slideshowDelay:'0', continuous: false, language: 'pt-br', handleOversize: 'drag', enableKeys: false, width: '530', height: '355', options: { onFinish: function(){ $('#sb-wrapper').show(); }, flashVars: { autostart: true, volume: '100', quality: true, bufferlength: '12' } } }); }else{ Shadowbox.open({ content: url, player: 'wmp', title: (titulo == "" ? 'Vídeo' : titulo), slideshowDelay:'0', continuous: false, language: 'pt-br', handleOversize: 'drag', enableKeys: false, width: '530', height: '355', options: { onFinish: function(){ $('#sb-wrapper').show(); } } }); // content: '', // player: 'html', // title: 'Vídeo', // slideshowDelay:'0', // continuous: false, // language: 'pt-br', // handleOversize: 'drag', // enableKeys: false, // width: '530', // height: '355', // options: { // onFinish: function(){ // $('#sb-wrapper').show(); // var cnt = $('#videoScreen')[0]; // var src = '/legba/libs/shadowbox/libraries/mediaplayer/wmvplayer.xaml'; // var cfg = { // autostart: 'true', // backcolor:'000000', // frontcolor:'CCCCCC', // lightcolor:'557722', // file:url, // height:'355', // volume:'100', // overstretch:'true', // showstop:'true', // width:'530' // }; // ply = new jeroenwijering.Player(cnt,src,cfg); // } // } } } function isEmail(email){ if(email.indexOf('@',0) == -1 || email.indexOf('@',0) == 0 || email.indexOf('.',0) == -1 || email.indexOf('@.',0) != -1 || email.indexOf(',',0) != -1 || email.indexOf('@',0) == email.length-1 || email.indexOf('@',0) != email.lastIndexOf('@')){ return false } return true; } function isDate(cData) { var data = cData; var tam = data.length; if (tam != 10) { return false; } var dia = data.substr(0,2) var mes = data.substr(3,2) var ano = data.substr(6,4) if (ano < 1900 && parseInt(ano) == ano) { return false; } if (data.substr(2,1) != "/" || data.substr(5,1) != "/"){ return false; } switch (mes) { case '01': if (dia <= 31) return (true); break; case '02': if (dia <= 29) return (true); break; case '03': if (dia <= 31) return (true); break; case '04': if (dia <= 30) return (true); break; case '05': if (dia <= 31) return (true); break; case '06': if (dia <= 30) return (true); break; case '07': if (dia <= 31) return (true); break; case '08': if (dia <= 31) return (true); break; case '09': if (dia <= 30) return (true); break; case '10': if (dia <= 31) return (true); break; case '11': if (dia <= 30) return (true); break; case '12': if (dia <= 31) return (true); break; } { return false; } return false; } // lefttime=null; posicao = 0; iedom=document.all||document.getElementById; function moveDiv(id,direcao,tamanho,velocidade){ //clearInterval(destaqueTimer); cross_slide=document.getElementById(id); larg = cross_slide.style.width.replace("px",""); if ((posicao+velocidade <= 0 && direcao > 0) || (posicao-velocidade >= larg*-1 && direcao < 0 && posicao-velocidade >= (parseInt(larg) - parseInt(tamanho * parseFloat((larg/tamanho)-parseInt(larg/tamanho)))) * -1) && posicao-tamanho > larg*-1) { if (lefttime==null) lefttime=setInterval("moveDiv('"+id+"',"+direcao+","+tamanho+","+velocidade+")",30); if (direcao < 0) { posicao -= velocidade; } else if (direcao > 0) { posicao += velocidade; } if (iedom){ cross_slide.style.left=posicao+"px"; } if ((posicao % tamanho == 0)) { clearInterval(lefttime); lefttime = null; } }else{ clearInterval(lefttime); lefttime = null; } } var current = 0; function anterior(campo, q, total){ if (current-1 < 0){ current = total; } muda(campo, q, current-1, total); } function proximo(campo, q, total){ if (current+1 >= total){ current = -1; } muda(campo, q, current+1, total); } function muda(campo, q, m, total){ current = m; clearInterval(eval(campo)); eval("qtd" + campo + " = 1"); for (i=0;i"+xmlHttpMalaDireta.responseText+"