// 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"));
}



// THE FOLLOWING TWO FUNCTIONS ARE USED TO SHOW/HIDE LAYERS IN THE CONTENT SECTIONS

  function show_layer(name) {
   var showArrow = name + "_show";
   var hideArrow = name + "_hide";
   var layerName = document.getElementById(name);
   var showArrowLayer = document.getElementById(showArrow);
   var hideArrowLayer = document.getElementById(hideArrow);
   layerName.style.display='block';
   showArrowLayer.style.display='none';
   hideArrowLayer.style.display='block';   
  }
  
  function hideLayer(name) {
   var showArrow = name + "_show";
   var hideArrow = name + "_hide";
   var layerName = document.getElementById(name);
   var showArrowLayer = document.getElementById(showArrow);
   var hideArrowLayer = document.getElementById(hideArrow);
   layerName.style.display='none';
   showArrowLayer.style.display='block';
   hideArrowLayer.style.display='none';
  }
  
  function showTitle(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 hideTitle(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 showIt(name) {
   var layerName = document.getElementById(name);
   layerName.style.display='block';
  }
  
  function hideIt(name) {
   var layerName = document.getElementById(name);
   layerName.style.display='none';
  }
  

// THE FOLLOWING FOUR FUNCTIONS ARE USED TO SHOW A LARGER VERSION OF THE IMAGE FROM THE CONTENT SECTIONS  
function showMinor(vehicle,imgname,imgext,sw,sh,enlarge,lw,lh,caption) {
 popupHeight = (lh);
 if (enlarge == 'yes') {
  caption = replaceAll(caption,"&#65533;","QUOTE");
  document.write("<a href=\"javascript:popup_all('../common/enlarge.html?vehicle="+vehicle+"&name="+imgname+"&ext="+imgext+"&w="+lw+"&h="+lh+"&caption="+caption+"','openme3','0','0','0','0','0','no','yes','"+popupHeight+"','510');\"><img src=\"../"+vehicle+"/"+imgname+"."+imgext+"\" width="+sw+" height="+sh+" border=\"0\"><br><img src=\"../common/img/all_view_larger_image.gif\" width=\"200\" height=\"30\" alt=\"\" border=\"0\" /></a>");
 } else {
  document.write("<img src=\"../"+vehicle+"/"+imgname+"."+imgext+"\" width="+sw+" height="+sh+" border=\"0\"><br><img src=\"../common/img/c.gif\" width=\"200\" height=\"10\" alt=\"\">");
 }  
}

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>");
}


//----- To be used for popup windows all parameters passed
function popup_all(topic,namer,tool,loc,dir,stat,menu,scroll,resize,x,y) {

 var tmp = location.hostname.split(".");
 var env = tmp[0].toLowerCase();	 

 if(namer == "contact"){
  if(env == "test"){
	urlmod = "http://test-5.dodge.ca/wccs-ca/index_en.jsp";
  }
  if(env == "dev"){
	urlmod = "http://uat-5.dodge.ca/wccs-ca/index_en.jsp"; 
  }
  if(env == "uat"){
	urlmod = "http://uat-5.dodge.ca/wccs-ca/index_en.jsp"; 
  }
  if(env == "www"){
   urlmod = "http://www-5.dodge.ca/wccs-ca/index_en.jsp"; 
  }
  if(env == "53"){
   urlmod = "http://test-5.dodge.ca/wccs-ca/index_en.jsp"; 
  }
  if(env == "jeep"){
   urlmod = "http://www-5.jeep.ca/wccs-ca/index_en.jsp"; 
  }
  if(env == "dodge"){
   urlmod = "http://www-5.dodge.ca/wccs-ca/index_en.jsp"; 
  }
  if(env == "chrysler"){
   urlmod = "http://www-5.chrysler.ca/wccs-ca/index_en.jsp"; 
  } 
          // ASC environments
          if(env == "qa-dcci-config"){
             env = "uat-5";
          }
          if(env == "dcci-config"){
             env = "www-5";
          }  
  eval('window.open(urlmod, namer, "history=no,toolbar='+tool+',location='+loc+',directories='+dir+',status='+stat+',menubar='+menu+ ',scrollbars='+scroll+',resizable='+resize+',width=' +  y  + ',height=' +  x + '");');
 } else {
  eval('window.open(topic, namer, "history=no,toolbar='+tool+',location='+loc+',directories='+dir+',status='+stat+',menubar='+menu+ ',scrollbars='+scroll+',resizable='+resize+',width=' +  y  + ',height=' +  x + '");');
 }
}

//ROLLOVER FUNCTION

var loaded = new Array();

function loadRollover(image,imageName) {
   if (image && image.src &&
    (null == image.out || typeof(image.out) == typeof(void(0)))) {
      s = image.src;
      image.out = new Image();
      image.out.src = s;
      image.over = new Image();
      if (imageName.lastIndexOf('/') >= 0 || imageName.lastIndexOf('\\') >=0) {
         s = imageName;
      } else {
         i = s.lastIndexOf('/');
         if (i<0) i = s.lastIndexOf('\\');
         if (i<0) { s = imageName; }
         else     { s = s.substring(0,i+1) + imageName; }
      }
      image.over.src = s;
      loaded[image.name] = image;
   }
}
function roll(imageName,over) {
   if (document.images) {
      if (over) { imageObject = "over"; }
      else      { imageObject = "out"; }
   image = loaded[imageName];
   if (image) {
       ref = eval("image."+imageObject);
       if (ref) image.src = eval("image."+imageObject+".src");
   }
   if (window.event)
      window.event.cancelBubble = true;
   }
}



function closeDivs() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
if (myHeight < 700) {
 hideAll();
}  
}


 function hideAll() {
  x = 1;	 
  while (layerName != '') {
    var name = "feature" + x + "_content";
	var more = "feature" + x + "_content_show";
	var less = "feature" + x + "_content_hide";

    var layerName = document.getElementById(name);	
    var moreLayerName = document.getElementById(more);	
    var lessLayerName = document.getElementById(less);	
	
    if (layerName == null) {
     break
	} else {
     layerName.style.display='none';
     moreLayerName.style.display='block';
     lessLayerName.style.display='none';
	}
	x++;
   }
  //document.getElementById('showAllLayer').style.display = 'block'; 
  //document.getElementById('hideAllLayer').style.display = 'none';
  } 




// ---------------------------------------------------------------------------------------
// Universal Popup function
function universal(name,vehicle,noinvoke) {
	
	var noinvoke = (noinvoke == null) ? noinvoke=false : noinvoke;
	
// Defining default values
h = 480;
w = 490;
scrolling = "yes";
windowname = "open_me";
input_box = true;
popup = true;
currentwin=false;

//------------------------new section for trilogy BP ------------------
var tmp = location.hostname.split(".");
var env = tmp[0].toLowerCase();
var site = tmp[1].toLowerCase();

          if(env == "test"){
	   env = "test-5";  
	  }
	  if(env == "dev"){
	   env = "uat-5";
	  }
	  if(env == "uat"){
	   env = "uat-5";
	  }
	  if(env == "www"){
	    env = "www-5";
	  }
          if(env == "53"){
            env = "test-5";
          }
          //if(env == "jeep"){
          //   env = "www-5";
          //}
          if(env == "dodge"){
             env = "www-5";
          }
          if(env == "chrysler"){
             env = "www-5";
          }  
          // ASC environments
          if(env == "qa-dcci-config"){
             env = "uat-5";
          }
          if(env == "dcci-config"){
             env = "www-5";
          }		  

//------------------------new section for trilogy BP ------------------


// Associating the name of the link with the url
switch (name)
{
      
    case "getaquote": url = "http://" + env + ".dodge.ca/vehsuite/GetQuote.jsp?vehicle="+ vehicle +"&lang=en-ca";h=600;w=774;break;
 
 //  case "retailer": url = "http://" + env + ".dodge.ca/vehsuite/DealerSearch.jsp?lang=en-ca";;windowname=name;h=420;w=770;break;

   case "retailer": url = "http://www.chrysler.ca/retailer/index.php?brand=jeep&language=en";windowname=name;h=565;w=992;break;	
   
   // case "getaquote": url = "http://www.daimlerchrysler.ca/CA/04/EN/DODGE/1,,CA-04-EN-DODGE-QUOTE,.html";h=580;w=620;break;
   // case "retailer": url = "http://www.c1hrapps.com/locator/CA/?presentationId=dlen_CAsdc1&brand=D";windowname=name;h=420;w=620;break;
    case "inventory": url = "http://www.c1hrapps.com/locator/CA/?presentationId=dlen_CAinc1&brand=D";windowname=name;h=420;w=620;break;    
   // case "specialoffers": url = "http://www.daimlerchryslerhotdeals.ca/en";h=600;w=700;break;
   case "specialoffers": url = "http://www.chryslercanada.ca/fr/specialoffers/index.php?brand=dodge";popup = false; currentwin=true; break;
   
      // case "specialofferspopup": url = "http://www.chryslercanada.ca/fr/specialoffers/index.php?brand=dodge";windowname="specialoffers";h=755;w=1024;break;
	
  case "specialofferspopup": url = "http://www.getachryslerjeepdodge.ca/";windowname="specialoffers";h=800;w=1024;break;
	  
    //case "specialoffers": url = "http://www.daimlerchrysler.ca/EN/CHRYSLER/1,,EN-CHRYSLER-PLUS,.html";h=610;w=650;break;
    //case "blackbook": url = "http://www.daimlerchrysler.ca/cgi-bin/getcbb.cgi?en"; input_box=confirm("You are now leaving the DaimlerChrysler Canada web site. DaimlerChrysler Canada Inc., its agents, affiliates, officers, directors, employees and insurers (DaimlerChrysler Canada)  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? ");break;
    case "blackbook": url = "http://www.canadianblackbook.com/prv/auth.cfm?token=AB04DC39ZKL01"; input_box=confirm("You are now leaving the DaimlerChrysler Canada web site. DaimlerChrysler Canada Inc., its agents, affiliates, officers, directors, employees and insurers (DaimlerChrysler Canada)  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? ");break;

    case "buildyourown": url = "http://www.daimlerchrysler.ca/CA/04/EN/CHRYSLER/1,,CA-04-EN-CHRYSLER-BUILD_AND_PRICE,.html";popup=false;currentwin=true;break;
 
 /*
  case "getabrochure": url = "http://www-5.dodge.ca/crmforms/GetForm.jam?PageName=personal_info&SalesMarket=C&CountryCode=CA&LanguageCode=EN&Brand=Dodge&FormName=getabrochure&MediaCode=WS20&MediumCode=DGGABR&PromoCode=0000000";w=600;break;
  
    case "efamily": url = "http://www-5.dodge.ca/crmforms/GetForm.jam?PageName=personal_info&SalesMarket=C&CountryCode=CA&LanguageCode=EN&Brand=Dodge&FormName=efamilyregistration&MediaCode=WS20&MediumCode=EFAMIL&PromoCode=0000000";w=600;break;*/
	
case "getabrochure": url = "http://www.chryslercanada.ca/fr/crm/index.php?brand=dodge&form=gab";windowname=name;popup=false;currentwin=true;break;
case "efamily": url = "http://www.chryslercanada.ca/fr/crm/index.php?brand=dodge&form=efamily";windowname=name;popup=false;currentwin=true;break;
  

	
    case "compare": url = "http://www.daimlerchrysler.ca/CA/04/EN/CHRYSLER/1,,CA-04-EN-CHRYSLER-COMPARE,.html";w=610;h=610;self.name="Configurator";break;
    case "accessories": w=800;h=540;windowname=name;break;
    case "recommendations": url = "http://www.daimlerchrysler.ca/EN/RECOMMENDATIONS/1,,EN-RECOMMENDATIONS,.html";h=315;w=463;windowname=name;break;
    case "fleet": url = "http://www.fleet.daimlerchrysler.ca/CA/04/EN/FLEET/1,,CA-04-EN-FLEET,.html";windowname=name;popup=false;break;	
    case "financial": url = "http://www.daimlerchryslerfinancial.ca/fr/index.jsp";windowname=name;popup=false;break;
    case "owners": url = "http://www.daimlerchrysler.ca/CA/03/EN/OWNERS/1,,CA-03-EN-OWNERS,.html?Chrysler";windowname=name;popup=false;break;
    case "worldwide": url="http://www.international.chryslercorp.com";h=520;w=840;break;
    case "disclaimer": url = "http://www.daimlerchrysler.ca/CA/04/EN/LEGAL/1,,CA-04-EN-LEGAL,.html";h=450;w=790;break;
    case "recommender": url = "http://www-5.dodge.ca/vehicleRecommender/RecommenderController?action=vehicleRecommender&language=EN&sales_market=C&brand=Dodge";w=775;h=605;break;
    case "store": url = "http://www.dodgegear.ca";windowname=name;h=470;w=860;break;
    default:
}












if(name == "accessories" && vehicle != null) {
	origin="Mopar1"
	switch (vehicle) {
		case "sebringsedan": vehicle = "SebringSedan";break;
		case "sebringconvertible": vehicle = "SebringConvertible";break;
		case "intrepid": vehicle = "Intrepid";break;
		case "concorde": vehicle = "Concorde";break;
		case "300m": vehicle = "300m";break;
		case "town_country": vehicle = "TownCountry";break;
		case "pt_cruiser": vehicle = "PTCruiser";break;
		case "pacifica": vehicle = "Pacifica";break;
		case "crossfire": vehicle = "Crossfire";break;
		default:
	}
	url = "http://www.daimlerchrysler.ca/configurator/FrontController?SalesMarket=C&Origin="+origin+"&Brand=Dodge&Language=EN&Year=2003&Nameplate="+vehicle+"&ModelTitle=&DefaultConfig=&MainPaint=&ConfigData=&MaxNav=1&CurrentNav=1&PartsSummary=&PartsQuantity=&PartsSubTotal=&ButtonPressed=NextStep&MaxNav=1";
	//url = "http://www.daimlerchrysler.ca/configurator/FrontController?SalesMarket=C&Origin="+origin+"&Brand=Dodge&Language=EN&Year=2003&Nameplate="+vehicle+"&ModelTitle=&DefaultConfig=&MainPaint=&ConfigData=&MaxNav=1&CurrentNav=1&PartsSummary=&PartsQuantity=&PartsSubTotal=&ButtonPressed=NextStep&MaxNav=1";
} else if(name == "accessories" && vehicle == null) {
	origin="MOPAR";
	url = "http://www.daimlerchrysler.ca/configurator/FrontController?Origin="+origin+"&Year=2003&SalesMarket=C&Language=EN&Brand=Dodge";
}


//Determining if its a flash invoke method to be called AA -- case all brands for retailer

if(   ((site == "jeep")  ||  (env == "jeep"))  && noinvoke == false  ){
   
invokeElement('LocateDealer');

}else{//else use univeral as normal

// Determining if popup
if (popup == false && url != null) {
	if (currentwin==true){
		location.href=url;
	} else {
		eval(window.open(url,windowname));
	}
} else if (input_box==true && url != null) {
	// Output when OK is clicked
	eval(window.open(url,windowname,"history=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scrolling+",resizable=yes,width="+w+",height="+h));
} else {
	// Output when CANCEL is clicked and url is a null value
 }
}//end of new if AA for invoke


}

//-------------------------------------------------------------------------------------------



//---- Popup for P&E  New - Trilogy
function start(namePlate, brand ,lang) {   

if (namePlate == "CARAVAN") {
 namePlate = "2006caravan";
} else if (namePlate == "CHARGER") {
 namePlate = "2006charger";
} else if (namePlate == "MAGNUM") {
 namePlate = "2006magnum";
} else if (namePlate == "DURANGO") {
 namePlate = "2006durango";
} else if (namePlate == "DAKOTA") {
 namePlate = "2006dakota";
} else if (namePlate == "RAM_PICKUP_1500") {
 namePlate = "2006ram1500";
} else if (namePlate == "RAM_PICKUP_2500_3500") {
 namePlate = "2006ram2500";
} else if (namePlate == "SX20") {
 namePlate = "2006srt4";
} else if (namePlate == "VIPER") {
 namePlate = "2006viper";
} else if (namePlate == "SPRINTER") {
 namePlate = "2006sprinter";
}else if (namePlate == "CALIBER") {
 namePlate = "2007caliber";
}

	 var lang = lang.toLowerCase();
	var tmp = location.hostname.split(".");
	var env = tmp[0].toLowerCase();
          if(env == "test"){
	   env = "test-5";  
	  }
	  if(env == "dev"){
	   env = "uat-5";
	  }
	  if(env == "uat"){
	   env = "uat-5";
	  }
	  if(env == "www"){
	    env = "www-5";
	  }
          if(env == "53"){
            env = "test-5";
          }
          if(env == "jeep"){
             env = "www-5";
          }
          if(env == "dodge"){
             env = "www-5";
          }
          if(env == "chrysler"){
             env = "www-5";
          }  
          // ASC environments
          if(env == "qa-dcci-config"){
             env = "uat-5";
          }
          if(env == "dcci-config"){
             env = "www-5";
          }		  
         // url = "http://"+ env + ".dodge.ca/vehsuite/ModelSelector.jsp?vehicle=" + namePlate+"&lang="+lang+"-ca"; 
		// url = "http://dcci-config.autodatadirect.com/chryslerca/buildYourVehicle.html?modelYearCode="+namePlate+"&language="+lang
		  url = "http://www.chryslerhotdeals.ca/exo/fr/index.php?vehicle=" + namePlate+"&lang=en-ca&brand=dodge"; 
	  //alert("PLEASE NOTE: We are in the process of updating the pricing information within Build and Price. The prices shown are valid for vehicles received at dealerships before October 2, 2005. There may be an increase in the MSRP of the vehicles received after this date.  Please see your local retailer for current vehicle pricing.");
          self.name = "Configurator";
	  location.href=url;
}




// ---------------------------------------------------------------------------------------




//---DISCLAIMER FUNCTIONS --

  







	   //remove learnmore ----------------------------
    function Remove_learn_more(){
    obj = document.getElementById("outlayer_lm");
    obj.style.display = "none";
}





//this is learnmore callback ajax function  ---------------------------------------------------------------------------------------------------------    
function getcontent_status_lm(content_status_in)       //receives the reply from Ajax and PHP file runquery.php and displays
{
                  
  obj = document.getElementById("outlayer_lm");
  
  if(mouseX > 600){compensate = 350;}else{compensate=20;}
  
  obj.style.left = mouseX - compensate +"px";           //addition of 10 pixels for style reasons  - left
  obj.style.top = mouseY + "px";      //addition of -2 pixels for style reasons  - top
       
  obj.style.display = "block";

	
  document.getElementById("outlayer_lm").innerHTML = content_status_in;

 }
   
 
 
 
 
 
 
 
 
 //start of GENERIC POP UP DIV APP AA APRIL 8TH ---------------- 
	 
	  
 
 
function Create_generic_popdiv(div_label,fromleft,fromtop,frommouse,vehicle){		

		 
 if(vehicle == "ram"){
content_in ="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\" style=\"border-width: 4px; border-style: solid;  border-color: #000000;\"><tr><td valign=\"top\"  height=\"25\" bgcolor=\"#000000\"><a href=\"javascript:Remove_generic_popdiv('ram_choice_div');\" ><img src=\"/fr/img/dod_lm_header.gif\" border=\"0\" width=\"350\" height=\"45\" alt=\"\"></a></td></tr><tr><td valign=\"top\" style=\"padding: 10px;\"><img src=\"/fr/img/choose_your_ram.gif\" border=\"0\" width=\"250\" height=\"25\" alt=\"CHOOSE YOUR RAM:\"><br><a href=\"/fr/ram_1500/\"><img src=\"/fr/img/ram_1500_button.gif\" border=\"0\" width=\"250\" height=\"25\" alt=\"RAM 1500\"></a><br><a href=\"/fr/ram_2500/\"><img src=\"/fr/img/ram_2500_button.gif\" border=\"0\" width=\"250\" height=\"25\" alt=\"RAM 2500\"></a><br><a href=\"/fr/ram_3500/\"><img src=\"/fr/img/ram_3500_button.gif\" border=\"0\" width=\"250\" height=\"25\" alt=\"RAM 3500\"></a><br><a href=\"/fr/ram_4500_5500/\"><img src=\"/fr/img/ram_45005500_button.gif\" border=\"0\" width=\"250\" height=\"25\" alt=\"RAM 4500/5500\"></a><br /><br /></td></tr></table>";
}

 if(vehicle == "challenger"){
content_in ="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\" style=\"border-width: 4px; border-style: solid;  border-color: #000000;\"><tr><td valign=\"top\"  height=\"25\" bgcolor=\"#000000\"><a href=\"javascript:Remove_generic_popdiv('ram_choice_div');\" ><img src=\"/fr/img/dod_lm_header.gif\" border=\"0\" width=\"350\" height=\"45\" alt=\"\"></a></td></tr><tr><td valign=\"top\" style=\"padding: 10px;\"><img src=\"/fr/img/choose_your_challenger.gif\" border=\"0\" width=\"250\" height=\"25\" alt=\"CHOOSE MODEL YEAR:\"><br><a href=\"/fr/challenger08/\"><img src=\"/fr/img/challenger08_button.gif\" border=\"0\" width=\"250\" height=\"25\" alt=\"2008\"></a><br><a href=\"/fr/challenger/\"><img src=\"/fr/img/challenger09_button.gif\" border=\"0\" width=\"250\" height=\"25\" alt=\"2009 Challenger\"></a><br /><br /></td></tr></table>";
}
	obj = document.getElementById(div_label);
	
	
	if(frommouse == true){
	if(mouseX > 600)
			{compensate = -350;}
	else{compensate=0;}
	obj.style.left = mouseX + compensate+"px";	   //addition of 10 pixels for style reasons  - left
	obj.style.top = mouseY + "px";	    //addition of -2 pixels for style reasons  - top
	}
	else{
	obj.style.left = fromleft + "px";	   //addition of 10 pixels for style reasons  - left
	obj.style.top = fromtop + "px";	    //addition of -2 pixels for style reasons  - top	
		
	}
	
	obj.style.display = "block";	
	
	
	document.getElementById(div_label).innerHTML = content_in; 
	
	//timeout = setTimeout('Remove_tool_tip()',5000);	//this is remove it automatically
}





//END of GENERIC POP UP DIV APP AA APRIL 8TH ---------------- 
 
 	 function Remove_generic_popdiv(div_label_close){
	obj = document.getElementById(div_label_close);
	obj.style.display = "none";
}

 
 
 
//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);
	}
}	 
	  

//NavRollover

function buzzRO(img,state) {
 if (state == 'on') { document.images[img].src = eval(img + "_on.src"); }
 else { document.images[img].src = eval(img + ".src"); }
}

function preload(imgObj) {
	if (document.images) {
		eval(imgObj+' = new Image()');
		imgSrc = ('/en/img/' + imgObj + '.gif');			
		eval(imgObj+'.src = "'+imgSrc+'"');
		eval(imgObj+'_on = new Image()');
		imgSrc = ('/en/img/' + imgObj + '_on.gif');			
		eval(imgObj+'_on.src = "'+imgSrc+'"');		
	}
}
/*

preload('nav_commander');
preload('nav_compass');
preload('nav_grandcherokee');
preload('nav_liberty');
preload('nav_patriot');
preload('nav_wrangler');
preload('nav_buildandprice');
preload('nav_colourswheels');
preload('nav_photogallery');
preload('nav_keyfeatures');
preload('nav_modelspecs');

preload('closeButton');
*/

	   

function imgToggle(img,state) { 
 if (state == 'on') { document.images[img].src = eval(img + "_on.src");state = 'off'; }
 else { document.images[img].src = eval(img + ".src");state='on'; }
}
	   
	   
imageStay = "";
prev = "";
check = true;

function stayImage(name,path,nextclick){
	if (check == true){
	document[name].src = path;
	if (imageStay != name){
		if (imageStay != ""){
			document[imageStay].src = prev;
		}
	}
	imageStay = name;
	prev = nextclick;
	if (check == true){
	 check = false;
	} else {
	 check = true;
	}
	}
}	   
	 


  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(token) {
 input_box=confirm("You are now leaving the Jeep 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
       
       // topic="http://www.canadianblackbook.com/prv/auth.cfm?token=AB04DC39ZKL01";
		 topic = "http://tradein.canadianblackbook.com/tradein/java/entry_token_"+token+"?siteLanguage=EN_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
 }
}	 
	 
	 
	 
	   
