//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.

var requiredVersion = 6;   // Version the user needs to view site (max 6, min 2)

function detectFlashVersion() {
  var browser = navigator.userAgent.toLowerCase();
  flashVersion = 0;
	// NS3+, Opera3+, IE5+ Mac
	if ( navigator.plugins != null && navigator.plugins.length > 0 ) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if ( typeof flashPlugin == 'object' ) {
                        if ( flashPlugin.description.indexOf('15.') != -1 ) flashVersion = 15;
                        else if ( flashPlugin.description.indexOf('14.') != -1 ) flashVersion = 14; 
						else if ( flashPlugin.description.indexOf('13.') != -1 ) flashVersion = 13;
						else if ( flashPlugin.description.indexOf('12.') != -1 ) flashVersion = 12;
						else if ( flashPlugin.description.indexOf('11.') != -1 ) flashVersion = 11;
						else if ( flashPlugin.description.indexOf('10.') != -1 ) flashVersion = 10;
					    else if ( flashPlugin.description.indexOf('9.') != -1 ) flashVersion = 9;
						else if ( flashPlugin.description.indexOf('8.') != -1 ) flashVersion = 8;
						else if ( flashPlugin.description.indexOf('7.') != -1 ) flashVersion = 7;
						else if ( flashPlugin.description.indexOf('6.') != -1 ) flashVersion = 6;
						else if ( flashPlugin.description.indexOf('5.') != -1 ) flashVersion = 5;
						else if ( flashPlugin.description.indexOf('4.') != -1 ) flashVersion = 4;
						else if ( flashPlugin.description.indexOf('3.') != -1 ) flashVersion = 3;
		}
	} // IE4+ Win32 (VBscript)
	else if ( browser.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && browser.indexOf("win")!= -1 && browser.indexOf("16bit")== -1 ) {
	  document.write('<scr' + 'ipt language="VBScript"\> \n');
		document.write('on error resume next \n');
		document.write('DIM obFlash \n');
		document.write('SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.15") \n');
		document.write('IF IsObject(obFlash) THEN \n');
		document.write('flashVersion = 15 \n');	 
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.14") END IF \n');
		document.write('IF flashVersion < 15 and IsObject(obFlash) THEN \n'); 
		document.write('flashVersion = 14 \n');
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.13") END IF \n');
		document.write('IF flashVersion < 14 and IsObject(obFlash) THEN \n');	 
		document.write('flashVersion = 13 \n');
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.12") END IF \n');
		document.write('IF flashVersion < 13 and IsObject(obFlash) THEN \n');	
		document.write('flashVersion = 12 \n');
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.11") END IF \n');
		document.write('IF flashVersion < 12 and IsObject(obFlash) THEN \n');  	
		document.write('flashVersion = 11 \n');
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.10") END IF \n');
		document.write('IF flashVersion < 11 and IsObject(obFlash) THEN \n');  	
		document.write('flashVersion = 10 \n');
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.9") END IF \n');
		document.write('IF flashVersion < 10 and IsObject(obFlash) THEN \n');	
		document.write('flashVersion = 9 \n');  
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.8") END IF \n');
		document.write('IF flashVersion < 9 and IsObject(obFlash) THEN \n'); 
		document.write('flashVersion = 8 \n');
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.7") END IF \n');
		document.write('IF flashVersion < 8 and IsObject(obFlash) THEN \n');
		document.write('flashVersion = 7 \n');
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.6") END IF \n');
		document.write('IF flashVersion < 7 and IsObject(obFlash) THEN \n');
		document.write('flashVersion = 6 \n');
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.5") END IF \n');
		document.write('IF flashVersion < 6 and IsObject(obFlash) THEN \n');
		document.write('flashVersion = 5 \n');
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.4") END IF \n');
		document.write('IF flashVersion < 5 and IsObject(obFlash) THEN \n');
		document.write('flashVersion = 4 \n');
		document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.3") END IF \n');
		document.write('IF flashVersion < 4 and IsObject(obFlash) THEN \n');
		document.write('flashVersion = 3 \n');
		document.write('END IF');
	  document.write('</scr' + 'ipt\> \n');
  } // no Flash
  else {
	flashVersion = -1;
  }
return flashVersion;
}
 var flashVersion = detectFlashVersion() ; 
 
 if (flashVersion >= requiredVersion) {
 
 	var color_swatch_flash=1;
 
 
 } else {
      var color_swatch_flash=0;
}


// write nav for non flash peeps
function noflashPano(vehicle, image) {
 document.write('<div id="topnav-sitemap">');	
 document.write('<table cellpadding="0" cellspacing="0" border="0" width="992">');
 document.write(' <tr>'); 
 document.write('   <td valign="top" align="left"><a href="/index.html"><img src="/en/common/img/dodge_logo.gif" width="130" height="45" border="0" alt="dodge.ca" /></a><img src="/en/common/img/c.gif" width="25" height="50"></td>');
 document.write('	<td valign="middle" align="left"><a href="http://www-5.dodge.ca/vehsuite/VehicleSelector.jsp?lang=en-ca"><strong>SELECT ANOTHER VEHICLE</strong></a></td>');
 document.write('	<td valign="middle" align="right" style="padding-right: 10px;"><a href="http://www.dodge.ca/en/">dodge.ca</a> | <a href="http://www.chrysler.ca/en/">chrysler.ca</a> | <a href="http://www.jeep.ca/en/">jeep.ca</a> | <a href="http://www.daimlerchrysler.ca/CA/03/EN/OWNERS/1,,CA-03-EN-OWNERS,.html">owners</a> | <a href="javascript:universal(\'retailer\');">locate a retailer</a> | <a href="http://www.dodgegoods.ca">dodge goods</a> | <a href="/fr/">français</a></div></td>');
 document.write(' </tr>');
 document.write('</table>');
 document.write('</div>');
 
 document.write('<div id="panonoflash">');		
 document.write('<table cellpadding="0" cellspacing="0" border="0" width="992">');
 document.write(' <tr>');
 document.write(' <td background="'+image+'" style="height: 372px; padding-top: 70px; padding-left: 15px; font-family: arial; color: #000000; font-size: 11px;" valign="top">'); 

if (vehicle == 'home') {
 document.write(' <a href="caravan/index.html">CARAVAN</a><br>');
 document.write(' <a href="caliber/index.html">CALIBER</a><br>');
 document.write(' <a href="avenger/index.html">AVENGER</a><br>'); 
 document.write(' <a href="charger/index.html">CHARGER</a><br>');
 document.write(' <a href="magnum/index.html">MAGNUM</a><br>');
 document.write(' <a href="viper/index.html">VIPER</a><br>');
 document.write(' <a href="nitro/index.html">NITRO</a><br>');
 document.write(' <a href="durango/index.html">DURANGO</a><br>');
 document.write(' <a href="dakota/index.html">DAKOTA</a><br>');
 document.write(' <a href="ram1500/index.html">RAM 1500</a><br>');
 document.write(' <a href="ram2500/index.html">RAM 2500</a><br>');
 document.write(' <a href="ram3500/index.html">RAM 3500/CHASSIS CAB</a><br>');
 document.write(' <a href="sprinter/index.html">SPRINTER</a><br>'); 
 document.write(' <a href="http://www-5.dodge.ca/vehsuite/VehicleSelector.jsp?lang=en-ca">BUILD AND PRICE</a><br>');
} else if (vehicle == 'caravan') {
 document.write(' <a href="../caravan/index.html">Home Page</a><br>');
 document.write(' <a href="../caravan/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../caravan/exterior.html">Exterior</a><br>');
 document.write(' <a href="../caravan/interior.html">Interior </a><br>');
 document.write(' <a href="../caravan/performance.html">Performance</a><br>');
 document.write(' <a href="../caravan/convenience.html">Convenience/Utility</a><br>');
 document.write(' <a href="../caravan/safety.html">Safety</a><br>');
 document.write(' <a href="javascript:start(\'2007caravan\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'caliber') {
 document.write(' <a href="../caliber/index.html">Home Page</a><br>');
 document.write(' <a href="../caliber/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../caliber/exterior.html">Exterior</a><br>');
 document.write(' <a href="../caliber/sound.html">Sound/Audio/Entertainment</a><br>');
 document.write(' <a href="../caliber/interior.html">Interior</a><br>');
 document.write(' <a href="../caliber/versatility.html">Versatility</a><br>');
 document.write(' <a href="../caliber/performance.html">Performance</a><br>');
 document.write(' <a href="../caliber/safety.html">Safety</a><br>');
 document.write(' <a href="javascript:start(\'2007caliber\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'avenger') {
 document.write(' <a href="../avenger/index.html">Home Page</a><br>');
 document.write(' <a href="../avenger/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../avenger/exterior.html">Exterior</a><br>');
 document.write(' <a href="../avenger/interior.html">Interior</a><br>');
 document.write(' <a href="../avenger/performance.html">Performance/Handling</a><br>');
 document.write(' <a href="../avenger/safety.html">Safety</a><br>');
 document.write(' <a href="javascript:start(\'2008avenger\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'charger') {
 document.write(' <a href="../charger/index.html">Home Page</a><br>');
 document.write(' <a href="../charger/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../charger/exterior.html">Exterior</a><br>');
 document.write(' <a href="../charger/interior.html">Interior</a><br>');
 document.write(' <a href="../charger/performance.html">Performance/Engineering</a><br>');
 document.write(' <a href="../charger/handling.html">Control/Handling</a><br>');
 document.write(' <a href="../charger/safety.html">Safety and Security</a><br>');
 document.write(' <a href="javascript:start(\'2007charger\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'nitro') {
 document.write(' <a href="../nitro/index.html">Home Page</a><br>');
 document.write(' <a href="../nitro/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../nitro/exterior.html">Exterior</a><br>');
 document.write(' <a href="../nitro/technology.html">Technology and Entertainment</a><br>');
 document.write(' <a href="../nitro/interior.html">Interior</a><br>');
 document.write(' <a href="../nitro/versatility.html">Versatility</a><br>');
 document.write(' <a href="../nitro/performance.html">Performance</a><br>');
 document.write(' <a href="../nitro/safety.html">Safety</a><br>');
 document.write(' <a href="javascript:start(\'2007nitro\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'magnum') {
 document.write(' <a href="../magnum/index.html">Home Page</a><br>');
 document.write(' <a href="../magnum/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../magnum/exterior.html">Exterior</a><br>');
 document.write(' <a href="../magnum/interior.html">Interior</a><br>');
 document.write(' <a href="../magnum/capability.html">Extreme Capability</a><br>');
 document.write(' <a href="../magnum/safety.html">Safety</a><br>');
 document.write(' <a href="javascript:start(\'2007magnum\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'durango') {
 document.write(' <a href="../durango/index.html">Home Page</a><br>');
 document.write(' <a href="../durango/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../durango/exterior.html">Exterior</a><br>');
 document.write(' <a href="../durango/interior.html">Interior</a><br>');
 document.write(' <a href="../durango/capability.html">Capability</a><br>');
 document.write(' <a href="../durango/safety.html">Safety</a><br>');
 document.write(' <a href="javascript:start(\'2007durango\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'dakota') {
 document.write(' <a href="../dakota/index.html">Home Page</a><br>');
 document.write(' <a href="../dakota/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../dakota/performance.html">Performance/Functionality</a><br>');
 document.write(' <a href="../dakota/exterior.html">Exterior</a><br>');
 document.write(' <a href="../dakota/interior.html">Interior</a><br>');
 document.write(' <a href="../dakota/safety.html">Safety and Security</a><br>');
 document.write(' <a href="javascript:start(\'2007dakota\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'viper') {
 document.write(' <a href="../viper/index.html">Home Page</a><br>');
 document.write(' <a href="../viper/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../viper/exterior.html">Exterior</a><br>');
 document.write(' <a href="../viper/interior.html">Interior</a><br>');
 document.write(' <a href="../viper/powerhandling.html">Power and Handling</a><br>');
 document.write(' <a href="javascript:start(\'2007viper\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'ram1500') {
 document.write(' <a href="../ram1500/index.html">Home Page</a><br>');
 document.write(' <a href="../ram1500/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../ram1500/exterior.html">Exterior</a><br>');
 document.write(' <a href="../ram1500/interior.html">Interior</a><br>');
 document.write(' <a href="../ram1500/performance.html">Performance and Durability</a><br>');
 document.write(' <a href="../ram1500/safety.html">Safety</a><br>');
 document.write(' <a href="javascript:start(\'2007ram1500\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'ram2500') {
 document.write(' <a href="../ram2500/index.html">Home Page</a><br>');
 document.write(' <a href="../ram2500/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../ram2500/exterior.html">Exterior</a><br>');
 document.write(' <a href="../ram2500/interior.html">Interior</a><br>');
 document.write(' <a href="../ram2500/performance.html">Performance and Durability</a><br>');
 document.write(' <a href="../ram2500/safety.html">Safety</a><br>');
 document.write(' <a href="javascript:start(\'2007ram2500\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'ram3500') {
 document.write(' <a href="../ram3500/index.html">Home Page</a><br>');
 document.write(' <a href="../ram3500/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../ram3500/exterior.html">Exterior</a><br>');
 document.write(' <a href="../ram3500/interior.html">Interior</a><br>');
 document.write(' <a href="../ram3500/performance.html">Performance and Durability</a><br>');
 document.write(' <a href="../ram3500/safety.html">Safety</a><br>');
 document.write(' <a href="javascript:start(\'2007ram3500\',\'dodge\',\'en\');">Build and Price</a><br>');
} else if (vehicle == 'sprinter') {
 document.write(' <a href="../sprinter/index.html">Home Page</a><br>');
 document.write(' <a href="../sprinter/colourswheels.html">Colours and Wheels</a><br>');
 document.write(' <a href="../sprinter/ownership.html">Low Cost of Ownership</a><br>');
 document.write(' <a href="../sprinter/capability.html">Capability</a><br>');
 document.write(' <a href="../sprinter/safety.html">Safety</a><br>');
 document.write(' <a href="javascript:start(\'2006sprinter\',\'dodge\',\'en\');">Build and Price</a><br>');
}
 document.write(' </td>');
 document.write('</tr>');
 document.write('</table>');
 document.write('</div>'); 
}








function AC_AddExtension(src, ext)
{
    return src;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function writeFlash(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
