/*
 * Alterar o tamanho das fontes
 * versao: 1.3
 * <param name="trgt">Elemnto (ID) CSS que receberá a açao.</param>
 * <param name="inc">Inteiro (signed int) com a variaçao para alterar o tamanho.</param>
 */
var tgs = new Array(  'a', 'abbr', 'address', 'area', 'base', 'basefont', 'bdo', 'blockquote', 'button', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'dd', 'div', 'dl', 'dt', 'em', 'fieldset', 'form', 'frame', 'frameset', 'hr', 'i', 'iframe', 'input', 'ins', 'isindex', 'label', 'legend', 'li', 'link', 'map', 'ol', 'optgroup',  'option', 'p', 'param', 'pre', 'q', 's', 'samp', 'select', 'span', 'strike', 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'tr', 'tt', 'u', 'ul', 'b', 'strong', 'small', 'big', 'h1', 'h2', 'h3', 'h4',  'h5', 'h6', 'small', 'big' );
var szs = new Array( '9px','10px','11px','12px','14px','15px','16px','17px','18px','19px','20px','21px','22px','23px','24px', '36px', '48px' );
var startSz = 3;
function ts( trgt, inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 15 ) sz = 16;
	startSz = sz;
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];
	cEl.style.fontSize = szs[ sz ];
	for ( i = 0; i < tgs.length; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0; j < cTags.length; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}

/*
 * Abrir janelas pop-up
 * versao: 2.0
 * <param name="theURL">URI do destino.</param>
 * <param name="winName">Nome da janela que será aberta.</param>
 * <param name="features">Parâmetros opcionais.</param>
 */
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

$(document).ready(function(){
	$("body").pngFix();
	$(".fxFavorite").click(function(e) {
		e.preventDefault();
		var url = 'http://www.namidiacomunicacao.com.br';
		var title = 'Na Mídia Comunicação & Marketing';
		if ($.browser.mozilla == true) {
			window.sidebar.addPanel(title, url, '');
			return false;
		} else if($.browser.msie == true) {  
			window.external.AddFavorite( url, title);
			return false;
		} else {
			alert('Pressione as teclas CTRL + D para adicionar aos favoritos.');
			return false;
		}
	});
	$("a[rel=lightbox]").lightBox();
	$('div.online-expande> div').hide();
	$('div.online-expande> h3').click(function() {
		var $nextDiv = $(this).next();
		var $visibleSiblings = $nextDiv.siblings('div:visible');
		if ($visibleSiblings.length ) {
			$visibleSiblings.slideUp('slow', function() {
				$nextDiv.slideToggle('slow');
			});
		} else {
			$nextDiv.slideToggle('slow');
		}
	});
	var tabContainers = $('div.tabs > div');
	tabContainers.hide().filter(':first').show();
	$('div.tabs ul.tabNavigation a').click(function () {
			tabContainers.hide();
			tabContainers.filter(this.hash).show();
			$('div.tabs ul.tabNavigation a').removeClass('selected');
			$(this).addClass('selected');
			return false;
	}).filter(':first').click();
	$(".onlineslider").click(function(event){
		event.preventDefault();
		var urlCompleta = this.href;
		var partes = urlCompleta.split("#");
		var destino = partes[1];
		var destinoOffset = $("#"+destino).offset();
		var destinoTop = destinoOffset.top;
		$('html, body').animate({scrollTop:destinoTop}, 2000);
	});
});//End jQuery.fn($)
