function slide(){$('#slider1').cycle({fx:'scrollRight',next:'#slider1',width:651,timeout:1000,fit:1,speed:400,next:'#next2',prev:'#prev2',after:showSlide2});}
function showSlide2(curr,next,opts){var nSlide=opts.currSlide;$('#slider1').cycle('pause');setTimeout(function(){$('#slider2 > div').eq(nSlide).css({right:"-400px"})
$('#slider2 > div').eq(nSlide).show();$('#slider2 > div').eq(nSlide).animate({right:"+=400"},500);},2000);setTimeout(function(){$('#slider2 > div').eq(nSlide).fadeTo(600,0,function(){$(this).hide();});},8000);setTimeout(function(){$('#slider1').cycle('resume');},9000);}
function slideToggle(el,bShow){var $el=$(el),height=$el.data("originalHeight"),visible=$el.is(":visible");if(arguments.length==1)
bShow=!visible;if(bShow==visible)
return false;if(!height){height=$el.show().height();$el.data("originalHeight",height);if(!visible)
$el.hide().css({height:0});}
if(bShow){$el.show().animate({height:height},{duration:250});}else{$el.animate({height:0},{duration:250,complete:function(){$el.hide();}});}}
$(function(){jQuery.fx.prototype.hide=function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),1);}
$(".container").hover(function(){$(this).find("div.subtitle").slideDown('4000');},function(){$(this).find("div.subtitle").slideUp('4000');});$(".container").click(function(){var link=$(this+' > a').attr('href');});$("#tabs1").tabs();$("#tabs2").tabs();$("#tabs3").tabs();if($("#slider1").length>0){slide();}
function isset(varname){if(typeof(window[varname])!="undefined")
return true;else
return false;}
function insertAfter(parent,node,referenceNode){parent.insertBefore(node,referenceNode.nextSibling);}
if($("#news_slider").length>0){$("#news_slider div.ca").unwrap();(function($){$.fn.wrapChildren=function(options){options=$.extend({childElem:undefined,groupSize:1,wrapper:'<li>'},options||{});if(options.childElem===undefined)
return this;return this.each(function(){var elems=$(this).children(),len=pos=0;elems.each(function(i,value){len+=$(value).is(options.childElem)?1:0;if(len>0&&(len%options.groupSize===0)||(i===elems.length-1)){elems.slice(pos,i+1).wrapAll(options.wrapper);len=0;pos=i+1;}});});}})(jQuery);$('#news_slider').wrapChildren({childElem:'div',groupSize:2});$('#news_slider li > div:first-child').addClass('t').removeClass('ca');$('#news_slider li > div:last-child').addClass('b').removeClass('ca');$('#news_slider').cycle({fx:'scrollHorz',timeout:0,speed:'slow',nowrap:1,next:'#next1',prev:'#prev1',easing:'easeInOutSine',fit:0,width:626,delay:-1000});}
if($("#lateral_banner").length>0){$('#lateral_banner').cycle({fx:'fade',speed:2000,next:'#lateral_banner',next:'#next3',prev:'#prev3',timeout:8000,fit:1,width:300,pause:1});}
$("a#fancybox").fancybox();$("a#fancybox_video").click(function(){$.fancybox({'padding':0,'autoScale':false,'transitionIn':'none','transitionOut':'none','title':this.title,'width':680,'height':495,'href':this.href.replace(new RegExp("watch\\?v=","i"),'v/'),'type':'swf','swf':{'wmode':'transparent','allowfullscreen':'true'}});return false;});$(".li_get_a").click(function(){var url=$(this).find('a').attr('href');window.location=url;return false;});$('.top_menu ul li.parent').bind({mouseover:function(){if($(this).children('.block04').length){var width=$(this).children('a').css('width');var center=width.slice(0,-2)/2;var bwidth=$(this).children('table').css('width');var bcenter=bwidth.slice(0,-2)/2;var coord=$(this).offset();var top=coord.top+20;var left=coord.left+center-bcenter+10;$(this).children('.block04').css("top",top).css("left",left).show();}},mouseout:function(){$(this).children('.block04').offset({top:0,left:0});$(this).children('.block04').hide();}});$('.modulo').bind({mouseover:function(){$(this).children('.top').css('background-image','url(media/layout/modulo_top_over.png)');$(this).children('.bottom').css('background-image','url(/media/layout/modulo_bottom_over.png)');$(this).children('.top').css('color','#f1edea');},mouseout:function(){$(this).children('.top').css('background-image','url(/media/layout/modulo_top.png)');$(this).children('.bottom').css('background-image','url(/media/layout/modulo_bottom.png)');$(this).children('.top').css('color','#ff0000');}});$('.noticias li .stage').bind({mouseover:function(){$(this).css('border','1px solid #898077');},mouseout:function(){$(this).css('border','1px solid #ffffff');}});$('input.button').bind({mouseover:function(){$(this).css('background-image','url(media/layout/form/btn_over.png)');},mouseout:function(){$(this).css('background-image','url(media/layout/form/btn.png)');}});});
