	function openSRAQ(url){
        var w=861, h=740, bw, bh, bl, bt, topPos, leftPos;
        // CENTER POPUP
        if (document.all)
        {
        bw = screen.width;  bh = screen.height;  bl = 0;  bt = 0;
        }
        else
        {
        bw = window.outerWidth;  bh = window.outerHeight;  bl = window.screenX;  bt = window.screenY;
        }
        leftPos = Math.floor((bw-w)/2) + bl;
        topPos = Math.floor((bh-h)/2) + bt;
        var popWindow = window.open (url,"CurrentOffers","toolbar=0, status=0, width=" + w + "px, height=" + h + "px, top=" + topPos + "px, left=" + leftPos + "px");
                popWindow.focus();
        }
		
	function switchLangWithSession () {

		var engDelimiter = 'english',
	
		freDelimiter = 'french',
	
		newURL = switchLangSearch(engDelimiter, freDelimiter);
	
		if (newURL != 'null') {
	
			self.location = newURL;
	
			return;
	
		}
	
		engDelimiter = "lang=en";
	
		freDelimeter = "lang=fr";
	
		newURL = switchLangSearch(engDelimiter, freDelimeter);
	
		if (newURL != 'null') {
	
			self.location = newURL;
	
			return;
	
		}
	
		engDelimiter = "_code=en";
	
		freDelimeter = "_code=fr";
	
		newURL = switchLangSearch(engDelimiter, freDelimeter);
	
		if (newURL != 'null') {
	
			self.location = newURL;
	
			return;
	
		}
	
	}

	function switchLangSearch (engDelim, freDelim) {
	
		var docURL = document.URL,
	
		newURL = 'null',
	
		engPosition = 0,
	
		frePosition = 0,
	
		charStart = 0,
	
		charEnd = docURL.length + 1,
	
		engDelimiter = engDelim,
	
		freDelimiter = freDelim;
	
		do {
	
			var test = docURL.substr(charStart, engDelimiter.length);
	
			if (test == engDelimiter) { engPosition = charStart;}
	
			charStart++;
	
		}
	
		while (charStart < charEnd - engDelimiter.length);
	
		if (engPosition > 0) {
	
			newURL = docURL.substr(0,engPosition) + freDelimiter + docURL.substr((engPosition + engDelimiter.length),docURL.length);
	
		} else {
	
			charStart = 0;
	
			do {
	
				var test = docURL.substr(charStart, freDelimiter.length)
	
				if (test == freDelimiter) { frePosition = charStart;}
	
				charStart++;
	
			}
	
			while (charStart < charEnd - freDelimiter.length);
	
			if (frePosition > 0) {
	
				newURL = docURL.substr(0,frePosition) + engDelimiter + docURL.substr((frePosition + freDelimiter.length),docURL.length);
			}
	
		}
	
		return newURL;
	}
	

	(function ()
	{
			
			/**
			* @menu		Nav Menu.
			*/
		var oNavMenu = 
			{
				/**
				* @function		getData
				* @usage		Returns the data object for the Site Nav Menu.
				*/
				getData: function ()
				{
					return [
						
							{
								title: {id: 'MyGMBTN', bURL: true, en: {value: 'My GM.ca', url: oEnv.getInfo().appServer + '/app/mygm/Logon.do?lang=en'}, fr: {value: 'Mon GM.ca', url: oEnv.getInfo().appServer + '/app/mygm/Logon.do?lang=fr'}},
								rows:
								[
									[
										{bURL: true, en: {value: 'My Showroom', url: oEnvInfo.appsSecureServer + '/app/mygm/MyShowroom.do?lang=en&cta=myshowroom'}, fr: {value: 'Ma salle d\'exposition', url: oEnvInfo.appsSecureServer + '/app/mygm/MyShowroom.do?lang=fr&cta=myshowroom'}},
										{bURL: true, en: {value: 'My Dealers', url: oEnvInfo.appsSecureServer + '/app/mygm/MyDealers.do?lang=en&cta=mydealers&ComponentName=buycentre'}, fr: {value: 'Mes concessionnaires', url: oEnvInfo.appsSecureServer + '/app/mygm/MyDealers.do?lang=fr&cta=mydealers&ComponentName=buycentre'}},
										{bURL: true, en: {value: 'My Driveway', url: oEnvInfo.appsSecureServer + '/app/mygm/MyDriveway.do?nav=mygm&lang=en'}, fr: {value: 'Mon garage', url: oEnvInfo.appsSecureServer + '/app/mygm/MyDriveway.do?nav=mygm&lang=fr'}},
										{bURL: true, en: {value: 'My Preferences', url: oEnvInfo.appsSecureServer + '/app/mygm/ManageProfile.do?lang=en'}, fr: {value: 'Mes pr&eacute;f&eacute;rences', url: oEnvInfo.appsSecureServer + '/app/mygm/ManageProfile.do?lang=fr'}}
									]
								]
							},
							
							{
								title: {id: 'nav_lang', bURL: true, en: {value: 'Fran&#231;ais', url: '/gm/french/home'}, fr: {bURL: true, value: 'English', url: '/gm/english/home'}}
							}
						];
				},
				
				/**
				* @function		getCSS
				* @usage		Returns the CSS for the Site Map Menu.
				*/
				getCSS: function ()
				{
					return '#NavMenuContainer {float: left !important; position: relative; repeat-x; z-index: 11000;}\n\
							#NavMenuContainer .MenuContentArea {float: left; position: relative;}\n\
							#NavMenuContainer .MenuColumn {float: left; position: relative;}\n\
							#NavMenuContainer .MenuColumn:hover .MenuColumnSection {display: block; visibility: visible;}\n\
							#NavMenuContainer .MenuColumnTitle {float: left; position: relative; height: 34px; line-height: 34px; font-weight: bold; cursor: pointer;}\n\
							#NavMenuContainer .MenuColumnTitle a {padding: 0 2px; font-size: 10px; font-weight: bold; color: #4F6A7F; text-decoration: none; border-right: 1px solid #686868;}\n\
							#NavMenuContainer .MenuColumnTitle a:hover {text-decoration: underline;}\n\
							#NavMenuContainer .MenuColumnTitle a.MenuTitleBorder {border: none;}\n\
							#NavMenuContainer .MenuColumnSection {padding: 5px 0; position: absolute; top: 34px; right: 0; background: #ccc; display: none; visibility: hidden;}\n\
							#NavMenuContainer .MenuColumnSection ul {margin: 0 0; padding: 0 0; list-style: none;}\n\
							#NavMenuContainer .MenuColumnSection ul li {padding: 1px 10px; text-align: left; white-space: nowrap;}\n\
							#NavMenuContainer .MenuColumnSection ul li a {font-size: 11px; color: #686868; text-decoration: none;}\n\
							#NavMenuContainer .MenuColumnSection ul li a:hover {text-decoration: underline;}';
				},
				
				/**
				* @function		getElement
				* @usage		Returns the xhtml elements for the Site Map Menu.
				*/
				getElement: function ()
				{
					var oDiv = document.createElement('div');
						oDiv.style.display = 'none';
						oDiv.style.visiblity = 'hidden';
					
					return oDiv;
				},
				
				/**
				* @function 	getContainer
				* @usage		Returns the menu container object.
				*/
				getContainer: function ()
				{
					return document.getElementById('NavMenuContainer');	
				},
				
				/**
				* @function		getContentArea
				* @usage		Returns the menu content object.
				*/
				getContentArea: function ()
				{
					return document.getElementById('NavMenuContentArea');	
				}
			};
			
			/**
			* @menu		Nav Menu.
			*/
		var oSocialMenu = 
			{
				/**
				* @note		currentTab, holds the value of the current tab selection.
				*/
				currentTab: null,
				
				/**
				* @function 	extendBuild
				* @usage		Updates the columns in the tab sections.
				*/
				extendBuild: function (sTab, oData)
				{
					var oContentArea = oSocialMenu.getContentArea();
						
						oContentArea.innerHTML = '';
						
					/**
					* @note		Ensure data integrity before continuing.
					*/
					if (typeof oData == 'object' && oData != null)
					{
						for (var i = 0, l = oData.length; i < l; ++i)
						{
							/**
							* @note		Pass the column's data to the addColumn function to create the column object.
							*/
							oContentArea.appendChild(oGlobalNavBuild.addColumn(oData[i], false, false));
						}
					}
					
					/**
					* @note		Adjust the background of the tab
					*/
					if (oSocialMenu.currentTab)
					{
						oSocialMenu.currentTab.style.background = 'url(' + oEnvInfo.imgServer + '/images/gmcl_navigation/tab_off.gif)';	
					}
					
					oSocialMenu.currentTab = document.getElementById(sTab);
					
					if (oSocialMenu.currentTab)
					{
						oSocialMenu.currentTab.style.background = 'url(' + oEnvInfo.imgServer + '/images/gmcl_navigation/tab_on.gif)';
					}
				},
				
				getGMData: function ()
				{
					return [
							{
								title: {bURL: true, bLink: true, bWindow: true, en: {value: '<div class="SocialLogo"><img class="SocialFacebook" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialFacebook" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								bBorder: true,
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'General Motors', url: 'http://www.facebook.com/generalmotors'}, fr: {value: 'General Motors', url: 'http://www.facebook.com/generalmotors'}},
										{bURL: true, bWindow: true, en: {value: 'OnStar', url: 'http://www.facebook.com/onstar'}, fr: {value: 'OnStar', url: 'http://www.facebook.com/onstar'}}
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialTwitter" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialTwitter" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'GM Canada', url: 'http://twitter.com/gmcanada'}, fr: {value: 'GM Canada', url: 'http://twitter.com/gmcanada'}},
										{bURL: true, bWindow: true, en: {value: 'General Motors', url: 'http://twitter.com/gmblogs'}, fr: {value: 'General Motors', url: 'http://twitter.com/gmblogs'}},
										{bURL: true, bWindow: true, en: {value: 'OnStar', url: 'http://twitter.com/TheReal_OnStar'}, fr: {value: 'OnStar', url: 'http://twitter.com/TheReal_OnStar'}},
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialFlickr" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialFlickr" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'GM Blog Photos', url: 'http://www.flickr.com/photos/gmblogs/'}, fr: {value: 'Photos du blogue GM', url: 'http://www.flickr.com/photos/gmblogs/'}}
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialYouTube" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialYouTube" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'OnStar', url: 'http://www.youtube.com/user/OnStar'}, fr: {value: 'OnStar', url: 'http://www.youtube.com/user/OnStar'}},
										{bURL: true, bWindow: true, en: {value: 'Videos from the GM Blog', url: 'http://www.youtube.com/user/gmblogs'}, fr: {value: 'Vid&eacute;os du blogue GM', url: 'http://www.youtube.com/user/gmblogs'}},
										{bURL: true, bWindow: true, en: {value: 'GM\'s New Technologies Channel', url: 'http://www.youtube.com/user/GMnext'}, fr: {value: 'Canal Nouvelles technologies GM', url: 'http://www.youtube.com/user/GMnext'}}
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, bLink: true, en: {value: 'Conversations', url: '#'}, fr: {value: 'Conversations', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'FastLane Blog', url: 'http://fastlane.gmblogs.com/'}, fr: {value: 'Blogue Voie rapide', url: 'http://fastlane.gmblogs.com/'}},
										{bURL: true, bWindow: true, en: {value: 'The Lab Blog', url: 'http://thelab.gmblogs.com/'}, fr: {value: 'Blogue du lab', url: 'http://thelab.gmblogs.com/'}}
									]
								]
							}
						];
				},
				
				getChevroletData: function ()
				{
					return [
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialFacebook" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialFacebook" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								bBorder: true,
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Chevrolet', url: 'http://www.facebook.com/chevrolet'}, fr: {value: 'Chevrolet', url: 'http://www.facebook.com/chevrolet'}},
										{bURL: true, bWindow: true, en: {value: 'Chevrolet Canada', url: 'http://www.facebook.com/chevroletcanada'}, fr: {value: 'Chevrolet Canada', url: 'http://www.facebook.com/chevroletcanada'}},
										{bURL: true, bWindow: true, en: {value: 'Camaro', url: 'http://www.facebook.com/login.php#/chevycamaro'}, fr: {value: 'Camaro', url: 'http://www.facebook.com/login.php#/chevycamaro'}},
										{bURL: true, bWindow: true, en: {value: 'Cruze', url: 'http://www.facebook.com/chevycruze?ref=ts'}, fr: {value: 'Cruze', url: 'http://www.facebook.com/chevycruze?ref=ts'}},
										{bURL: true, bWindow: true, en: {value: 'Volt', url: 'http://www.facebook.com/chevroletvolt'}, fr: {value: 'Volt', url: 'http://www.facebook.com/chevroletvolt'}},
										
										{bURL: true, bWindow: true, en: {value: 'Chevrolet On Scene ', url: 'http://www.facebook.com/chevroletonscene'}, fr: {value: 'Chevrolet On Scene', url: 'http://www.facebook.com/chevroletonscene'}},
										
										
										
										
										{bURL: true, bWindow: true, en: {value: 'Chevrolet Racing', url: 'http://www.facebook.com/group.php?gid=2216942064&ref=search&sid=513597044.2724077825..1'}, fr: {value: 'Course Chevrolet', url: 'http://www.facebook.com/group.php?gid=2216942064&ref=search&sid=513597044.2724077825..1'}}
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialTwitter" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialTwitter" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Chevrolet', url: 'http://twitter.com/chevrolet'}, fr: {value: 'Chevrolet', url: 'http://twitter.com/chevrolet'}},
										{bURL: true, bWindow: true, en: {value: 'Volt\'s New Technology', url: 'http://twitter.com/chevyvoltage'}, fr: {value: 'Nouvelle technologie Volt', url: 'http://twitter.com/chevyvoltage'}},										
										{bURL: true, bWindow: true, en: {value: 'Chevrolet On Scene ', url: 'http://www.twitter.com/ChevyOnScene'}, fr: {value: 'Chevrolet On Scene ', url: 'http://www.twitter.com/ChevyOnScene'}}
									]
								]
							},		
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialFlickr" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialFlickr" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Chevrolet On Scene', url: 'http://www.flickr.com/photos/chevroletonscene'}, fr: {value: 'Chevrolet On Scene', url: 'http://www.flickr.com/photos/chevroletonscene'}}
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialYouTube" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialYouTube" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Chevrolet', url: 'http://www.youtube.com/chevrolet'}, fr: {value: 'Chevrolet', url: 'http://www.youtube.com/chevrolet'}},
										{bURL: true, bWindow: true, en: {value: 'Chevrolet Canada', url: 'http://www.youtube.com/user/ChevroletCanada'}, fr: {value: 'Chevrolet Canada', url: 'http://www.youtube.com/user/ChevroletCanada'}}
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: 'Conversations', url: '#'}, fr: {value: 'Conversations', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Chevrolet Volt News and Discussions', url: 'http://www.chevroletvoltage.com'}, fr: {value: 'Nouvelles et discussions sur la Volt de Chevrolet', url: 'http://www.chevroletvoltage.com'}},
										{bURL: true, bWindow: true, en: {value: 'Truck Owners Network Forum', url: 'http://tonboards.mminteractive.com/jiveforums/index.jspa'}, fr: {value: 'Forum du R&eacute;seau des mordus de camions', url: 'http://tonboards.mminteractive.com/jiveforums/index.jspa'}},
										{bURL: true, bWindow: true, en: {value: 'Ask An Owner ', url: 'https://www.mychevrolet.ca/home'}, fr: {value: 'Posez une question &#224; un propri&#233;taire', url: 'https://www.machevrolet.ca/home'}}
									]
								]
							}
						];
				},
				
				getBuickData: function ()
				{
					
					return [
							{
								title: {bURL: true, bWindow: true, bLink: true, bBorder: true, en: {value: '<div class="SocialLogo"><img class="SocialFacebook" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialFacebook" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								 bBorder: true, 
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Buick', url: 'http://www.facebook.com/login.php#/buick'}, fr: {value: 'Buick', url: 'http://www.facebook.com/login.php#/buick'}}
									]
								]
							},
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialYouTube" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialYouTube" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'All New Buick Buzz &amp; Videos', url: 'http://www.youtube.com/user/BuickBuzz'}, fr: {value: 'Buzz et vid&eacute;os sur la toute nouvelle gamme Buick', url: 'http://www.youtube.com/user/BuickBuzz'}}
									]
								]
							},
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialTwitter" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialTwitter" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Buick', url: 'http://twitter.com/buick'}, fr: {value: 'Buick', url: 'http://twitter.com/buick'}},
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, bLink: true, en: {value: 'Conversations', url: '#'}, fr: {value: 'Conversations', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Ask An Owner ', url: 'https://www.mybuick.ca/'}, fr: {value: 'Posez une question &#224; un propri&#233;taire', url: 'https://www.mabuick.ca/'}}
									]
								]
							}
						];
				},
				
				getGMCData: function ()
				{
					return [
							{
								title: {bURL: true, bWindow: true, bLink: true, bBorder: true, en: {value: '<div class="SocialLogo"><img class="SocialFacebook" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialFacebook" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								bBorder: true, 
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'GMC', url: 'http://www.facebook.com/gmc'}, fr: {value: 'GMC', url: 'http://www.facebook.com/gmc'}},
										{bURL: true, bWindow: true, en: {value: 'GMC &amp; The Stampede', url: 'http://www.facebook.com/pages/GMC-The-Calgary-Stampede/75572357419?ref=ts'}, fr: {value: 'GMC et le Stampede', url: 'http://www.facebook.com/pages/GMC-The-Calgary-Stampede/75572357419?ref=ts'}},
										{bURL: true, bWindow: true, en: {value: 'GMC Cup Ski Series', url: 'http://www.facebook.com/PontiacGMCCanada'}, fr: {value: 'Les s&eacute;ries de la coupe de ski GMC', url: 'http://www.facebook.com/PontiacGMCCanada'}}
									]
								]
							},
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialTwitter" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialTwitter" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'GMC', url: 'http://twitter.com/thisisgmc'}, fr: {value: 'GMC', url: 'http://twitter.com/thisisgmc'}},
									]
								]
							},
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialYouTube" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialYouTube" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'GMC Terrain', url: 'http://youtube.com/gmc'}, fr: {value: 'Terrain de GMC', url: 'http://youtube.com/gmc'}}
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: 'Conversations', url: '#'}, fr: {value: 'Conversations', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Truck Owners Network Forum', url: 'http://tonboards.mminteractive.com/jiveforums/index.jspa'}, fr: {value: 'Forum du R&eacute;seau des mordus de camions', url: 'http://tonboards.mminteractive.com/jiveforums/index.jspa'}},
										{bURL: true, bWindow: true, en: {value: 'Ask An Owner ', url: 'https://www.mygmc.ca/'}, fr: {value: 'Posez une question &#224; un propri&#233;taire', url: 'https://www.mongmc.ca/'}}
									]
								]
							}
						];
				},
				
				getCadillacData: function ()
				{
					return [
							{
								title: {bURL: true, bWindow: true, bLink: true, bBorder: true, en: {value: '<div class="SocialLogo"><img class="SocialFacebook" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialFacebook" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								bBorder: true,
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Cadillac', url: 'http://www.facebook.com/cadillac'}, fr: {value: 'Cadillac', url: 'http://www.facebook.com/cadillac'}},
										{bURL: true, bWindow: true, en: {value: 'Festival Insider', url: 'http://www.facebook.com/festivalinsider'}, fr: {value: 'Festival Insider', url: 'http://www.facebook.com/festivalinsider'}}
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialTwitter" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialTwitter" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Cadillac', url: 'http://twitter.com/Cadillac'}, fr: {value: 'Cadillac', url: 'http://twitter.com/Cadillac'}},
										{bURL: true, bWindow: true, en: {value: 'Festival Insider', url: 'http://twitter.com/festivalinsider'}, fr: {value: 'Festival Insider', url: 'http://twitter.com/festivalinsider'}}
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialFlickr" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialFlickr" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Festival Insider', url: 'http://www.flickr.com/tiffinsider'}, fr: {value: 'Festival Insider', url: 'http://www.flickr.com/tiffinsider'}}
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: '<div class="SocialLogo"><img class="SocialYouTube" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}, fr: {value: '<div class="SocialLogo"><img class="SocialYouTube" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_logos.gif" /></div>', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Cadillac', url: 'http://www.youtube.com/MyCadillacStory'}, fr: {value: 'Cadillac', url: 'http://www.youtube.com/MyCadillacStory'}},
										{bURL: true, bWindow: true, en: {value: 'Festival Insider', url: 'http://www.youtube.com/tiffinsider'}, fr: {value: 'Festival Insider', url: 'http://www.youtube.com/tiffinsider'}}
									]
								]
							},
							
							{
								title: {bURL: true, bWindow: true, bLink: true, en: {value: 'Conversations', url: '#'}, fr: {value: 'Conversations', url: '#'}},
								rows:
								[
									[
										{bURL: true, bWindow: true, en: {value: 'Cadillac Notes Blog', url: 'http://cadillac.gmblogs.com/'}, fr: {value: 'Blogue-notes Cadillac', url: 'http://cadillac.gmblogs.com/'}},
										{bURL: true, bWindow: true, en: {value: 'Festival Insider', url: 'http://www.festivalinsider.ca/blog/'}, fr: {value: 'Festival Insider', url: 'http://www.festivalinsider.ca/blog/'}},
										{bURL: true, bWindow: true, en: {value: 'Ask An Owner ', url: 'https://www.thisismycadillac.ca/'}, fr: {value: 'Posez une question &#224; un propri&#233;taire', url: 'https://www.macadillac.ca/'}}
									]
								]
							}
						];
				},
				
				/**
				* @function		buildFunctionality
				* @usage		Sets the event handlers and such for the Site Map.
				*/
				buildFunctionality: function ()
				{
					
					/**
					* @note		Handlers for the images covering the content sections.
					*/
					$('#SocialMenuBTN').hover(function ()
					{
						document.getElementById('HiddenDivSocial').style.height = '440px';
					
						document.getElementById('SocialMenuBTNImg').style.top = '-68px';
						
						$('#SocialMenuContainer').stop().animate({top: '0px'}, {queue: false, duration: 500});
						
					}, function () {}, 3);
					
					$('#GlobalNav').hover(function () {},
					function ()
					{
						document.getElementById('SocialMenuBTNImg').style.top = '-102px';
						$('#SocialMenuContainer').stop().animate({top: '-440px'}, {queue: false, duration: 500, complete: function () {document.getElementById('HiddenDivSocial').style.height = '0';}});
						
					}, 4);
					
					$('#CloseSocialMenu').click(function () {$('#SocialMenuContainer').stop().animate({top: '-440px'}, {queue: false, duration: 500});
						document.getElementById('HiddenDivSocial').style.height = '0';
					});
					
					$('#GMTab').click(function () {
						oSocialMenu.extendBuild('GMTab', oSocialMenu.getGMData());
					});
					
					$('#CHEVROLETTab').click(function () {
						oSocialMenu.extendBuild('CHEVROLETTab', oSocialMenu.getChevroletData());
					});
					$('#BUICKTab').click(function () {
						oSocialMenu.extendBuild('BUICKTab', oSocialMenu.getBuickData());
					});
					$('#GMCTab').click(function () {
						oSocialMenu.extendBuild('GMCTab', oSocialMenu.getGMCData());
					});
					$('#CADILLACTab').click(function () {
						oSocialMenu.extendBuild('CADILLACTab', oSocialMenu.getCadillacData());
					});
				},
				
				/**
				* @function		getData
				* @usage		Returns the data object for the Site Nav Menu.
				*/
				getData: function ()
				{
					var aSection = ['gmc', 'buick', 'cadillac', 'chevrolet'],
						i = aSection.length - 1,
						sURL = window.location.href,
						sTab = 'GM',
						oBTN;
					
						for (; i >= 0; --i)
						{
							if (sURL.indexOf(aSection[i]) != -1)
							{
								sTab = aSection[i].toUpperCase();
								break;	
							}
						}
						
						oBTN = document.getElementById(sTab + 'Tab');
						
						if (oBTN)
						{
							oBTN.style.background = 'url(' + oEnvInfo.imgServer + '/images/gmcl_navigation/tab_on.gif)';	
						}
						
						if (oSocialMenu.currentTab)
						{
							oSocialMenu.currentTab.style.background = 'url(' + oEnvInfo.imgServer + '/images/gmcl_navigation/tab_off.gif)';		
						}
						
						oSocialMenu.currentTab = oBTN;
						
						switch (sTab)
						{
							case 'GMC':
								return oSocialMenu.getGMCData();
							break;
							
							case 'BUICK':
								return oSocialMenu.getBuickData();
							break;
							
							case 'CHEVROLET':
								return oSocialMenu.getChevroletData();
							break;
							
							case 'CADILLAC':
								return oSocialMenu.getCadillacData();
							break;
							
							default:
								return oSocialMenu.getGMData();
							break;
						}
				},
				
				/**
				* @function		getCSS
				* @usage		Returns the CSS for the Site Map Menu.
				*/
				getCSS: function ()
				{
					return '#SocialMenuContainer {position: absolute; top: -440px; left: 0; width: 990px;}\n\
							#SocialMenuContainer .MenuContentArea {float: left; position: relative; padding: 20px 0; width: 990px; height: 240px; background: #fff;}\n\
							#SocialMenuContainer .MenuGradientBar {float: left; position: relative; width: 990px; height: 34px; background: url(/images/gmcl_navigation/top_nav_grey_fade.jpg) repeat-x}\n\
							#SocialMenuContainer .MenuColumnTitle {float: left; padding-bottom: 10px; padding-left: 15px; position: relative; width: 182px; height: 30px; line-height: 30px; font-weight: bold; text-align: left;}\n\
							#SocialMenuContainer .MenuColumnTitle img {outline: none; border: none;}\n\
							#SocialMenuContainer .MenuColumnTitle, #SocialMenuContainer .MenuColumnTitle a {font-size: 12px; color: #3b5997; text-decoration: none;}\n\
							#SocialMenuContainer .MenuColumnTitle, #SocialMenuContainer .MenuColumnTitle a {text-decoration: none;}\n\
							#SocialMenuContainer .MenuColumn .SocialLogo {float: left; position: relative; width: 141px; height: 30px; overflow: hidden;}\n\
							#SocialMenuContainer .MenuColumn .SocialLogo .SocialFacbook {position: absolute; left: 0; top: 0;}\n\
							#SocialMenuContainer .MenuColumn .SocialLogo .SocialTwitter {position: absolute; left: 0; top: -30px;}\n\
							#SocialMenuContainer .MenuColumn .SocialLogo .SocialFlickr {position: absolute; left: 0; top: -60px;}\n\
							#SocialMenuContainer .MenuColumn .SocialLogo .SocialYouTube {position: absolute; left: 0; top: -90px;}\n\
							#SocialMenuContainer .MenuColumn {float: left; position: relative; width: 197px; height: 240px; max-height: 100%; border-left: 1px solid #dedfe9;}\n\
							#SocialMenuContainer .MenuColumnSection {margin-top: 10px; padding-bottom: 10px; width: 197px;}\n\
							#SocialMenuContainer .MenuColumnSection ul {margin: 0 0; padding: 0 0; list-style: none;}\n\
							#SocialMenuContainer .MenuColumnSection ul li {padding: 0 5px; padding-left: 15px; width: 175px; text-align: left;}\n\
							#SocialMenuContainer .MenuColumnSection ul li a {font-size: 11px; font-weight: bold; color: #686868; text-decoration: none;}\n\
							#SocialMenuContainer .MenuColumnSection ul li a:hover {text-decoration: underline;}\n\
							#SocialMenuContainer .MenuColumnSpacer {border-bottom: 1px solid #dedfe9;}\n\
							#SocialMenuContainer .MenuTabsContainer {float: left; position: relative; width: 990px; padding-top: 20px; background: #eee;}\n\
							#SocialMenuContainer .MenuTabsContainer .MenuTabBTN {float: left; margin: 0 2px; position: relative; width: 160px; height: 30px; line-height: 30px; font-size: 14px; font-weight: bold; background: url(/images/gmcl_navigation/tab_off.gif); cursor: pointer; text-align: center; color:#666}\n\
							#SocialMenuContainer .BottomBar {float: left; position: relative; width: 990px; height: 55px; background: #ccc;}\n\
							#SocialMenuContainer #CloseSocialMenu {float: right; position: relative; margin-right: 20px; _margin-right: 20px; margin-top: 10px; padding: 0 10px; height: 25px; line-height: 25px; font-size: 12px; font-weight: bold; color: #3b5997; cursor: pointer;}\
							#SocialMenuContainer .Disclaimer {float: left; position: relative; width: 100%; height: 20px; z-index: 20000; margin-bottom:-10px; padding-top:8px;text-indent:10px; line-height: 20px; font-size: 12px; font-style:italic; color: #555; text-align: left; background: #fff;}';
				},
				
				/**
				* @function		getElement
				* @usage		Returns the xhtml elements for the Site Map Menu.
				*/
				getElement: function ()
				{
					var oDiv = document.createElement('div');
						oDiv.id = 'SocialMenuContainer';
						oDiv.className = 'SocialMenuContainer';
						
						oDiv.innerHTML = '<div class="MenuGradientBar"></div>\
										  <div class="MenuTabsContainer">\
										  	<div id="GMTab" class="MenuTabBTN">GM</div>\
											<div id="CHEVROLETTab" class="MenuTabBTN">CHEVROLET</div>\
											<div id="BUICKTab" class="MenuTabBTN">BUICK</div>\
											<div id="GMCTab" class="MenuTabBTN">GMC</div>\
											<div id="CADILLACTab" class="MenuTabBTN">CADILLAC</div>\
										  </div>\
										  ' + (sLanguage == 'fr' ? '<div class="Disclaimer">Ces sites ne sont disponibles qu\'en anglais.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>' : '') + '\
										  <div id="SocialMenuContentArea" class="MenuContentArea">\
										  </div>\
										  <div class="BottomBar">\
										  	<div id="CloseSocialMenu">' + (sLanguage == 'fr' ? 'Fermer X' : 'CLOSE X') + '</div>\
										</div>';
						
						var oHidden = document.createElement('div');
							oHidden.id = 'HiddenDivSocial';
							oHidden.style.position = 'absolute';
							oHidden.style.top = '34px';
							oHidden.style.left = '0';
							oHidden.style.width = '990px';
							oHidden.style.height = '0';
							
							oHidden.style.overflow = 'hidden';
							
							oHidden.appendChild(oDiv);
						
					return oHidden;
				},
				
				/**
				* @function 	getContainer
				* @usage		Returns the menu container object.
				*/
				getContainer: function ()
				{
					return document.getElementById('SocialMenuContainer');	
				},
				
				/**
				* @function		getContentArea
				* @usage		Returns the menu content object.
				*/
				getContentArea: function ()
				{
					return document.getElementById('SocialMenuContentArea');	
				}
			};
		
		
			/**
			* @note		Determine the language value for the menus. (document.cookie.match('(gmcanada_lang=french)') && document.cookie.match('(gmcanada_lang=french)').length > 0)
			*/
		var sLanguage = window.location.href.indexOf('/english/') != -1 || window.location.href.indexOf('lang=en') != -1 || window.location.href.indexOf('_code=en') != -1;
			
			if (sLanguage)
			{
				sLanguage = 'en';	
			}
			else if (window.location.href.indexOf('/french/') != -1 || window.location.href.indexOf('lang=fr') != -1 || window.location.href.indexOf('_code=fr') != -1)
			{
				sLanguage = 'fr';
			}
			else if (document.cookie.match('(gmcanada_lang=french)') && document.cookie.match('(gmcanada_lang=french)').length > 0)
			{
				sLanguage = 'fr';
			}
			else
			{
				sLanguage = 'en';
			}
		
			/**
			* @note		Locally global values.
			*/
		var sGlobalNavID = 'GlobalNav',
			oGlobalNavContainer,
			oHead = document.getElementsByTagName('head')[0],
			
			/**
			* @note		Determines the correct production environment.
			*/
			oEnv =
			{
				/**
				* @function		getInfo
				* @usage		Returns an object containing the environment values.
				*/
				getInfo: function ()
				{
					var sLoc = window.location.href,
							protocal = sLoc.indexOf('https://') != -1 ? 'https://' : 'http://',
							retObj;
					var theDomain = 'http://' + sLoc.split('/')[2];		
							/**
							* @note		Possible location, itl, preprod, prodprev, localhost, and www.
							* 			www, is checked first because it is the most critical for performance.
							*/
							if (sLoc.indexOf('www.') != -1)
							{
								retObj =
								{
									mainServer: 'http://www.gm.ca',
									appServer: 'http://apps.gm.ca',
									appsSecureServer: 'http://apps.gm.ca',
									devPath: '',
									configDomain: 'http%3A%2F%2Fconfigurator%2Eautodata%2Egm%2Eca',
									PEDomain: 'http://paymentestimator.autodata.gm.ca',
									xmlGlobalNavDomain: protocal + 'www.gm.ca',
									imgServer : protocal + 'www.gm.ca'
								};
							}
							else if (sLoc.indexOf('www-wrn.') != -1)
							{
								retObj =
								{
									mainServer: 'http://www-wrn.gm.ca',
									appServer: 'http://apps.gm.ca',
									appsSecureServer: 'http://apps.gm.ca',
									devPath: '',
									configDomain: 'http%3A%2F%2Fconfigurator%2Eautodata%2Egm%2Eca',
									PEDomain: 'http://paymentestimator.autodata.gm.ca',
									xmlGlobalNavDomain: protocal + 'www-wrn.gm.ca',
									imgServer : protocal + 'www-wrn.gm.ca'
								};
							}
							else if (sLoc.indexOf('preprod-pnt.') != -1)
							{
								retObj =
								{
									mainServer: 'http://preprod-pnt.gm.ca',
									appServer: 'http://apps.preprod.gm.ca',
									appsSecureServer: 'http://apps.preprod.gm.ca',
									devPath: 'dev/',
									configDomain: 'http%3A%2F%2Fconfigurator%2Eautodata%2Eitl%2Egm%2Eca',
									PEDomain: 'http://paymentestimator.autodata.itl.gm.ca',
									xmlGlobalNavDomain: protocal + 'preprod.gm.ca',
									imgServer : protocal + 'preprod-pnt.gm.ca'
								};
							}
							else if (sLoc.indexOf('dit.tech.') != -1)
							{
								retObj =
								{
									mainServer: 'http://dit.tech.mminteractive.com',
									appServer: 'http://apps.preprod.gm.ca',
									appsSecureServer: 'http://apps.preprod.gm.ca',
									devPath: 'dev/',
									configDomain: 'http%3A%2F%2Fconfigurator%2Eautodata%2Eitl%2Egm%2Eca',
									PEDomain: 'http://paymentestimator.autodata.itl.gm.ca',
									xmlGlobalNavDomain: protocal + 'dit.tech.mminteractive.com',
									imgServer : protocal + 'dit.tech.mminteractive.com'
								};
							}						
							else if (sLoc.indexOf('itl.') != -1)
							{
								retObj =
								{
									mainServer: 'http://itl.gm.ca',
									appServer: 'http://apps.itl.gm.ca',
									appsSecureServer: 'https://apps.itl.gm.ca',
									devPath: 'dev/',
									configDomain: 'http%3A%2F%2Fconfigurator%2Eautodata%2Epreprod%2Egm%2Eca',
									PEDomain: 'http://paymentestimator.autodata.preprod.gm.ca',
									xmlGlobalNavDomain: protocal + 'itl.gm.ca',
									imgServer : protocal + 'itl.gm.ca'
								};
							}
							else if (sLoc.indexOf('preprod.preview.') != -1)
							{
								retObj =
								{
									mainServer: 'http://preprod.preview.tech.mminteractive.com',
									appServer: 'http://gm.ca',
									devPath: 'dev/',
									configDomain: 'http%3A%2F%2Fconfigurator%2Eautodata%2Epreprod%2Egm%2Eca',
									PEDomain: 'http://paymentestimator.autodata.preprod.gm.ca',
									xmlGlobalNavDomain: protocal + 'preprod.preview.tech.mminteractive.com',
									imgServer : protocal + 'preprod.preview.tech.mminteractive.com'
								};
							}		
							else if (sLoc.indexOf('preprod.') != -1)
							{
								retObj =
								{
									mainServer: 'http://preprod.gm.ca',
									appServer: 'http://apps.preprod.gm.ca',
									appsSecureServer: 'https://apps.preprod.gm.ca',
									devPath: 'dev/',
									configDomain: 'http%3A%2F%2Fconfigurator%2Eautodata%2Epreprod%2Egm%2Eca',
									PEDomain: 'http://paymentestimator.autodata.preprod.gm.ca',
									xmlGlobalNavDomain: protocal + 'preprod.gm.ca',
									imgServer : protocal + 'preprod.gm.ca'
								};
							}				
							else if (sLoc.indexOf('prod.preview.') != -1)
							{
								retObj =
								{
									mainServer: 'http://prod.preview.tech.mminteractive.com',
									appServer: 'http://apps.prod.tech.preview.mminteractive.com',
									devPath: 'dev/',
									configDomain: 'http%3A%2F%2Fconfigurator%2Eautodata%2Epreprod%2Egm%2Eca',
									PEDomain: 'http://paymentestimator.autodata.preprod.gm.ca',
									xmlGlobalNavDomain: protocal + 'prod.preview.tech.mminteractive.com',
									imgServer : protocal + 'prod.preview.tech.mminteractive.com'
								};
							}
							else if (sLoc.indexOf('localhost') != -1)
							{
								retObj =
								{
									mainServer: 'http://localhost',
									appServer: 'http://apps.gm.ca',
									appsSecureServer: 'http://apps.gm.ca',
									devPath: '',
									configDomain: 'http%3A%2F%2Fconfigurator%2Eautodata%2Egm%2Eca',
									PEDomain: 'http://paymentestimator.autodata.gm.ca',
									xmlGlobalNavDomain: protocal + 'www.gm.ca',
									imgServer : protocal + 'localhost'
								};
							}
							else
							{
								retObj =
								{
									mainServer: 'http://www.gm.ca',
									appServer: 'http://apps.gm.ca',
									appsSecureServer: 'http://apps.gm.ca',
									devPath: '',
									configDomain: 'http%3A%2F%2Fconfigurator%2Eautodata%2Egm%2Eca',
									PEDomain: 'http://paymentestimator.autodata.gm.ca',
									xmlGlobalNavDomain: protocal + 'www.gm.ca',
									imgServer : protocal + 'www.gm.ca'
								};
							}
							
							/**
							* @idea		concept
							* @note		We are returning an object literal to avoid many variables being passed around.
							*/
							return retObj;
					}
			},
			
			oEnvInfo = oEnv.getInfo(),
			
			/**
			* @note		Constructs the global navigation menu.
			*/
			oGlobalNavBuild =
			{
				/**
				* @note		Used for the IE6 fix for drop down menus.
				*/
				currentSection: null,
				
				/**
				* @function 	getCSS
				*/
				getCSS: function ()
				{
					return '#GlobalNav {float: left; position: absolute; top: 16px; width: 990px; z-index: 20000;}\n\
							#GlobalNav .GlobalNavMenu {clear: left; float: right; position: relative; height: 34px; z-index: 10000;}\n\
							#GlobalNav #SocialMenuBTN {float: left; position: relative; height: 34px; overflow: hidden;}\n\
							#GlobalNav #SocialMenuBTN .SocialMenuBTNImg {float: left; position: relative; top: -102px; left: 0; overflow: hidden; cursor: pointer;}\n\
							#divNavContainer ol,#divNavContainer ul {list-style:none;}\n\
							#divNavContainer {line-height: 1;}\n\
							' + (sLanguage == 'fr' ? '#GlobalNav #SiteMapBTN {width: 80px;}' : '') + '\n\
							#GlobalNav .GMLogoBTN, #GlobalNav .GMBTN {float: left; position: relative; height: 34px; line-height: 34px;}\
							#GlobalNav .GMBTN a {color: #3b5997; font-weight: bold; font-size: 11px; text-decoration: none;}\n\
							#GlobalNav .GMBTN a:hover {text-decoration: underline;}';
				},
				
				/**
				* @function		getElement
				*/
				getElement: function ()
				{
					var oDiv = document.createElement('div');
						oDiv.className = 'GlobalNavMenu';
						
						oDiv.innerHTML = '<div id="SocialMenuBTN">\
											<img id="SocialMenuBTNImg" class="SocialMenuBTNImg" src="' + oEnvInfo.imgServer + '/images/gmcl_navigation/social_tab_en_CA.gif" />\
										</div>\
										<div id="NavMenuContainer" class="MenuContainer">\
											<div id="NavMenuContentArea" class="MenuContentArea"></div>\
										</div>';
					
					return oDiv;
				},
				
				/**
				* @function		isBuildable
				* @usage		Determines whether the global can be built or not.
				*/
				isBuildable: function ()
				{
					oGlobalNavContainer = document.getElementById(sGlobalNavID);
					
					return typeof oGlobalNavContainer == 'object' && oGlobalNavContainer != null;
				},
				
				/**
				* @function		buildCSS
				* @note			Sets the CSS for the navigation menu.
				*/
				buildCSS: function (oMenu)
				{
					if (typeof oMenu == 'object')
					{
						var oStyle = document.createElement('style');
						
							oStyle.type = 'text/css';
		
							if(oStyle.styleSheet)
							{
								oStyle.styleSheet.cssText = oMenu.getCSS();
							}
							else
							{
								oStyle.appendChild(document.createTextNode(oMenu.getCSS()));
							}
							
							oHead.appendChild(oStyle);
					}
				},
				
				/**
				* @function		buildElement
				* @usage		Builds the elements for the menu in the Global Nav container object.
				*/
				buildElement: function (oMenu)
				{
					if (typeof oMenu == 'object')
					{
						oGlobalNavContainer.appendChild(oMenu.getElement());
					}
				},
				
				/**
				* @function		create
				* @usage		Constructs the menu.
				*/
				create: function (oMenu, bHover)
				{
					/**
					* @note		Construct the menu CSS by calling the buildCSS function.
					*/
					oGlobalNavBuild.buildCSS(oMenu);
					
					/**
					* @note		Construct the menu element by calling the buildElements function.
					*/
					oGlobalNavBuild.buildElement(oMenu);
					
					
					var oContentArea = oMenu.getContentArea(),
						
						/**
						* @note		data object for the menu.
						*/
						oData = oMenu.getData();
					
					/**
					* @note		Ensure data integrity before continuing.
					*/
					if (typeof oData == 'object' && oData != null)
					{
						for (var i = 0, l = oData.length - 1; i <= l; ++i)
						{
							/**
							* @note		Pass the column's data to the addColumn function to create the column object.
							*/
							oContentArea.appendChild(oGlobalNavBuild.addColumn(oData[i], bHover, i == l));
						}
					}
				},
				
				/**
				* @function		addColumn
				*/
				addColumn: function (oColumn, bHover, bBorder)
				{
					var oLanguageBlock,
						
						/**
						* @note		The column div element.
						*/
						oDiv = document.createElement('div'),
						
						/**
						* @note		The output string.
						*/
						sOutput = '',
						
						/**
						* @note		Variables used for menu creation.
						*/
						sValue,
						sURL,
						
						/**
						* @note		Server info object.
						*/
						oInfo = oEnv.getInfo(),
						
						/**
						* @note		The column element title or btn name.
						*/
						oTitle = (typeof oColumn.title == 'object' && typeof oColumn.title[sLanguage] == 'object') ? oColumn.title[sLanguage] : oColumn.title['en'],
						
						/**
						* @note		The rows of the column
						*/
						oRows = oColumn.rows;
						
						/**
						* @note		Set the Column class
						*/
						oDiv.className = 'MenuColumn';
						
						if (oColumn.bBorder)
						{
							oDiv.style.border = 'none';	
						}
						
						/**
						* @note		Check if a title exists for the column, and if so craete it.
						*/
						if (typeof oTitle == 'object')
						{
							sOutput += '<div ' + (typeof oTitle.id == 'string' ? 'id=' + oTitle.id : '') + ' class="MenuColumnTitle">' + (oColumn.title.bLink == true ? oTitle.value : '<a ' + (bBorder ? 'class="MenuTitleBorder"' : '') + ' ' + (typeof oTitle.url === 'string' ? 'href="' + (oColumn.title.bURL == true ? '' : oInfo.mainServer) + oTitle.url + '"' : '') + '>' + oTitle.value + '</a>') + '</div>';	
						}
						
						/**
						* @note		Create row blocks for each row. At the end, a separator is added if it is not the first and last block.
						*/
						if (typeof oRows == 'object')
						{	
							for (var i = 0, l = oRows.length - 1, oBlock, j, k, oRow; i <= l && (oBlock = oRows[i]) && typeof oBlock == 'object'; ++i)
							{
								sOutput += '<div class="MenuColumnSection' + (i != l ? ' MenuColumnSpacer' : '') + '"><ul>';
								
								/**
								* @note		Create the url;
								*/
								for (j = 0, k = oBlock.length; j < k && (oRow = oBlock[j]) && typeof oRow == 'object'; ++j)
								{
									
									/**
									* @note		Capture the language object.
									*/
									sValue = oRow[sLanguage];
								
									/**
									* @note		Default to english if the French value does not exist and is set by the URL.
									*/
									if (typeof sValue == 'object' && typeof sValue.value == 'string' && typeof sValue.url == 'string')
									{
										sURL = sValue.url;
										sValue = sValue.value;
									}
									else if (typeof oRow['en'] == 'object' && typeof oRow['en'].value == 'string' && typeof oRow['en'].url == 'string')
									{
										sValue = oRow['en'].value;
										sURL = oRow['en'].url;
									}
									else
									{
										sValue = '';
										
										/**
										* @note		Current page (".").
										*/
										sURL = '.';
									}
									
									sOutput += '<li>' + (oRow.bLink == true ? sValue : '<a ' + (oRow.bWindow == true ? 'target="_blank"' : '') + ' href="' + (oRow.bURL == true ? '' : oInfo.mainServer) + sURL +'">' + sValue  + '</a>') + '</li>';	
								}
								
								sOutput += '</ul></div>' + (i != l ? '<div style="float: left; margin-left: 10px; _margin-left: 5px; position: relative; width: 40px; height: 1px; display: block; border-top: 1px solid #dedfe9;"></div>' : '');
							}
						}
						
						/**
						* @note		Cycle through the data object and add the content to the ContentArea element.
						*/
						
						oDiv.innerHTML = sOutput;
						
						/**
						* @note		Accomodate IE6 fixes
						*/
						
							if(bHover)
							{
								$(oDiv).hover(oGlobalNavBuild.IE6HoverOverFix, oGlobalNavBuild.IE6HoverOffFix);
							}
						
						return oDiv;
				},
				
				/**
				* @function		IE6HoverOverFix
				*/
				IE6HoverOverFix: function (event)
				{
					/**
					* @note		The MenuColumnTitle is the target that should be returned from the hover affect by JQuery.
					*/
					var oTitle = event.target, oSection = oTitle.nextSibling;
						
						if (oTitle.className != 'MenuColumnTitle' && oTitle.className == 'MenuColumn' && oTitle.firstChild)
						{
							oSection = oTitle.firstChild.nextSibling;
						}
						
						if (oSection)
						{
							oSection =  oSection.style;
							
							oSection.display = 'block';
							oSection.visibility = 'visible';
							
							/**
							* @note		Set the currentSection property so the IE6HoverOffFix function can hide the element that was just displayed.
							*/
							oGlobalNavBuild.currentSection = oSection;
						}
				},
				
				/**
				* @function		IE6HoverOffFix
				*/
				IE6HoverOffFix: function ()
				{
					if (oGlobalNavBuild.currentSection)
					{
						oGlobalNavBuild.currentSection.display = 'none';
						oGlobalNavBuild.currentSection.visibility = 'hidden';
						oGlobalNavBuild.currentSection = null;
					}
				}
			};
			
			
			/**
			* @note		An interval is run to check for the GlobalNav element. If one exists, then it sets the menu and clears the interval.
			*			This is done to avoid using the onload window and dom functions.
			*/
			var iInt = 0, fInt = setInterval(function ()
			{
				/**
				* @note		If the menu has been searched for many times in this case 100, stop the interval.
				*/
				if (iInt == 100)
				{
					clearInterval(fInt);
				}
				
				/**
				* @note		Constructs the menu.
				*/
				if (oGlobalNavBuild.isBuildable())
				{
					/**
					* @note		Build the CSS for the global nav.
					*/
					oGlobalNavBuild.buildCSS(oGlobalNavBuild);
					
					/**
					* @note		Build the Element for the global nav.
					*/
					oGlobalNavBuild.buildElement(oGlobalNavBuild);
					
					/**
					* @note		Call the create function to make the nav menu.
					*/
					oGlobalNavBuild.create(oNavMenu, true);
				
					/**
					* @note		Call the create function to make the social menu.
					*/
					oGlobalNavBuild.create(oSocialMenu);
					
					/**
					* @note		Build menu extra functionality.
					*/
					oSocialMenu.buildFunctionality();

					/**
					* @note		Hover over Global Nav to set width that avoids covering anyting while not active.
					*/
					$('#GlobalNav').hover(function () {
						document.getElementById('GlobalNav').style.width = '990px';								
					},
					function ()
					{
					}, 2);
					
					clearInterval(fInt);
				}
				
				++iInt;
			
			}, 100);
		
	}) ();
	
	/*
		------------------------------------------- CURRENT OFFERS ----------------------------------------------------------------------
	*/
	
	function openCurrentOffers(Query, ADV, ChangeInput){
		
		var w=300, h=434, bw, bh, bl, bt, topPos, leftPos;

		// CENTER POPUP
		if (document.all)
		{
		bw = screen.width;  bh = screen.height;  bl = 0;  bt = 0;
		}
		else
		{
		bw = window.outerWidth;  bh = window.outerHeight;  bl = window.screenX;  bt = window.screenY;
		}		
		
		leftPos = Math.floor((bw-w)/2) + bl;
		topPos = Math.floor((bh-h)/2) + bt;
		
		// GET COOKIE FUNCTION  ---------------------------------------------------------------------------------------------------------
			var getCookie = true;
			var dc = document.cookie;
			var prefix = "pc=";
			var begin = dc.indexOf("; " + prefix);
			if (begin == -1) {
				begin = dc.indexOf(prefix);
				if (begin != 0) getCookie = false;
			}else begin += 2;
			
			if(getCookie){
				var end = document.cookie.indexOf(";", begin);
				if (end == -1) end = dc.length;
				var postal = unescape(dc.substring(begin + prefix.length, end));
			}else{
				var postal = "";
			}
		
		// -------------------------------------------------------------------------------------------------------------------------------
		
		var language  	= (Query.indexOf("/french/") != -1) ? "french" : "english";
		var ADVURL1 = (ADV) ? "&adv=" + ADV : "";
		var ADVURL2 = (ADV) ? "?adv=" + ADV : "";
		//var postal 		= getCookie("pc");

		var division = "all/";																					// Division detection
		division  = (Query.indexOf("/chevrolet/") != -1) ? "chevrolet/" : division;
		division  = (Query.indexOf("/buick/") != -1) ? "buick/" : division;
		division  = (Query.indexOf("/gmc/") != -1) ? "gmc/" : division;
		division  = (Query.indexOf("/cadillac/") != -1) ? "cadillac/" : division;
		
		if(division != "" && division != "all/" && postal != "" && !ChangeInput){	// Make redirection when we have brand + postal + we don`t wan`t to change brand / postal
			document.location = "/gm/" + language + "/vehicles/" + division + "all/current-offers?postalCode=" + postal + ADVURL1;
		}else{
			var popWindow = window.open ("/gm/" + language + "/vehicles/" + division + "all/current-offers/selection/" + ADVURL2,"CurrentOffers","toolbar=0, status=0, width=" + w + "px, height=" + h + "px, top=" + topPos + "px, left=" + leftPos + "px");
			popWindow.focus();
		}
	}
