var version, swfFlash;
var sTag = "<";
var eTag = ">";
if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){
	version = "10";
}	else{
	version = "10";
}
function panoBarsDown() {
		tagMe("footerContainer","className","footerContainer clearfix footerAreaUp");
		tagMe("panoBars","className","panoBarsDown");
		tagMe("panoBars","className","panoBarsDown");
		tagMe("homePanoBlock","className","under");
}
function panoBars() {
		tagMe("footerContainer","className","footerContainer clearfix");
		tagMe("panoBars","className","panoBars");
		tagMe("homePanoBlock","className","over");
}

function ramLink(lang,linkType,nameplate,acode,category) {

	if (nameplate == "hd") {
		nameplate = "Ram2500";
	} else if (nameplate == "ld") {
		nameplate = "Ram1500";
	}
	if (linkType == "Features") {
		goHere("http://www.dodge.ca/"+lang+"/vehicle_home.php?np="+nameplate);
	} else if (linkType == "Category") {
		goHere("http://www.dodge.ca/"+lang+"/key_features.php?np="+nameplate+"&cat=".category.toUpperCase());
	} else if (linkType == "CompComp") {
		dcLightboxCC(lang,'ram','Comp',nameplate,'','','','');
 	} else {
		dcLightbox(lang,'ram',linkType,nameplate,acode);
	}
}

function fixPage(p) {
	p = p.replace(/<sup>mc<\/sup>/g, "");
	p = p.replace(/<sup>md<\/sup>/g, "");
	p = p.replace(/<sup>/g, "");
	p = p.replace(/<\/sup>/g, "");
	return p;
}

function footerUp() { // footer needs to have z-index of 2;
		tagMe("footerArea","className","footerArea footerAreaUp");
}
function footerDown() { // footer needs to have z-index of 0;
		tagMe("footerArea","className","footerArea");
}


// New eFamily pilot project
function Getpilotinfo(vecname,lang){
url = "http://www.daimlerchryslerefamily.ca/efamily_pilot/"+lang+"/index.php?vecid="+ vecname;

eval(window.open(url,vecname,"history=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=800,height=600"));
}

function tradePromo(lang,url) {
	var txt = "You are now leaving the Dodge web site. ChryslerCanada Inc., its agents, affiliates, officers, directors, employees and insurers (ChryslerCanada)  make no warranty of any kind regarding the accuracy and use of the information on the Canadian Black Book site and is not liable for damages of any kind arising out of your access to or use of this Site. Your use of and browsing in this site are at your own risk. Would you like to continue? ";
	if (lang == "fr") {
		txt = "Vous quittez le site web de Dodge. Chrysler Canada Inc., ses agents, ses filiales, ses dirigeants, ses employés et ses assureurs (Chrysler Canada) n’énoncent aucune garantie à l’égard de la précision et de l’utilisation des renseignements qui figurent sur le site du Canadian Black Book et ne peuvent pas être tenus responsables d’un dommage quelconque découlant de l’accès à ce site ou de son utilisation. Vous utilisez et vous consultez ce site à vos propres risques. Voulez-vous continuer?";
 	}
	var response = window.confirm(txt);
  if (response) {
		window.location.href=url;
  }
}


function replaceAll(str, srch, rplc) {
    var idx = str.indexOf(srch);
    while (idx > -1) {
        str = str.replace(srch, rplc);
        idx = str.indexOf(srch);
    }
    return str;
}

//----- Get Query String from url
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
}

function enlargePhoto(vehicle,name,ext,w,h,caption) {
document.write("<div align=\"left\">");
document.write("<img src=\"../"+vehicle+"/"+name+"_lg."+ext+" \" width="+w+" height="+h+" border=\"0\" alt=\"\">");
document.write("</div>");
caption = replaceAll(caption,'%20'," ");
caption = replaceAll(caption,"QUOTE","&#65533;");
 caption = replaceAll(caption,"(TM)","™");
 caption = replaceAll(caption,"(R)","<sup>®</sup>");//for (R) sup
 caption = replaceAll(caption,"(R_SUB)","<sub>®</sub>");//for (R) sub
document.write("<div class=\"disclaimer\" style=\"padding: 3px; text-align: right;\">"+caption+"</div>");
}



//JavaScript Alert Function
function popPage(page,w,h) {
 eval('window.open(page, "popname", "height='+h+',width='+w+',location=no,scrollbars=yes,menubars=yes,toolbars=no,resizable=yes");');
}

function alertPop(url,message,w,h) {
	var prompt = confirm(message)
	if (prompt){
    	popPage(url,w,h);
	}
}	 


  function bpShow(name) {
   var showArrow = name + "_show";
   var hideArrow = name + "_hide";
   var showArrowLayer = document.getElementById(showArrow);
   var hideArrowLayer = document.getElementById(hideArrow);
   showArrowLayer.style.display='none';
   hideArrowLayer.style.display='block';   
  }
  
  function bpHide(name) {
   var showArrow = name + "_show";
   var hideArrow = name + "_hide";
   var showArrowLayer = document.getElementById(showArrow);
   var hideArrowLayer = document.getElementById(hideArrow);
   showArrowLayer.style.display='block';
   hideArrowLayer.style.display='none';
  }	 
	 
function kellyWin(lang,token) {
 if (lang == "fr") {
	 input_box=confirm("Vous quittez le site web de Ram. Chrysler Canada Inc., ses agents, ses filiales, ses dirigeants, ses employés et ses assureurs (Chrysler Canada) n’énoncent aucune garantie à l’égard de la précision et de l’utilisation des renseignements qui figurent sur le site du Canadian Black Book et ne peuvent pas être tenus responsables d’un dommage quelconque découlant de l’accès à ce site ou de son utilisation. Vous utilisez et vous consultez ce site à vos propres risques. Voulez-vous continuer?");
 } else {
 	input_box=confirm("You are now leaving the Ram web site. ChryslerCanada Inc., its agents, affiliates, officers, directors, employees and insurers (ChryslerCanada)  make no warranty of any kind regarding the accuracy and use of the information on the Canadian Black Book site and is not liable for damages of any kind arising out of your access to or use of this Site. Your use of and browsing in this site are at your own risk. Would you like to continue? ");
 }
 if (input_box==true)    {
  // Output when OK is clicked
			tagMe("kellyHTML","innerHTML","<img height=\"1\" width=\"1\" style=\"border-style:none;\" alt=\"\" src=\"http://www.googleadservices.com/pagead/conversion/1015168988/?label=xIX9CJyzxwEQ3P-I5AM&guid=ON&script=0\"/>");
       
       // topic="http://www.canadianblackbook.com/prv/auth.cfm?token=AB04DC39ZKL01";
		 topic = "http://tradein.canadianblackbook.com/tradein/java/entry_token_"+token+"?siteLanguage="+lang.toUpperCase()+"_CA";
  window.open(topic,"newWindow", 'history=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=600,height=480');
 } else {
        // Output when Cancel is clicked
 }
}	 
	 
	 
	 
	   

