/*
 * 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 = 4;
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);
}
/*
 * jQuery - $.fn();
 */

$(document).ready(function(){
	$("a[rel=lightbox]").colorbox();
	$("a[rel=videobox]").colorbox({iframe:true,width:700,height:480});
	$("#slider").easySlider({
		auto: true, 
		continuous: true,
		numeric: true
	});
	$(".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);
	});
	$('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');
		}
	});
});//End jQuery.fn($)
