// Imagens Ambiente

$(document).ready(function() {
    $('.imagemAmbienteBox').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
});


// Detalhes do Produto

$(document).ready(function() {
	
	$('.carSlideShow').cycle({ 
		fx:     'fade', 
		speed:  'fast', 
		timeout: 5000, 
		pager:  '#nav', 
     
		// Paginacao das imagens no detalhe do produto
		pagerAnchorBuilder: function(idx, slide) {
		
				var src = $('img',slide).attr('src');
				var alt = $('img',slide).attr('alt');
				return "<a href='#' class='pager molduraThumbsDetalhe'><img src='" + src + "' alt='"+alt+"' width='170' border='0' \/><\/a>";
		} 
	});
	
	
});

// arranque da modal

hs.graphicsDir = '/include/hs/graphics/';
hs.wrapperClassName = 'wide-border';

$(function(){	//Scroll nos detalhes do produto
	// this initialises the demo scollpanes on the page.
	$('#pane2').jScrollPane({showArrows:true});			
});			


// Adicionar aos Favoritos
	
function  addFavoritos(url, title) {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
}
	
// END Adicionar aos Favoritos


//--- Igualar a altura de objectos

function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}



//--- igualar as alturas de cada livro na listagem
$(document).ready(function() {
	equalHeight($(".obsComparador"));
	equalHeight($(".extrasComparador"));
});	

