function ativaPai(qual , classe, esconder) {
	document.getElementById(qual).className = classe;
	esconder.style.display = 'none';	
}

function showConteudoCarro(nomeDiv){
	var nomes = ['caracteristicas','preco','itensdeserie','equipamentos'];
	//var nomes = ['caracteristicas','preco','itensdeserie'];
	for( i = 0 ; i < nomes.length ; i++ ){
		if( nomes[i] != nomeDiv ) jQuery('#' + nomes[i]).fadeOut(500);
	}
	jQuery('#' + nomeDiv).delay(500).fadeIn(500);
	jQuery('#menucarros').css( 'backgroundImage' , 'url(imagens/bg-' + nomeDiv + '.png)');
	//window.location.hash = nomeDiv ;
}

function showConteudoCarroURL(){
	var hash = window.location.hash ;
	if( hash == "" ) hash = 'preco' ;
	if( hash.indexOf("caracteristicas") >= 0 ) hash = 'caracteristicas' ;
	//if( hash.indexOf("equipamentos") >= 0 ) hash = 'equipamentos' ;
	if( hash.indexOf("preco") >= 0 ) hash = 'preco' ;
	if( hash.indexOf("itensdeserie") >= 0 ) hash = 'itensdeserie' ;
	showConteudoCarro( hash ) ;
}

jQuery(document).ready(function(){
	jQuery("ul#menu li ").hover(function() { 
		jQuery(this).find("ul#submenu").slideDown('fast').show(); 

		jQuery(this).hover(function() {
		}, function(){
			jQuery(this).find("ul#submenu").slideUp('fast');
		});
	});
	jQuery("#listadefotosakia a").lightBox();
});

function SWFDelegate(url,width,height,caption) {
	var objLink = document.createElement('a');
	objLink.setAttribute('href',url);
	objLink.setAttribute('id','detalheLightbox');
	objLink.setAttribute('title',caption);
	if(typeof width != 'undefined') {
		objLink.setAttribute('width',width);
	}
	if(typeof height != 'undefined') {
		objLink.setAttribute('height',height);
	}
	jQuery(objLink).lightBox();
	jQuery(objLink).click();
}

