var siteurl = 'http://#'; var pluginurl = 'http://#'; var templateurl = 'http://#'; jQuery(document).ready(function ($) { // Abre links em _blank utilizando apenas rel $('a[rel=external]').attr('target','_blank'); $('a[rel=nofollow]').attr('target','_blank'); // Qualquer link com a class="highslide" abre com highslide $('a.highslide').each (function () { this.onclick = function () { return hs.expand ( this, { slideshowGroup: 'grupo' } ); }; }); // Focus em inputs de acordo com o click no seu respectivo label // Efeito suave ao clicar em um link âncora $('a[href^=#]').live('click', function () { if($(this).attr('href') != '#') { $('#'+$(this).attr('href').replace('#', '')).focus(); if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var $target = $(this.hash); $target = $target.length && $target || $('[name='+this.hash.slice(1) +']'); if ($target.length) { var velocidade = ($target.offset().top - $(this).offset().top); if (velocidade == 0) velocidade = 1; else if (velocidade < 0) velocidade = ((-1) * velocidade); var targetOffset = $target.offset().top; $('html,body').animate({scrollTop: targetOffset}, velocidade); return false; } } } }); });