var defaultFontSize = 120;
var maximumFontSize = 400;
var currentFontSize = defaultFontSize;

function resetFontSize() {
	resetSize = defaultFontSize - currentFontSize;
	changeFontSize(resetSize);
}

function changeFontSize(sizeDifference) {
	currentFontSize = currentFontSize + sizeDifference;

	if(currentFontSize > maximumFontSize) { alert('VocÃª jÃ¡ chegou ao tamanho mÃ¡ximo!'); currentFontSize = 300;  }
	else if(currentFontSize < 60) { alert('VocÃª jÃ¡ chegou ao tamanho mÃ­nimo!'); currentFontSize = 60;  }

	setFontSize(currentFontSize);
}

function setFontSize(fontSize){ document.getElementById('areaTexto').style.fontSize = fontSize + '%'; }


function centro(x) {
	if (x == "A") { changeFontSize(10); }
	else if (x == "D") { changeFontSize(-10); }
	else { resetFontSize(); }
}

function areaTexto(x) {
	if (x == "A") { changeFontSize(10); }
	else if (x == "D") { changeFontSize(-10); }
	else { resetFontSize(); }
}

function getfileextension(inputId) { 
	var fileinput = inputId; 
	if (!fileinput ) { return ""; }
	else {
		if (fileinput.length == 0) { return ""; }
		else {
			var dot = fileinput.lastIndexOf("."); 
			if (dot == -1 ) { return ""; }
			else {
				var extension = fileinput.substr(dot,fileinput.length); 
				return extension; 
			}
		}
	}
}


function addFlash(_src,_w,_h){
	var novoHtml = '';
 	novoHtml += '  <OBJECT height="'+_h+'" width="'+_w+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	novoHtml += '  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
	novoHtml += '  wmode="transparent" ALIGN="">';
	novoHtml += '    <PARAM NAME="movie"   VALUE="'+_src+'">';
	novoHtml += '    <PARAM NAME="quality" VALUE="high">';
	novoHtml += '    <PARAM NAME="wmode"   VALUE="transparent">';
	novoHtml += '    <PARAM NAME="bgcolor" VALUE="#FFFFFF">';
	novoHtml += '    <EMBED wmode="transparent" src="'+_src+'" pluginspage="http://www.macromedia.com/go/getflashplayer" height="'+_h+'" width="'+_w+'"></EMBED>';
	novoHtml += '  </OBJECT>';
  document.write(novoHtml);
}

function renderBanner3(input, link, width, height) {
	if (getfileextension(input) == '.swf') { addFlash(input, width, height); } 
	else { document.write('<a href="'+link+'" target="_blank"><img src="'+input+'" width="'+width+'" height="'+height+'" /></a>'); }
}

function renderBanner(input, link, width, height) {
	if (getfileextension(input) == '.swf') { addFlash(input, width, height); } 
	else { document.write('<a href="'+link+'" target="_blank"><img src="'+input+'" width="'+width+'" height="'+height+'" /></a>'); }
}

$(document).ready(function () {
	
	$("a[rel=sexylightbox]").fancybox({'overlayColor':'#000'});
	
	$('#slides').slides({
		preload: true,
		play: 8000,
		pause: 2500,
		hoverPause: true
	});
	
	$('#objZTagMenuLeft2').html($('#objZTagMenuLeft').html());
	
});
