function loadMenus(idioma,marcaID){ $.ajax({ url: 'pushmenu.php', data: 'idiom='+idioma+'&idmarca='+marcaID, dataType: 'json', type: 'GET', success: function(data){ $('#menuabout').html(data['menuMarca']); } }); $.ajax({ url: 'pushabouts.php', data: 'idiom='+idioma+'&idmarca='+marcaID, dataType: 'json', type: 'GET', success: function(data){ $('#menucredits').html(data['menuCreditos']); } }); $.ajax({ url: 'pushbase.php', data: 'idiom='+idioma+'&idmarca='+marcaID, dataType: 'json', type: 'GET', success: function(data){ var boundry = parseInt(8) * parseInt(data['numBase']); var num = data['numBase']; $('#menulinks').append(data['menuBase']); var soma = 0; for(i=1;i<=num;i++){ soma += $('.nbase'+i).width(); } var total = parseInt(soma) + parseInt(boundry)+parseInt(3)+"px"; $('#menubase').css({'display':'none'}); //$('#menubase').css({'width':total}); $('#menubase').fadeIn('slow'); reloadmenu(); } }); topreload(); } // var Creditos = -1; function openCredits(){ if($('#menuabout').css('display')=="block"){ $('#infomenus #scroller .texto').fadeOut(1000); $('#infomenus').animate({right:'-188px'},1000); if($('#infoForm').css('width')=='220px'){ $('#infoForm').animate({width:'0px'},1000); } $('#menuabout a').removeClass('selected'); $('#menuabout').fadeOut('fast'); //$('#ftlogo').attr('onClick','openftmenu()'); } if($('#infomenus').css('right')=='0px'){ if($('#infoForm').css('width')=='220px'){ $('#infoForm').animate({width:'0px'},1000); } $('#infomenus #scroller .texto').fadeOut(1000); $('#infomenus').animate({right:'-188px'},1000) } $('#menucredits').fadeIn('fast'); $('#crchar').attr('onClick','closeCredits()'); Creditos = 1; topreload(); reloadmenu(); } function closeCredits(){ if($('#infocredits').css('display')=="block"){ $('#infocredits').fadeOut('fast',function(){$('#infocredits #scroll .textus').html('');}); } if(seltd == 1){ if($('#btnab'+active).hasClass('selected')){ $('#btnab'+active).animate({color:'#870000'},'fast',function(){$(this).removeClass('selected'); }); } } $('#menucredits a').removeClass('selected'); $('#menucredits').fadeOut('fast'); $('#crchar').attr('onClick','openCredits()'); topreload(); active = 0; seltd = 0; Creditos = -1; openedView = 0; topreload(); return openedView; return active; return seltd; return Creditos; } function openftmenu(){ if($('#menucredits').css('display')=="block"){ $('#infocredits').fadeOut('fast',function(){$('#infocredits .textus').html('');}); $('#menucredits a').removeClass('selected'); $('#menucredits').fadeOut('fast'); $('#crchar').attr('onClick','openCredits()'); } $('#menuabout').fadeIn('fast'); //$('#ftlogo').attr('onClick','closeftmenu()'); } function closeftmenu(){ if($('#infomenus').css('right')=="0px"){ $('#infomenus #scroller .texto').fadeOut(1000); $('#infomenus').animate({right:'-188px'},1000); if($('#infoForm').css('width')=='220px'){ $('#infoForm').animate({width:'0px'},1000); } } $('#menuabout a').removeClass('selected'); $('#menuabout').fadeOut('fast'); //$('#ftlogo').attr('onClick','openftmenu()'); } function loadthissub(ID,idiom){ $.ajax({ url: 'pushbase.php', data: 'idiom='+idiom+'&idmenu='+ID+'&submenu=1', dataType: 'json', type: 'GET', success: function(data){ $('#hidden'+ID).html(data['subMenubase']); $('#hidden2'+ID).html(data['heightmenu']); } }); } /************* Ver textos do menu ? ****************/ function viewAbout(menu,lang,marca){ if(seltd == 1){ if($('#btnab'+active).hasClass('selected')){ $('#btnab'+active).animate({color:'#870000'},'fast',function(){$(this).removeClass('selected'); }); } } active = menu; seltd = 1; $('#btnab'+menu).addClass('selected'); $.ajax({ url: 'pushabouts.php', data: 'idiom='+lang+'&idmarca='+marca+'&idmenu='+menu+'&texto=1', dataType: 'json', type: 'GET', success: function(data){ var altsection = parseInt(GetHeight()) - (parseInt($('#header').height() + $('#footer').height())) - 40; var altinfocredits = parseInt($('#header').height() + $('#menucredits').height()) + 30; var heightcredits = parseInt(altsection - (parseInt($('#menucredits').height() + 20))); $('#infocredits').css({'height': heightcredits}); $('#infocredits #scroll').css({'height': parseInt(heightcredits - 22)+'px'}); $('#infocredits').css({'top': altinfocredits}); console.log('altsection:'+altsection+'px , altinfocredits:'+altinfocredits+'px , heightcredits:'+heightcredits+'px $(\'#infocredits\').css(\'display\')=='+$('#infocredits').css('display')); if($('#infocredits').css('display')=='none'){ $('#infocredits #scroll .textus').html(data['textoCreditos']); $('#infocredits').fadeIn('fast'); } if($('#infocredits').css('display')=='block'){ $('#infocredits #scroll .textus').fadeOut('slow',function(){$(this).html(data['textoCreditos']).fadeIn('slow');}); //$('#infocredits #scroll .textus').fadeOut('fast').delay(250).html(data['textoCreditos']).delay(250).fadeIn('fast'); } } }); openedView = 1; return openedView; return active; return seltd; } /********************* submenus do menu base *************/ var lastselected = ''; var openbase = ''; function openbasemenu(id,lang){ $('#btnbase'+id).addClass('selected'); if(lastselected !='' && lastselected!=id){ $('#btnbase'+lastselected).animate({color:'#870000'},'fast',function(){$(this).removeClass('selected'); }); } lastselected = id; openbase = 1; if($('#menucredits').css('display')=="block"){ $('#infocredits').fadeOut('fast',function(){$('#infocredits .textus').html('');}); $('#menucredits a').removeClass('selected'); $('#menucredits').fadeOut('fast'); $('#crchar').attr('onClick','openCredits()'); Creditos = -1; } if($('#menuabout').css('display')=="block"){ $('#infomenus #scroller .texto').fadeOut(1000); $('#infomenus').animate({right:'-188px'},1000); if($('#infoForm').css('width')=='220px'){ $('#infoForm').animate({width:'0px'},1000); } $('#menuabout a').removeClass('selected'); $('#menuabout').fadeOut('fast'); //$('#ftlogo').attr('onClick','openftmenu()'); } abriumenu = 'on'; openSubFoot(id,lang); abriusubmenu = 'on'; return lastselected, openbase, abriusubmen; } function openSubFoot(menuID,lang){ var alturasubmenu = $('#hidden2'+menuID).html(); var alturasubs = alturasubmenu.split('px'); var menusare = $('#hidden'+menuID).html(); if($('#menufooter').height() < 1){ $('#menufooter .contents').html(menusare); $('#menufooter').css({'display':'block'}); $('#menufooter').animate({height:alturasubmenu,paddingBottom:'10px',paddingTop:'10px'},function(){reloadsubs();}); } if($('#menufooter').height() > 0){ $('#menufooter').animate({height:'0px',paddingBottom:'0px',paddingTop:'0px'},function(){$('#menufooter .contents').html(menusare);}).animate({height:alturasubmenu,paddingBottom:'10px',paddingTop:'10px'},function(){reloadsubs();}); } } function closemenubase(ID){ atualLink=''; abriusubmenu=''; //setTimeout(function() { $('#menufooter').animate({height:'0px',paddingTop:'0px', paddingBottom:'0px'}, function(){ $('#menufooter .contents').html(''); $(this).css({'display':'none'}); if($('#btnbase'+ID).hasClass('selected')){ $('#btnbase'+ID).animate({color:'#870000'},'fast',function(){ $(this).removeClass('selected'); if(abriutopo==''){ submenuis='2'; } if(abriutopo=='on'){ submenuis='2'; } $('#header').trigger('mouseleave'); }); } }); //}, 3000); return atualLink; return submenuis; } function moreInfo(){ if($('#infoForm').css('width')=="0px"){ $('#infoForm').animate({width:'220px'},1000); } else { $('#infoForm').animate({width:'0px'},1000); } } var openedp = 0; function openp(idioma){ openedp = 1; $('#menubase,#fullscreen,.login,.about,#logomarca').fadeOut('fast'); $('#footer').animate({bottom:'0px'}); $('#footer').find('#bgfoot').animate({opacity:'1'}); $('#fullblack').fadeIn('fast',function(){ $('.play').fadeIn('fast',function(){ $('.stop').fadeIn('fast',function(){ $('.pause').fadeIn('fast',function(){ $('.recs').fadeIn('fast',function(){ $('.rewind').fadeIn('fast',function(){ $('.fastfwd').fadeIn('fast',function(){}); }); }); }); }); }); var inibar = "314"; var barhalf = "157"; var meioY = GetHeight() / 2; var meioX = GetWidth() / 2; var meioXObj = parseInt(meioX - barhalf)+"px"; var meioYObj = parseInt(meioY - 19.5)+"px"; $('#iconbar').css({'top':meioYObj,'left':meioXObj}); var urlp = $('.ply').attr('href'); var urlstp = $('.sto').attr('href'); var urlpause = $('.pau').attr('href'); var urlrec = $('.rec').attr('href'); var urlrwd = $('.rew').attr('href'); var urlfwd = $('.ffw').attr('href'); $('.ply').attr('href', urlp+'?lang=pt'); $('.sto').attr('href',urlstp+'?lang=pt'); $('.pau').attr('href', urlpause+'?lang=pt'); $('.rec').attr('href',urlrec+'?lang=pt'); $('.rew').attr('href',urlrwd+'?lang=pt'); $('.ffw').attr('href', urlfwd+'?lang=pt'); $(".ply").hover( function(){ $('#playimg').animate({ width: '43px', height: '39px', marginLeft:'0px', marginTop:'0px', opacity:'1'}, {queue:false, duration:'normal'}); $('.play').animate({ width : '203px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:parseInt(meioX - 224.5)+"px",top:meioYObj}); }, function(){ $('#playimg').animate({ width: '27px', height: '24px', marginLeft:'8px', marginTop:'7.5px',opacity:'0.5'}, {queue:false, duration:'normal'}); $('.play').animate({ width : '43px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:meioXObj,top:meioYObj}); }); $(".sto").hover( function(){ $('#stopimg').animate({ width: '40px', height: '39px', marginLeft:'0px', marginTop:'0px', opacity:'1'}, {queue:false, duration:'normal'}); $('.stop').animate({ width : '223px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:parseInt(meioX - 236)+"px",top:meioYObj}); }, function(){ $('#stopimg').animate({ width: '25px', height: '24px', marginLeft:'7.5px', marginTop:'7.5px',opacity:'0.5'}, {queue:false, duration:'normal'}); $('.stop').animate({ width : '40px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:meioXObj,top:meioYObj}); }); $(".pau").hover( function(){ $('#pauseimg').animate({ width: '40px', height: '39px', marginLeft:'0px', marginTop:'0px',opacity:'1'}, {queue:false, duration:'normal'}); $('.pause').animate({ width : '259px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:parseInt(meioX - 254)+"px",top:meioYObj}); }, function(){ $('#pauseimg').animate({ width: '25px', height: '24px', marginLeft:'7.5px', marginTop:'7.5px',opacity:'0.5'}, {queue:false, duration:'normal'}); $('.pause').animate({ width : '40px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:meioXObj,top:meioYObj}); }); $(".rec").hover( function(){ $('#recimg').animate({ width: '40px', height: '39px', marginLeft:'0px', marginTop:'0px',opacity:'1'}, {queue:false, duration:'normal'}); $('.recs').animate({ width : '178px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:parseInt(meioX - 213.5)+"px",top:meioYObj}); }, function(){ $('#recimg').animate({ width: '25px', height: '24px', marginLeft:'7.5px', marginTop:'7.5px',opacity:'0.5'}, {queue:false, duration:'normal'}); $('.recs').animate({ width : '40px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:meioXObj,top:meioYObj}); }); $(".rew").hover( function(){ $('#rewimg').animate({ width: '87px', height: '39px', marginLeft:'0px', marginTop:'0px',opacity:'1'}, {queue:false, duration:'normal'}); $('.rewind').animate({ width : '326px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:parseInt(meioX - 276)+"px",top:meioYObj}); }, function(){ $('#rewimg').animate({ width: '54px', height: '24px', marginLeft:'3px', marginTop:'7.5px',opacity:'0.5'}, {queue:false, duration:'normal'}); $('.rewind').animate({ width : '63px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:meioXObj,top:meioYObj}); }); $(".ffw").hover( function(){ $('#ffwimg').animate({ width: '87px', height: '39px', marginLeft:'0px', marginTop:'0px',opacity:'1'}, {queue:false, duration:'normal'}); $('.fastfwd').animate({ width : '577px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:parseInt(meioX - 401.5)+"px",top:meioYObj}); }, function(){ $('#ffwimg').animate({ width: '54px', height: '24px', marginLeft:'3px', marginTop:'7.5px',opacity:'0.5'}, {queue:false, duration:'normal'}); $('.fastfwd').animate({ width : '63px' }, {queue:false, duration:"normal"} ); $('#iconbar').animate({left:meioXObj,top:meioYObj}); }); }); $('#pushwhite').attr('onClick','closep(\''+idioma+'\')'); topreload() return openedp; } function closep(idioma){ openedp = 0; $('#pushwhite').attr('onClick','openp(\''+idioma+'\')'); $('#footer').animate({bottom:'-44px'}); $('#footer').find('#bgfoot').animate({opacity:'0'}); $('.play').fadeOut('fast'); $('.stop').fadeOut('fast'); $('.pause').fadeOut('fast'); $('.recs').fadeOut('fast'); $('.rewind').fadeOut('fast'); $('.fastfwd').fadeOut('fast',function(){$('#fullblack').fadeOut('fast', function(){$('#menubase,#fullscreen,.login,.about,#logomarca').fadeIn('fast');});}); topreload() return openedp; } //$('#menubase #menufooter .contents a').hover(function(){ $(this).animate({color: '#ff140f'},'fast'); }, function() {$(this).animate({color: '#870000'},'fast');}); function closetop(val){ alert($('#header').css('top')); if($('#header').css('top')=='0px'){ setTimeout(function() { $('#tophead').animate({height:'48px'}); $('#header').animate({top:'-42px'}); $('.backhead').animate({opacity:'0'}); $('.mapholder').animate({top:'20px'}); $('.mapholder .mapbg').animate({opacity:'0'}); Creditos = -1; submenuis = ''; },1000); } else { Creditos = -1; submenuis = ''; } return Creditos, submenuis; } $(document).ready(function(){ var altsection = parseInt(GetHeight()) - (parseInt($('#header').height() + $('#footer').height())) - 40; var altsection2 = parseInt(altsection - 30); var altsectioncredits = parseInt(altsection - $('#menucredits').height()); var heightcredits = parseInt(altsection - parseInt($('#menucredits').height() + 20)); $('#infomenus #scroller').css({'height':parseInt(altsection - 22)+"px"}); $('#infoprojects #scrollers').css({'height':parseInt(altsection2 - 22)+"px"}); $('.mapholder').css({'left':parseInt(meioX - 250)}); $('.mapholder').animate({top:'20px'}); $('.mapholder .mapbg').animate({opacity:'0'}); $('#menubase').css({'margin-left':parseInt(meioX-150)}); $('#menufooter').css({'display':'none'}); loadfstGalery('pt',6); loadMenus('pt',6); $('head').append(''); //scrool texto mousemove $("#scroll").mousemove(function(e) { if($(this).height() < $("#scroll .textus").height()) { var distance = e.pageY - $(this).offset().top; var percentage = distance / $(this).height(); var targetY = -Math.round(($("#scroll .textus").height() - $(this).height()) * percentage); $('#scroll .textus').animate({top: [targetY+"px", "easeOutCirc"]}, { queue:false, duration:200 }); } }); $("#scroller").mousemove(function(e) { if($(this).height() < $("#scroller .texto").height()) { var distance = e.pageY - $(this).offset().top; var percentage = distance / $(this).height(); var targetY = -Math.round(($("#scroller .texto").height() - $(this).height()) * percentage); $('#scroller .texto').animate({top: [targetY+"px", "easeOutCirc"]}, { queue:false, duration:200 }); } }); $("#scrollers").mousemove(function(e) { if($(this).height() < $("#scrollers .texto").height()) { var distance = e.pageY - $(this).offset().top; var percentage = distance / $(this).height(); var targetY = -Math.round(($("#scrollers .texto").height() - $(this).height()) * percentage); $('#scrollers .texto').animate({top: [targetY+"px", "easeOutCirc"]}, { queue:false, duration:200 }); } }); }); function cancelFullScreen(el){ var requestMethod = el.cancelFullScreen||el.webkitCancelFullScreen||el.mozCancelFullScreen||el.exitFullscreen; if (requestMethod) { // cancel full screen. requestMethod.call(el); } else if (typeof window.ActiveXObject !== "undefined") { // Older IE. var wscript = new ActiveXObject("WScript.Shell"); if (wscript !== null) { wscript.SendKeys("{F11}"); } } } function requestFullScreen(el) { var requestMethod = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen; if (requestMethod) { // Native full screen. requestMethod.call(el); } else if (typeof window.ActiveXObject !== "undefined") { // Older IE. var wscript = new ActiveXObject("WScript.Shell"); if (wscript !== null) { wscript.SendKeys("{F11}"); } } return false } function toggleFull() { var elem = document.body; // Make the body go full screen. var isInFullScreen = (document.fullScreenElement && document.fullScreenElement !== null) || (document.mozFullScreen || document.webkitIsFullScreen); if (isInFullScreen) { cancelFullScreen(document); } else { requestFullScreen(elem); } return false; } var elem = document.body; // Make the body go full screen. var fulled='0'; $('#fullscreen').click(function(){ if(fulled=='1'){ //cancelFullScreen(elem); $(this).removeClass('fulled'); fulled = '0'; } else { //requestFullScreen(elem); $(this).addClass('fulled'); fulled = '1'; } toggleFull(); return fulled; }); function reloadsubs(){ $('#menubase #menufooter .contents a').hover(function(){ $(this).animate({color: '#ff140f'},'fast'); }, function() {$(this).animate({color: '#870000'},'fast'); }); $('#menubase #menufooter').mouseenter(function(){ submenuis = '2'; return submenuis;}); $('#menubase #menufooter').mouseleave(function(){ submenuis = '1'; return submenuis; }); } function reloadmenu(){ $('#menubase #menulinks a').mouseenter(function(){ if($(this).hasClass('selected')){ } else { $(this).animate({color: '#ff140f'},'fast'); atualLink = $(this).attr('idmenu'); openbasemenu(atualLink,'pt'); } return atualLink; }); $('#menubase').mouseleave(function(){ abriusubmenu = ''; closemenubase(atualLink); return abriusubmenu; }); $('#crchar, .seta a').hover(function(){ $(this).animate({color: '#ff140f'},'fast'); }, function() { if($(this).hasClass('selected')){ } else {$(this).animate({color: '#870000'},'fast'); }}); $('#menucredits a').hover(function(){ $(this).animate({color: '#ff140f'},'fast'); }, function() {if($(this).hasClass('selected')){ } else {$(this).animate({color: '#870000'},'fast'); }}); } /** recarrega os topo e footer **/ function topreload(){ $('#tophead').mouseenter(function(){ $(this).animate({height:$('#header').height()}); $('#header').animate({top:'0px'}); $('.backhead').animate({opacity:'1'}); $('.mapholder').animate({top:'62px'}); $('.mapholder .mapbg').animate({opacity:'1'}); abriutopo = 'on'; return abriutopo; }); $('#header').mouseleave(function(){ if(Creditos=='1' || openedp=='1' || submenuis=='2' || submenuis=='1' || openLogged=='1'){} else if(Creditos=='-1' || Creditos=='0' || openedp=='0' || submenuis=='0' || openLogged=='0'){ setTimeout(function(){ $('#tophead').animate({height:'48px'}); $('#header').animate({top:'-42px'}); $('.backhead').animate({opacity:'0'}); $('.mapholder').animate({top:'20px'}); $('.mapholder .mapbg').animate({opacity:'0'}); },2000); } }); $('#footer').mouseenter(function(){ $('#thumbnails_wrapper').animate({bottom:'75px'}); $(this).animate({bottom:'0px'}); $(this).find('#bgfoot').animate({opacity:'1'}); }); $('#footer').mouseleave(function(){ if(openedp=='1'){ } else { $('#thumbnails_wrapper').animate({bottom:'20px'}); $(this).animate({bottom:'-44px'}); $(this).find('#bgfoot').animate({opacity:'0'}); } }); } setInterval(function(){ $('#menubase #menulinks a').each(function(){ if(($(this).hasClass('selected')===false) && submenuis=='1'){ submenuis='0'; return submenuis; } }); // console.log('Creditos='+Creditos+' && openedp='+openedp+' && submenuis='+submenuis); }, 33); var activesb = 0; var seltdsb = 0; var openedViewsb = 0; function readSubFoot(id,lang,level){ $('#menufooter').animate({height:'0px',paddingTop:'0px', paddingBottom:'0px'},function(){$('#menufooter .contents').html('');}); loadGalery(lang,id); if($('#infomenus').css('right')=="0px"){ $('#infomenus').animate({right:'-188px'},1000); if($('#infoForm').css('width')=='220px'){ $('#infoForm').animate({width:'0px'},1000); } $('#infomenus #scroller .texto').fadeOut(1000); } if(seltdsb == 1){ if($('#'+oldLevel+'nbase'+activesb).hasClass('selected')){ $('#'+oldLevel+'nbase'+activesb).animate({color:'#870000'},'fast',function(){$(this).removeClass('selected'); }); } } oldLevel = level; activesb = id; seltdsb = 1; $('#'+level+'nbase'+id).addClass('selected'); openedViewsb = 1; return oldLevel; return openedView; return activesb; return seltdsb; } function loadGalery(idioma,marcaID){ $.ajax({ url: 'pushgal.php', data: 'idiom='+idioma+'&idmarca='+marcaID, dataType: 'json', type: 'GET', success: function(datagal){ $('#galderia').html(datagal['gallery']); loadNewGal(datagal['large'],datagal['compctt']); } }); } function loadfstGalery(idioma,marcaID){ $.ajax({ url: 'pushftgal.php', data: 'idiom='+idioma+'&idmarca='+marcaID, dataType: 'json', type: 'GET', success: function(datagals){ $('#galderia').html(datagals['gallery']); loadNewGal(datagals['large'],datagals['compctt']); setTimeout(function(){ $('#footer').animate({bottom:'-44px'}); $('#footer #bgfoot').animate({opacity:'0'}); $('#header').animate({top:'-42px'}); $('.backhead').animate({opacity:'0'}); $('#thumbnails_wrapper').animate({bottom:'20px'}); },2500); } }); } function loadGalerybase(idioma,marcaID,menuID){ $.ajax({ url: 'pushgalbase.php', data: 'idiom='+idioma+'&idmarca='+marcaID+'&idmenu='+menuID, dataType: 'json', type: 'GET', success: function(datagalin){ $('#galderia').html(datagalin['gallery']); loadNewGal(datagalin['large'],datagalin['compctt']); } }); } function loadGalerybase2(idioma,menuID){ $.ajax({ url: 'pushgalbase.php', data: 'idiom='+idioma+'&idmenu='+menuID+'&ulogged=1', dataType: 'json', type: 'GET', success: function(datagal){ $('#galderia').html(datagal['gallery']); loadNewGal(datagal['large'],datagal['compctt']); } }); } $(window).scroll(function () { window.scrollTo(0,0); }); $.preloadImages = function(){ for(var i = 0; i < arguments.length; i++){$("").attr("src", arguments[i]); } } $.preloadImages("images/playrec.png", "images/stopquad.png", "images/pausequad.png", "images/reccircle.png", "images/rewindtrig.png", "images/fftriag.png", "images/rewindletter.png", "images/playletter.png", "images/stopletter.png", "images/pauseletter.png", "images/recletters.png", "images/ffwdltetters.png"); function sendVars(title,projID){ } function verifica(forma){ if($('#form #nome').val()=='' || $('#form #mail').val()=='' || $('#form #assunto').val()=='' || $('#form #msg').val()==''){ if($('#form #nome').val()==''){ $('#form #nome').css({'border':'solid 1px #f00'}); } if($('#form #mail').val()==''){ $('#form #mail').css({'border':'solid 1px #f00'}); } if($('#form #assunto').val()==''){ $('#form #assunto').css({'border':'solid 1px #f00'}); } if($('#form #msg').val()==''){ $('#form #msg').css({'border':'solid 1px #f00'}); } alert('Todos os campos a vermelho são obrigatórios!'); return false; } if($('#form #mail').val()!=''){ var emailRegex = new RegExp(/^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$/i); var emailAddress = $('#form #mail').val(); var valid = emailRegex.test(emailAddress); if (!valid){ $('#form #mail').css({'border':'solid 1px #f00'}); alert('EMAIL INVÁLIDO!'); $('#form #mail').focus(); return false; } } $.ajax({ url:'sendmail.php', data:'nome='+$('#nome').val()+'&mail='+$('#mail').val()+'&assunto='+$('#assunto').val()+'&msg='+$('#msg').val(), dataType:'json', type:'POST', success:function(tellus){ if(tellus['resultado']==1){ $('#nome').val(''); $('#mail').val(''); $('#msg').val(''); $('#infomail').html('Mensagem Enviada com Sucesso!').fadeIn('fast').delay(5000).fadeOut('fast'); } if(tellus['resultado']==0){ $('#infomail').html('Erro, Tente novamente!').fadeIn('fast').delay(5000).fadeOut('fast'); } }}); } function revertit(obj){ $('#'+obj).css({'border':'solid 1px #7A7A7A'}); } function pdfIt(a,b,c){ window.location.href='../pdfs/createpdf.php?marca='+a+'&idobj='+b+'&objecto='+c+'&lang=pt'; } var openLogged = 0; function loadUsersub(ID,idiom){ $.ajax({ url: 'pushbase.php', data: 'idiom='+idiom+'&idmenu='+ID+'&submenu=1&user=1', dataType: 'json', type: 'GET', success: function(data){ $('#subuser').html(data['subMenubase']); $('#userloged').click(function(){ $("#subuser").slideToggle("slow").show(); openLogged = 1; if($(this).hasClass('activo')){ $(this).removeClass('activo'); openLogged = 0; } else { $(this).addClass('activo'); openLogged = 1; } return openLogged; }); } }); topreload(); } function closeUsermenu(){ $("#subuser").slideToggle("slow",function(){ $('#userloged').removeClass('activo'); openLogged = 0; return openLogged;}); topreload(); }