// troca fotos showroom
colecaoC3 = new Array();
colecaoC3[0] = "../_img/showroom/c3/foto-novos-c301.jpg"
colecaoC3[1] = "../_img/showroom/c3/foto-novos-c302.jpg"
colecaoC3[2] = "../_img/showroom/c3/foto-novos-c303.jpg"
colecaoC3[3] = "../_img/showroom/c3/foto-novos-c304.jpg"
colecaoC3[4] = "../_img/showroom/c3/foto-novos-c305.jpg"

function mudarImagemC3(x){
	fotografia = document.getElementById("imagem") 
	fotografia.innerHTML = "<img src='"+colecaoC3[x]+"' />"
}

colecaoC3xtr = new Array();
colecaoC3xtr[0] = "../_img/showroom/c3xtr/foto-novos-c3xtr01.jpg"
colecaoC3xtr[1] = "../_img/showroom/c3xtr/foto-novos-c3xtr02.jpg"
colecaoC3xtr[2] = "../_img/showroom/c3xtr/foto-novos-c3xtr03.jpg"
colecaoC3xtr[3] = "../_img/showroom/c3xtr/foto-novos-c3xtr04.jpg"
colecaoC3xtr[4] = "../_img/showroom/c3xtr/foto-novos-c3xtr05.jpg"

function mudarImagemC3xtr(x){
	fotografia = document.getElementById("imagem") 
	fotografia.innerHTML = "<img src='"+colecaoC3xtr[x]+"' />"
}

colecaoC4 = new Array();
colecaoC4[0] = "../_img/showroom/c4/foto-novos-c401.jpg"
colecaoC4[1] = "../_img/showroom/c4/foto-novos-c402.jpg"
colecaoC4[2] = "../_img/showroom/c4/foto-novos-c403.jpg"
colecaoC4[3] = "../_img/showroom/c4/foto-novos-c404.jpg"
colecaoC4[4] = "../_img/showroom/c4/foto-novos-c405.jpg"

function mudarImagemC4(x){
	fotografia = document.getElementById("imagem") 
	fotografia.innerHTML = "<img src='"+colecaoC4[x]+"' />"
}

colecaoC4pallas = new Array();
colecaoC4pallas[0] = "../_img/showroom/c4pallas/foto-novos-c4pallas01.jpg"
colecaoC4pallas[1] = "../_img/showroom/c4pallas/foto-novos-c4pallas02.jpg"
colecaoC4pallas[2] = "../_img/showroom/c4pallas/foto-novos-c4pallas03.jpg"
colecaoC4pallas[3] = "../_img/showroom/c4pallas/foto-novos-c4pallas04.jpg"
colecaoC4pallas[4] = "../_img/showroom/c4pallas/foto-novos-c4pallas05.jpg"

function mudarImagemC4Pallas(x){
	fotografia = document.getElementById("imagem") 
	fotografia.innerHTML = "<img src='"+colecaoC4pallas[x]+"' />"
}

colecaoC5 = new Array();
colecaoC5[0] = "../_img/showroom/c5/foto-novos-c501.jpg"
colecaoC5[1] = "../_img/showroom/c5/foto-novos-c502.jpg"
colecaoC5[2] = "../_img/showroom/c5/foto-novos-c503.jpg"
colecaoC5[3] = "../_img/showroom/c5/foto-novos-c504.jpg"
colecaoC5[4] = "../_img/showroom/c5/foto-novos-c505.jpg"

function mudarImagemC5(x){
	fotografia = document.getElementById("imagem") 
	fotografia.innerHTML = "<img src='"+colecaoC5[x]+"' />"
}

colecaoC5break = new Array();
colecaoC5break[0] = "../_img/showroom/c5break/foto-novos-c5break01.jpg"
colecaoC5break[1] = "../_img/showroom/c5break/foto-novos-c5break02.jpg"
colecaoC5break[2] = "../_img/showroom/c5break/foto-novos-c5break03.jpg"
colecaoC5break[3] = "../_img/showroom/c5break/foto-novos-c5break04.jpg"
colecaoC5break[4] = "../_img/showroom/c5break/foto-novos-c5break05.jpg"

function mudarImagemC5break(x){
	fotografia = document.getElementById("imagem") 
	fotografia.innerHTML = "<img src='"+colecaoC5break[x]+"' />"
}

colecaoPicasso = new Array();
colecaoPicasso[0] = "../_img/showroom/picasso/foto-novos-picasso01.jpg"
colecaoPicasso[1] = "../_img/showroom/picasso/foto-novos-picasso02.jpg"
colecaoPicasso[2] = "../_img/showroom/picasso/foto-novos-picasso03.jpg"
colecaoPicasso[3] = "../_img/showroom/picasso/foto-novos-picasso04.jpg"
colecaoPicasso[4] = "../_img/showroom/picasso/foto-novos-picasso05.jpg"

function mudarImagemPicasso(x){
	fotografia = document.getElementById("imagem") 
	fotografia.innerHTML = "<img src='"+colecaoPicasso[x]+"' />"
}

colecaoC6 = new Array();
colecaoC6[0] = "../_img/showroom/c6/foto-novos-c601.jpg"
colecaoC6[1] = "../_img/showroom/c6/foto-novos-c602.jpg"
colecaoC6[2] = "../_img/showroom/c6/foto-novos-c603.jpg"
colecaoC6[3] = "../_img/showroom/c6/foto-novos-c604.jpg"
colecaoC6[4] = "../_img/showroom/c6/foto-novos-c605.jpg"

function mudarImagemC6(x){
	fotografia = document.getElementById("imagem") 
	fotografia.innerHTML = "<img src='"+colecaoC6[x]+"' />"
}

colecaoBerlingo = new Array();
colecaoBerlingo[0] = "../_img/showroom/berlingo/foto-novos-berlingo01.jpg"
colecaoBerlingo[1] = "../_img/showroom/berlingo/foto-novos-berlingo02.jpg"
colecaoBerlingo[2] = "../_img/showroom/berlingo/foto-novos-berlingo03.jpg"
colecaoBerlingo[3] = "../_img/showroom/berlingo/foto-novos-berlingo04.jpg"
colecaoBerlingo[4] = "../_img/showroom/berlingo/foto-novos-berlingo05.jpg"

function mudarImagemBerlingo(x){
	fotografia = document.getElementById("imagem") 
	fotografia.innerHTML = "<img src='"+colecaoBerlingo[x]+"' />"
}

colecaoJumper = new Array();
colecaoJumper[0] = "../_img/showroom/jumper/Jumper_1.jpg"
colecaoJumper[1] = "../_img/showroom/jumper/foto-novos-jumper02.jpg"
colecaoJumper[2] = "../_img/showroom/jumper/foto-novos-jumper03.jpg"
colecaoJumper[3] = "../_img/showroom/jumper/foto-novos-jumper04.jpg"
colecaoJumper[4] = "../_img/showroom/jumper/foto-novos-jumper05.jpg"

function mudarImagemJumper(x){
	fotografia = document.getElementById("imagem") 
	fotografia.innerHTML = "<img src='"+colecaoJumper[x]+"' />"
}

colecaoC4picasso = new Array();
colecaoC4picasso[0] = "../_img/showroom/c4picasso/foto-novos-c4picasso01.jpg"
colecaoC4picasso[1] = "../_img/showroom/c4picasso/foto-novos-c4picasso02.jpg"
colecaoC4picasso[2] = "../_img/showroom/c4picasso/foto-novos-c4picasso03.jpg"
colecaoC4picasso[3] = "../_img/showroom/c4picasso/foto-novos-c4picasso04.jpg"
colecaoC4picasso[4] = "../_img/showroom/c4picasso/foto-novos-c4picasso05.jpg"

function mudarImagemC4picasso(x){
	fotografia = document.getElementById("imagem") 
	fotografia.innerHTML = "<img src='"+colecaoC4picasso[x]+"' />"
}

// fim de troca fotos showroom

function mudarLapela(itemId){
	document.getElementById('carro').style.display='none';
	document.getElementById('detalhesCarro').style.display='none';
	document.getElementById(itemId).style.display='block';
	
	document.getElementById('linkcarro').className='';
	document.getElementById('linkdetalhesCarro').className='';
	eval("document.getElementById('link"+itemId+"').className='selecionada'");
}

function mudarLapelaConcessionaria(itemId){
	document.getElementById('details').style.display='none';
	document.getElementById('services').style.display='none';
	document.getElementById('acessories').style.display='none';
	document.getElementById('promocoes').style.display='none';
	document.getElementById('fale').style.display='none';
	document.getElementById(itemId).style.display='block';
	
	document.getElementById('linkdetails').className='';
	document.getElementById('linkservices').className='';
	document.getElementById('linkacessories').className='';
	document.getElementById('linkpromocoes').className='';
	document.getElementById('linkfale').className='';
	eval("document.getElementById('link"+itemId+"').className='selecionada'");
}

function mudarLapelaGaleria(itemId){
	document.getElementById('screen').style.display='none';
	document.getElementById('papeis').style.display='none';
	document.getElementById('fotos').style.display='none';
	document.getElementById(itemId).style.display='block';
	
	document.getElementById('linkscreen').className='';
	document.getElementById('linkpapeis').className='';
	document.getElementById('linkfotos').className='';
	eval("document.getElementById('link"+itemId+"').className='selecionada'");
}

function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

function selecionar(x){
	if(x!=0) window.location=x.options[x.selectedIndex].value;
}

function ocultarCombos(ocultar){
var versao = navigator.appVersion;
	if(versao.substr(versao.indexOf(';',0)+2, 8) == "MSIE 6.0"){
		if(navigator.appName!='Netscape'){
			for(i=0; i<=document.getElementsByTagName('SELECT').length-1; i++){
				document.getElementsByTagName('SELECT')[+i].style.visibility=ocultar
			}
		}
	}
}

function abrir(itemDiv){
	if(navigator.appName=='Netscape')
	document.getElementById(itemDiv).style.display='table';
	else
	document.getElementById(itemDiv).style.display='block';
	ocultarCombos('hidden')
}
function fechar(itemDiv){
	document.getElementById(itemDiv).style.display="none";
	ocultarCombos('visible')
}

over = function() {
  // para não ocorrer erro de script.  Exemplo: caso não exista o ID
  try{
  	var sfEls = document.getElementById("base").getElementsByTagName("li");
  	for (var i=0; i<sfEls.length; i++) {
  		sfEls[i].onmouseover=function() {
  			this.className+=" over";
  		ocultarCombos('hidden')
  		}
  		sfEls[i].onmouseout=function() {
  			this.className=this.className.
  		replace(new RegExp(" over\\b"), "");
  		ocultarCombos('visible')
  		}
  	}
  }catch(e){}
}


if (window.attachEvent) window.attachEvent("onload", over);

/*Dicas*/
var abre=0;
var opcao=0;
/* qtde é o total de submenus da página que chama a função */
function abreOpcao(i,qtde){
	if (i!=0){
		if (document.getElementById("item"+i).className != "ativo"){
				document.getElementById("item"+i).className = "ativo";
				document.getElementById("sinal"+i).className = "menos";
		} else {
			document.getElementById("item"+i).className = "inativo";
			document.getElementById("sinal"+i).className = "mais";
		}
	}
}

function createXMLHTTP() 
{
	try 
    {
		ajax = new ActiveXObject("Microsoft.XMLHTTP");
	} 
    catch(e) 
    {
		try 
		{
			ajax = new ActiveXObject("Msxml2.XMLHTTP");
            alert(ajax);
		}
        catch(ex) 
        {
			try 
            {
				ajax = new XMLHttpRequest();
			}
            catch(exc) 
			{
				alert("Esse browser não tem recursos para uso do Ajax");
				ajax = null;
			}
		}
        return ajax;
	}
                  
	var arrSignatures = ["MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"];
    for (var i=0; i < arrSignatures.length; i++) 
    {
		try 
		{
			var oRequest = new ActiveXObject(arrSignatures[i]);
            return oRequest;
		} 
		catch (oError) {}
	}
	throw new Error("MSXML is not installed on your system.");
}
/*-------------------------------------------------------------------------------------------------*/


/*-------------------------------------------------------------------------------------------------*/

/*Inicio functions p/ galeria*/
function imagemPopup(itemimg){
	var imgNome = getCookie('imgNome');
	setCookie('itemimg', itemimg)
	document.getElementById('imgPopup').src="../_img/"+imgNome+"/"+imgNome+itemimg+".jpg";
	var imgTotal = getCookie('imgTotal');
	var itemimg = getCookie('itemimg');
	if (itemimg == imgTotal){
		document.getElementById('direita').style.display="none";
	}else{
		document.getElementById('direita').style.display="block";
	}if (itemimg == 1){
		document.getElementById('esquerda').style.display="none";
	}else{
		document.getElementById('esquerda').style.display="block";
	}
}

function abrirPopup(fotos, nome, itemimg){
	setCookie('imgTotal', fotos);
	setCookie('imgNome', nome);
	var imgNome = getCookie('imgNome');
	setCookie('itemimg', itemimg)
	document.getElementById('imgPopup').src="../_img/"+imgNome+"/"+imgNome+itemimg+".jpg";
}

function setCookie(nome, valor){
	var hoje = new Date();
	var expires = new Date();
	expires.setTime(hoje.getTime() + 1000*60*60*48*365);
	document.cookie = nome + "=" + escape(valor)
	+ ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ("; path=/")
}

function getCookie(Nome){
	var busca = Nome + "="
	if (document.cookie.length > 0){
		// Se Tem algum Cookie
		offset = document.cookie.indexOf(busca)
		if (offset != -1){
			// Se o Cookie existe
			offset += busca.length
			// Atribui o Começo do Valor do Cookie
			end = document.cookie.indexOf(";", offset)
			// Atribui o fim do Valor do Cookie
			if (end == -1)
			end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
			}
		} return "";
	}
	
function fechar(itemDiv){
	document.getElementById(itemDiv).style.display="none";
}

function abrir(itemDiv){
	if(navigator.appName=='Netscape')
	document.getElementById(itemDiv).style.display='table';
	else
	document.getElementById(itemDiv).style.display='block';
}

// -------------------------------------------

<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------
// -->

document.write('<script language="VBScript" type="text/vbscript">\n');
document.write('<!-- // Visual basic helper required to detect Flash Player ActiveX control version information\n');
document.write('Function VBGetSwfVer(i)\n');
document.write('  on error resume next\n');
document.write('  Dim swControl, swVersion\n');
document.write('  swVersion = 0\n');
document.write('  \n');
document.write('  set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))\n');
document.write('  if (IsObject(swControl)) then\n');
document.write('    swVersion = swControl.GetVariable("$version")\n');
document.write('  end if\n');
document.write('  VBGetSwfVer = swVersion\n');
document.write('End Function\n');
document.write('// -->\n');
document.write('</script>\n');

<!-- // Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 
// If called with no parameters this function returns a floating point value 
// which should be the version of the Flash Player or 0.0 
// ex: Flash Player 7r14 returns 7.14
// If called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
	return (reqVer ? false : 0.0);
}
// -->
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

function flashMe(id,src,width,height,wmode,vreturn,vmap){
	vreturn = (vreturn==undefined || vreturn=='') ? false : true;
	vmap = (vmap==undefined || vmap=='') ? false : true;
	url = src.split("?");
	if(hasRightVersion){
		var content = '<OBJECT id="'+id+'" codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" height="'+height+'" width="'+width+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" VIEWASTEXT>';
		content += '<PARAM NAME="Movie" VALUE="'+url[0]+'">';
		if(wmode!=""){
			content += '<PARAM NAME="WMode" VALUE="'+wmode+'">';
		}
		content += '<PARAM NAME="swLiveConnect" VALUE="true">';
		content += '<PARAM NAME="AllowScriptAccess" VALUE="always">';
		if(url[1]!=""){
			content += '<PARAM NAME="FlashVars" VALUE="'+url[1]+'">';
		}
		content += '<EMBED MAYSCRIPT name="'+id+'" src="'+url[0]+'" AllowScriptAccess="always" quality="high" bgcolor="#FFFFFF" WIDTH="'+width+'" HEIGHT="'+height+'" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"\n';
		if(url[1]!=""){
			content += ' FlashVars="'+url[1]+'"';
		}
		if(wmode!=""){
			content += ' wmode="'+wmode+'"';
		}
		content += ' contenteswLiveConnect="true"></EMBED>';
		content += '</OBJECT>';
	} else {
		gif = src.replace(/swf\//,"imagens/");
		gif = gif.replace(/.swf/,".gif");
		if(vmap){
			var content = '<img src="'+gif+'" width="'+width+'" height="'+height+'" border="0" useMap="#'+id+'map" />';
		} else {
			var content = '<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW" target="_blank"><img src="'+gif+'" width="'+width+'" height="'+height+'" border="0" /></a>';
		}
	}
	if(!vreturn){
		document.write(content);
	} else {
		return content;
	}
}