/*
* Menu Controls* (c) 2007 Studio-web
 
*/


//Swap swf files Lightweight
function load_flash(file,nav){
	var so = new SWFObject("/flash_files/swf/"+file, "myFlash", "650", "300", "8", "#ffffff");
	so.addParam("menu", "false");
	so.addVariable("navhtm", nav);
	//Here come all xml path

	//XML EXTERIOR
	so.addVariable("xmlbumper", "/automotive/xml/light_content_bumper.xml");
	so.addVariable("xmlbody", "/automotive/xml/light_content_body.xml");
	so.addVariable("xmltrims", "/automotive/xml/light_content_trims.xml");
	
	//XML UNDER THE BONNET
	so.addVariable("xmlhccu", "/automotive/xml/light_content_hccu.xml");
	so.addVariable("xmlfan", "/automotive/xml/light_content_fan.xml");
	so.addVariable("xmlaim", "/automotive/xml/light_content_aim.xml");
	so.addVariable("xmltanks", "/automotive/xml/light_content_tanks.xml");
	so.addVariable("xmlbattery", "/automotive/xml/light_content_battery.xml");
	so.addVariable("xmlwire", "/automotive/xml/light_content_wire.xml");

	//XML INTERIOR
	so.addVariable("xmldashboard", "/automotive/xml/light_content_dashboard.xml");
	so.addVariable("xmldoor", "/automotive/xml/light_content_door.xml");
	so.addVariable("xmlinttrims", "/automotive/xml/light_content_int_trims.xml");
	
	//SWF 
	so.addVariable("swfpath", "/flash_files/swf/");
	so.addVariable("stylepath", "/flash_files/style/");
	
	so.write("flashcontent");
}

function load_flash_heavy(file,nav){
	var so = new SWFObject("/flash_files/swf/"+file, "myFlash", "650", "300", "8", "#ffffff");
	so.addParam("menu", "false");
	so.addVariable("navhtm", nav);
	
	//Here come all xml path

	//XML EXTERIOR
	so.addVariable("xmlguards", "/automotive/xml/heavy_content_guards.xml");
	so.addVariable("xmlgrill", "/automotive/xml/heavy_content_grill.xml");
	so.addVariable("xmlfascia", "/automotive/xml/heavy_content_fascia.xml");
	
	//XML UNDER THE BONNET
	so.addVariable("xmlurea", "/automotive/xml/heavy_content_urea.xml");
	so.addVariable("xmltanks", "/automotive/xml/heavy_content_tanks.xml");
	so.addVariable("xmlbattery", "/automotive/xml/heavy_content_battery.xml");
	so.addVariable("xmlaim", "/automotive/xml/heavy_content_aim.xml");
	so.addVariable("xmlliq", "/automotive/xml/heavy_content_liq.xml");

	//XML INTERIOR
	so.addVariable("xmldashboard", "/automotive/xml/heavy_content_dashboard.xml");
	so.addVariable("xmldoor", "/automotive/xml/heavy_content_door.xml");
	so.addVariable("xmlinttrims", "/automotive/xml/heavy_content_int_trims.xml");
	so.addVariable("xmlcooling", "/automotive/xml/heavy_content_cooling.xml");
	so.addVariable("xmltool", "/automotive/xml/heavy_content_tool.xml");
	
	//SWF 
	so.addVariable("swfpath", "/flash_files/swf/");
	so.addVariable("stylepath", "/flash_files/style/");
	
	so.write("flashcontent");
}


//Change menu selection
function select_item(id){
	var selected_item = document.getElementById(id);
	var item1 = document.getElementById('bonnet');
	var item2 = document.getElementById('int');
	var item3 = document.getElementById('ext');
	item1.className = "third_level";
	item2.className = "third_level";
	item3.className = "third_level";
	selected_item.className = "third_level_selected";
	
	//Sector change
	/*var sector = document.getElementById('left_menu');
	
	switch(id){
	
		case "bonnet":
			sector.innerHTML = "&rsaquo; Under the bonnet"
			break;
			
		case "int":
			sector.innerHTML = "&rsaquo; Interior"
			break;
			
		case "ext":
			sector.innerHTML = "&rsaquo; Exterior"
			break;
	}*/
	
	

}

//Flash change sector
/*var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function myFlash_DoFSCommand(command, args){
	var myFlashObj = InternetExplorer ? myFlash : document.myFlash;
	switch(args){
		case "bonnet":
		case "int":
		case "ext":
			select_item(args);
			break;
	}	  
}*/

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Sub myFlash_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call myFlash_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</SCRIPT\> \n');
} 
