// ---------------------------------------------------------------------------------------
// Universal Popup function
function universal(name,vehicle) {
// 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();	

          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 + ".chrysler.ca/vehsuite/GetQuote.jsp?vehicle="+ vehicle +"&lang=fr-ca";h=600;w=774;break;
    case "retailer": url = "http://" + env + ".chrysler.ca/vehsuite/DealerSearch.jsp?lang=fr-ca";;windowname=name;h=420;w=760;break;
   // case "getaquote": url = "http://www.daimlerchrysler.ca/CA/04/FR/DODGE/1,,CA-04-FR-CHRYSLER-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=C";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-5.chrysler.ca/incentives/FrontController?language=FR&brand=Chrysler";popup = false; currentwin=true; break;
       case "specialoffers": url = "http://www.chryslercanada.ca/fr/specialoffers/index.php?brand=chrysler";popup = false; currentwin=true; break;
	   
    case "specialofferspopup": url = "http://www-5.chrysler.ca/incentives/FrontController?language=FR&brand=Chrysler";;windowname="specialoffers";h=755;w=808;break;
    //case "specialoffers": url = "http://www.daimlerchrysler.ca/FR/CHRYSLER/1,,FR-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 Chrysler Canada web site.  Chrysler Canada Inc., its agents, affiliates, officers, directors, employees and insurers (Chrysler 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/FR/CHRYSLER/1,,CA-04-FR-CHRYSLER-BUILD_AND_PRICE,.html";popup=false;currentwin=true;break;
  
  /*case "getabrochure": url = "http://www-5.chrysler.ca/crmforms/GetForm.jam?PageName=personal_info&SalesMarket=C&CountryCode=CA&LanguageCode=FR&Brand=Chrysler&FormName=getabrochure&MediaCode=WS20&MediumCode=CGAB04&PromoCode=0000000";w=600;break;
  
    case "efamily": url = "http://www-5.chrysler.ca/crmforms/GetForm.jam?PageName=personal_info&SalesMarket=C&CountryCode=CA&LanguageCode=FR&Brand=Chrysler&FormName=efamilyregistration&MediaCode=WS20&MediumCode=EFAM04&PromoCode=0000000";w=600;break;	*/
	
	
case "getabrochure": url = "http://www.chryslercanada.ca/fr/crm/index.php?brand=chrysler&form=gab";windowname=name;popup=false;currentwin=true;break;
case "efamily": url = "http://www.chryslercanada.ca/fr/crm/index.php?brand=chrysler&form=efamily";windowname=name;popup=false;currentwin=true;break;
	
	
    case "compare": url = "http://www.daimlerchrysler.ca/CA/04/FR/CHRYSLER/1,,CA-04-FR-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/FR/RECOMMENDATIONS/1,,FR-RECOMMENDATIONS,.html";h=315;w=463;windowname=name;break;
    case "fleet": url = "http://www.fleet.daimlerchrysler.ca/CA/04/FR/FLEET/1,,CA-04-FR-FLEET,.html";windowname=name;popup=false;break;	
    case "financial": url = "http://www.daimlerchryslerfinancial.ca/en/index.jsp";windowname=name;popup=false;break;
    case "owners": url = "http://www.daimlerchrysler.ca/CA/03/FR/OWNERS/1,,CA-03-FR-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/FR/LEGAL/1,,CA-04-FR-LEGAL,.html";h=450;w=790;break;
    case "recommender": url = "http://www-5.chrysler.ca/vehicleRecommender/RecommenderController?action=vehicleRecommender&language=FR&sales_market=C&brand=Chrysler";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=Chrysler&Language=FR&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=Chrysler&Language=FR&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=FR&Brand=Chrysler";
}
// 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
}
}

//-------------------------------------------------------------------------------------------
