var hits = 5;
function fontSize(action, container){
container = typeof(container) != 'undefined' ? container : 'div#paginas'; //se não for especificado um container será ‘div.texto’
var hitIncrease = 0;
var hitDecrease = 0;

var pegaTodos = {pega : function(maiorDeTodos){
var filho;

	$(maiorDeTodos).children().each(function(i){
	filho = $(this);
	
	$fs = parseInt($(filho).css('font-size'));
	if (action == 'less' && hits > 0) {
		$fs -= 1;
		hitDecrease = 1;
	}
	if (action == 'more' && hits < 10) {
		$fs += 1;
		hitIncrease = 1;
	}
	$(filho).css('font-size', $fs);
	
	if ($(filho).children().length != 0) {
	pegaTodos.pega($(filho));
	}
	});
}};
pegaTodos.pega($(container));

if (hitIncrease == 1)hits+=1;
else if (hitDecrease == 1)hits-=1;
}

function desabilitar(){
    return false
}
document.oncontextmenu=desabilitar

hs.graphicsDir = 'http://www.hoteiscostanorte.com.br/ingleses/highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'glossy-dark';
hs.wrapperClassName = 'dark';
hs.fadeInOut = true;
hs.dimmingOpacity = 0.75;

// Add the controlbar
if (hs.addSlideshow) hs.addSlideshow({
	slideshowGroup: 'group1',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: .6,
		position: 'top center',
		hideOnMouseOut: true
	}
});

$(document).ready(function() {
	$(function(){
		$('.diminuir').click(function(){ fontSize('less') }).blur();
		$('.aumentar').click(function(){ fontSize('more') }).blur();
		$('.toolsImprimir').click(function(){ window.print(); }).blur();
	})
	
	//Newsletter Home
	$("#linkNews").click(function(){
		hs.htmlExpand(this, {objectType: 'iframe', width: 280, height: 205, wrapperClassName: 'highslide-white', slideshowGroup: 'contact', outlineWhileAnimating: true, outlineType: 'rounded-white',preserveContent: false} )
		return false;
	});
	
	//Enviar para um amigo / Páginas internas
	$("#linkSendFriend").click(function(){
		hs.htmlExpand(this, {objectType: 'iframe', width: 300, height: 310, wrapperClassName: 'highslide-white', outlineWhileAnimating: true, outlineType: 'rounded-white',enableKeyListener: false} )
		return false;
	});
	
	//Newsletter / Páginas internas
	$("#linkAddNewsletter").click(function(){
		hs.htmlExpand(this, {objectType: 'iframe', width: 300, height: 240, wrapperClassName: 'highslide-white', outlineWhileAnimating: true, outlineType: 'rounded-white',enableKeyListener: false} )
		return false;
	});
	
	//Click0800
	$("#urlClick0800").click(function(){
		hs.htmlExpand(this, {objectType: 'iframe', width: 340, height: 400, wrapperClassName: 'highslide-white', outlineWhileAnimating: true, outlineType: 'rounded-white',enableKeyListener: false} )
		return false;
	});
	
	jQuery("select[@name=estado]").change(function(){
		jQuery("select[@name=cidade]").html("<option value=\"procurando\">Carregando cidades...</option>");
		jQuery.post("/buscacidade.php",{estado : jQuery(this).val()}, 
			function(resposta){
				jQuery("select[@name=cidade]").html(resposta);
			}
		);
	});
});