	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();
        }
		
	/***
	getStyle()
	Description: Utility function. Returns the width of a div element.
	***/
	
	function getStyle(element,styleProp)	{
		if (element.currentStyle)
			var y = element.currentStyle[styleProp];
		else if (window.getComputedStyle)
			var y = document.defaultView.getComputedStyle(element,null).getPropertyValue(styleProp);
		return y;
	}
	

	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 GlobalNavBarhoverOver ()
	{
		var oEve = window.event, oMenu = oEve.srcElement;
	
		while (oMenu)
		{
			if (oMenu.className == 'GlobalNameMenuListLI')
			{
				oMenu.className = 'GlobalNavBarMenuListOpen';
			}
			
			/**
			* @note		Check the next parentNode.
			*/
			oMenu = oMenu.parentNode;
		}
	}
	
	function GlobalNavBarhoverOut ()
	{
		var oEve = window.event, oMenu = oEve.srcElement;
	
		while (oMenu)
		{
			if (oMenu.className == 'GlobalNavBarMenuListOpen')
			{
				oMenu.className = 'GlobalNameMenuListLI';
			}
			
			/**
			* @note		Check the next parentNode.
			*/
			oMenu = oMenu.parentNode;
		}
	}
	
	
	/***
	GlobalNavBeforeRender()
	Description: This function is called prior to init() to fix any legacy issues in the page structure
	***/

	function GlobalNavBeforeRender()
	{
		var navContainer = document.getElementById('GlobalNavMarker');
		
		// Check width of parent node to the GlobalNavMarker container.
		var navContainerWidth = getStyle(navContainer.parentNode, "width");
		navContainerWidth = Number(navContainerWidth.substr(0, navContainerWidth.length-2));
		
		// If parent node width has not been set, getStyle returns 0 (Safari) or 1 (IE, FF, Chrome). In this case set the parent width to 100%.
		if (navContainerWidth == 0 || navContainerWidth == 1) {
			navContainer.parentNode.style.width = "100%";
		}
		
	}
	
	
	(function () 
	{
	
		/**
			* @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 || window.location.href.indexOf('/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 || window.location.href.indexOf('/fr/') != -1 || window.location.href.indexOf('=french_pref_search') != -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	Create a single instance of the GlobalNavBar object.
		*/
		var GlobalNavBar = (function ()
		{
			var _ =
			{
				/**
				* @note		Determine the language value for the menus.
				*/
				language: sLanguage,
				
				/**
				* @note		Used for the IE6 fix for drop down menus.
				*/
				currentNode: null,
				
				/**
				* @function		getServerInfoObj
				*/
				getServerInfoObj: 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',
								devPath: '',
								xmlGlobalNavDomain: protocal + 'www.gm.ca',
								imgServer : protocal + 'www.gm.ca'
							};
						}
						else if (sLoc.indexOf('www-wrn.') != -1)
						{
							retObj =
							{
								mainServer: 'http://www-wrn.gm.ca',
								devPath: '',
								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',
								devPath: 'dev/',
								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',
								devPath: 'dev/',
								xmlGlobalNavDomain: protocal + 'dit.tech.mminteractive.com',
								imgServer : protocal + 'dit.tech.mminteractive.com'
							};
						}	
						else if (sLoc.indexOf('itl.') != -1)
						{
							retObj =
							{
								mainServer: 'http://itl.gm.ca',
								devPath: 'dev/',
								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',
								devPath: 'dev/',
								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',
								devPath: 'dev/',
								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',
								devPath: 'dev/',
								xmlGlobalNavDomain: protocal + 'prod.preview.tech.mminteractive.com',
								imgServer : protocal + 'prod.preview.tech.mminteractive.com'
							};
						}
						else if (sLoc.indexOf('localhost') != -1)
						{
							retObj =
							{
								mainServer: 'http://localhost',
								devPath: '',
								xmlGlobalNavDomain: protocal + 'www.gm.ca',
								imgServer : protocal + 'www.gm.ca'
							};
						}
						else
						{
							retObj =
							{
								mainServer: 'http://www.gm.ca',
								devPath: '',
								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;
				},
				
				/**
				* @function 		create
				*/
				create: function (oData, sClassColumn, sClassSection, sClassTitle, sClassBlock, bHover)
				{
					/**
					* @note		Ensure the integrity of the initial data array
					*/
					if (typeof oData == 'object')
					{
						for (var i = 0, l = oData.length - 1, oColumn, oFrag = document.createDocumentFragment(); i <= l && (oColumn = oData[i]) && typeof oColumn == 'object'; ++i)
						{
							oFrag.appendChild(_.newColumn(oColumn, sClassColumn, sClassSection, sClassTitle, sClassBlock, bHover, i == l));
						}
						
						return oFrag;
					}
				},
				
				/**
				* @function		newColumn
				*/
				newColumn: function (oColumn, sClassColumn, sClassSection, sClassTitle, sClassBlock, bHover, bLastColumn)
				{
					var sOutput = '', 
						oDiv = document.createElement('div'),
						sValue,
						sLink,
						oInfo = _.getServerInfoObj();
					
					if (typeof oColumn == 'object')
					{
						/**
						* @note		Create the column element.
						*/
						oDiv.className = sClassColumn;
						
						/**
						* @note		Add the hover effect to the menu if it is IE6 and there is a hover notice.
						*/
						var sAgent = navigator.userAgent;
					
						if(sAgent.indexOf('compatible') > -1 && sAgent.indexOf('MSIE') > -1 && !(sAgent.indexOf('Opera') > -1))
						{
							var oReg = new RegExp('MSIE (\\d+\\.\\d+);');
								oReg.test(sAgent);
								oReg = parseFloat(RegExp['$1']);
								sAgent = oReg >= 7 ? 7 : oReg >= 6 ? 6 : 5;
						}
						
						/**
						* @note		Add the IE6 handlers.
						*/
						if (sAgent == 6 && bHover && oDiv.attachEvent)
						{
							oDiv.attachEvent('onmouseover', _.IE6HoverOverFix);
							oDiv.attachEvent('onmouseout', _.IE6hoverOutFix);
						}
						
						/**
						* @note		Check if a title exists for the column, and if so craete it.
						*/
						if (typeof oColumn.title == 'object' && typeof oColumn.title[_.language] == 'object')
						{
							sOutput += '<div ' + (typeof oColumn.title.id == 'string' ? 'id=' + oColumn.title.id : '') + ' class="' + sClassTitle + '">' + (oColumn.title.bLink == true ? oColumn.title.value : '<a ' + (bLastColumn ? 'style="border: none;"' : '') + (typeof oColumn.title[_.language].link === 'string' ? ' href="' + (oColumn.title.bURL == true ? '' : oInfo.mainServer) + oColumn.title[_.language].link + '"' : '') + '>' + oColumn.title[_.language].value + '</a>') + '</div><br />';		
						}
						
						/**
						* @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 oColumn.rows == 'object')
						{	
							for (var i = 0, l = oColumn.rows.length - 1, oBlock, j, k, oRow; i <= l && (oBlock = oColumn.rows[i]) && typeof oBlock == 'object'; ++i)
							{
								sOutput += '<div class="' + sClassSection + (i != l ? ' ' + sClassBlock : '') + '"><ul>';
								
								/**
								* @note		Create the link;
								*/
								for (j = 0, k = oBlock.length - 1; j <= k && (oRow = oBlock[j]) && typeof oRow == 'object'; ++j)
								{
									
									/**
									* @note		Capture the language object.
									*/
									sValue = oRow[_.language];
								
									/**
									* @note		Default to english if the French value does not exist and is set by the URL.
									*/
									if (typeof sValue == 'object')
									{
										sLink = sValue.link;
										sValue = sValue.value;
									}
									else if (typeof oRow['en'] == 'object')
									{
										sValue = oRow['en'].value;
										sLink = oRow['en'].link;
									}
									else
									{
										sValue = '';
										
										/**
										* @note		Current page (".").
										*/
										sLink = '.';
									}
									
									sOutput += '<li class="GlobalNameMenuListLI ' + (oRow.bHover == true ? 'bHover' : '') + '" ' + (sAgent == 6 ? 'onMouseOver="javascript: GlobalNavBarhoverOver();" onMouseOut="javascript: GlobalNavBarhoverOut();"' : '') + (j == k ? ' style="border: none;"' : '') + '>' + (oRow.bLink == true ? sValue : '<a href="' + (sLink) +'"><div class="GlobalNavBarMenuListItem">' + (sValue) + '</div></a>') + '</li>';	
								}
								
								sOutput += '</ul></div>' + (i != l ? '<br />' : '');
							}
						}
					}
					
					oDiv.innerHTML = sOutput;
					
					return oDiv;
				},
				
				/**
				* @function		IE6HoverOverFix
				*/
				IE6HoverOverFix: function ()
				{
					var oEve = window.event, oTarget = oEve.srcElement, oMenu = oTarget.parentNode;
						
						while (oMenu)
						{
							if (oMenu.className == 'MenuList')
							{
								if (oMenu.firstChild && oMenu.firstChild.nextSibling && oMenu.firstChild.nextSibling.nextSibling && oMenu.firstChild.nextSibling.nextSibling.className)
								{
									oMenu = oMenu.firstChild.nextSibling.nextSibling;
									
									oMenu = oMenu.style;
														
									oMenu.width = '0';
									oMenu.display = 'block';
									oMenu.visibility = 'visible';
									
									var x = document.getElementsByTagName("select");
									for (i = 0; i < x.length; i++) {
									   x[i].style.visibility = 'hidden';
									}
									
									/**
									* @note		Set the currentNode property so the IE6hoverOutFix function can hide the element that was just displayed.
									*/
									_.currentNode = oMenu;
								}
								
								break;
							}
							
							/**
							* @note		Check the next parentNode.
							*/
							oMenu = oMenu.parentNode;
						}
						
						oEve.cancelBubble = true;
						oEve.returnValue = false;
				},
				
				/**
				* @function		IE6hoverOutFix
				*/
				IE6hoverOutFix: function ()
				{
					if (_.currentNode)
					{
						_.currentNode.display = 'none';
						_.currentNode.visibility = 'hidden';
						_.currentNode = null;
						var x = document.getElementsByTagName("select");
						for (i = 0; i < x.length; i++) {
						   x[i].style.visibility = 'visible';
						}
					}
				}
			};
			
			/**
			* @note 	return the object literal.
			*/
			return _;
			
		}) (),
	
		/**
		* @note		Site map menu data.
		*/
		GlobalMenuDataLeft =
		[
			{
				title: {bURL: true, en: {value: 'Vehicles', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/vehicles'}, fr: {value: 'V&eacute;hicules', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/vehicles'}},
				rows:
				[
					[
						{en: {value: 'Buick', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/vehicles/buick/'}, fr: {value: 'Buick', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/vehicles/buick/'}},
						{en: {value: 'Cadillac', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/vehicles/cadillac/'}, fr: {value: 'Cadillac', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/vehicles/cadillac/'}},
						{en: {value: 'Chevrolet', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/vehicles/chevrolet/'}, fr: {value: 'Chevrolet', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/vehicles/chevrolet/'}},
						{en: {value: 'GMC', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/vehicles/gmc/'}, fr: {value: 'GMC', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/vehicles/gmc/'}},	
						{bLink: true, bHover: true, en: {value: '', link: ''}, fr: {value: '', link: ''}},
						{en: {value: 'New Vehicles', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/showrooms/?adv=72465'}, fr: {value: 'V&eacute;hicules Neufs', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/showrooms/?adv=72465'}},
						{en: {value: 'Certified Used Vehicles', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=http://apps.gm.ca/app/GMCanada/UsedVehicleLocatorCriteria.do&lang=en&nav=040&adv=IOPTENH001&page=qsearch#ddType~dv~refresh~year~1111~make~'}, fr: {value: 'V&eacute;hicules d\'occasion', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/hostredirect?host=http://apps.gm.ca/app/GMCanada/UsedVehicleLocatorCriteria.do&lang=fr&nav=040&adv=IOPTENH001&page=qsearch#ddType~dv~refresh~year~1111~make~'}},
						{en: {value: 'Fleet', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/services/fleet/overview'}, fr: {value: 'Parcs', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/services/fleet/overview'}},
						{en: {value: 'OnStar', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/shopping/accessories/onstar'}, fr: {value: 'OnStar', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/shopping/accessories/onstar'}},
						{en: {value: 'Commercial Trucks', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/vehicles/commercial/index'}, fr: {value: 'V&eacute;hicules commerciaux', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/vehicles/commercial/index'}},
						{bLink: true, bHover: true, en: {value: '', link: ''}, fr: {value: '', link: ''}},
						{bURL: true, bLink: true, bLink: true, en: {value: '&nbsp;&nbsp;&nbsp;OTHER LANGUAGES', link: '#'}, fr: {value: '&nbsp;&nbsp;&nbsp;AUTRES LANGUES', link: '#'}},
						{bURL: true, en: {value: '<a href="' + GlobalNavBar.getServerInfoObj().mainServer + '/gm/english/corporate/multicultural/cantonese"><img src="' + GlobalNavBar.getServerInfoObj().xmlGlobalNavDomain + '/images/home/2011/footer-multicultural-cantonese.gif" alt="Cantonese" border="0" width="52" height="16" /></a>', link: '#'}, fr: {value: '<a href="' + GlobalNavBar.getServerInfoObj().mainServer + '/gm/french/corporate/multicultural/cantonese"><img src="' + GlobalNavBar.getServerInfoObj().xmlGlobalNavDomain + '/images/home/2011/footer-multicultural-cantonese.gif" alt="Cantonese" border="0" width="52" height="16" /></a>', link: GlobalNavBar.getServerInfoObj().xmlGlobalNavDomain+'/gm/french/corporate/multicultural/cantonese'}},
						{en: {value: '<a href="' + GlobalNavBar.getServerInfoObj().mainServer + '/gm/english/corporate/multicultural/mandarin"><img src="' + GlobalNavBar.getServerInfoObj().xmlGlobalNavDomain + '/images/home/2011/footer-multicultural-mandarin.gif" alt="Mandarin" border="0" width="52" height="15" /></a>', link: '#'}, fr: {value: '<a href="' + GlobalNavBar.getServerInfoObj().mainServer + '/gm/french/corporate/multicultural/mandarin"><img src="' + GlobalNavBar.getServerInfoObj().xmlGlobalNavDomain + '/images/home/2011/footer-multicultural-mandarin.gif" alt="Mandarin" border="0" /></a>', link: '#'}},
						{en: {value: '<a href="' + GlobalNavBar.getServerInfoObj().mainServer + '/gm/english/corporate/multicultural/punjabi"><img src="' + GlobalNavBar.getServerInfoObj().xmlGlobalNavDomain + '/images/home/2011/footer-multicultural-punjabi.gif"  width="52" height="14" alt="Punjabi" border="0" /></a>', link: '#'}, fr: {value: '<a href="' + GlobalNavBar.getServerInfoObj().mainServer + '/gm/french/corporate/multicultural/punjabi"><img src="' + GlobalNavBar.getServerInfoObj().xmlGlobalNavDomain + '/images/home/2011/footer-multicultural-punjabi.gif"  width="52" height="14" alt="Punjabi" border="0" /></a>', link: '#'}},
						{en: {value: '<a href="' + GlobalNavBar.getServerInfoObj().mainServer + '/gm/english/corporate/multicultural/tamil"><img src="' + GlobalNavBar.getServerInfoObj().xmlGlobalNavDomain + '/images/home/2011/footer-multicultural-tamil.gif"  width="40" height="14" alt="Tamil" border="0" /></a>', link: '#'}, fr: {value: '<a href="' + GlobalNavBar.getServerInfoObj().mainServer + '/gm/french/corporate/multicultural/tamil"><img src="' + GlobalNavBar.getServerInfoObj().xmlGlobalNavDomain + '/images/home/2011/footer-multicultural-tamil.gif"  width="40" height="14" alt="Tamil" border="0" /></a>', link: '#'}}	
					]
				]
			},
			
			{
				title: {bURL: true, en: {value: 'Shopping Tools', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/tools'}, fr: {value: 'Outils d\'achat', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/tools'}},
				rows:
				[
					[	
						{bURL: true, en: {value: 'New Vehicle Offers', link: 'javascript:openCurrentOffers(document.location.href)'}, fr: {value: 'Offre de v&eacute;hicules neufs', link: 'javascript:openCurrentOffers(document.location.href)'}},
						{bURL: true, en: {value: 'Build &amp; Price', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=http://configurator.autodata.gm.ca/GMCanada/modelSelect.html&lang=en&access=0&lastsavedconfig='}, fr: {value: 'Fabriquer et obtenir un prix', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/hostredirect?host=http://configurator.autodata.gm.ca/GMCanada/modelSelect.html&lang=fr&access=0&lastsavedconfig='}},
						{en: {value: 'Estimate Payments', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/payment-estimator/selectMakeModel'}, fr: {value: 'Estimer les paiements', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/payment-estimator/selectMakeModel'}},
						{bURL: true, en: {value: 'Compare Vehicles', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=http://compare.autodata.gm.ca/compare/main.asp&lang=en&year=2012'}, fr: {value: 'Comparaison de v&eacute;hicules', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/hostredirect?host=http://compare.autodata.gm.ca/compare/main.asp&lang=fr&year=2012'}},
						{bURL: true, en: {value: 'Locate a Vehicle', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=http://apps.gm.ca/app/GMCanada/NewVehicleLocatorCriteria.do&lang=en&nav=0&cta=blank&search_year=2012'}, fr: {value: 'Trouvez un v&eacute;hicule', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/hostredirect?host=http://apps.gm.ca/app/GMCanada/NewVehicleLocatorCriteria.do&lang=fr&nav=0&cta=blank&search_year=2012'}},
						{bURL: true, en: {value: 'Locate a Dealer', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=http://apps.gm.ca/app/GMCanada/DealerLocatorSearch.do&nav=0&cta=blank&lang=en'}, fr: {value: 'Trouvez un concessionnaire', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/hostredirect?host=http://apps.gm.ca/app/GMCanada/DealerLocatorSearch.do&nav=0&cta=blank&lang=fr'}},
						{bURL: true, en: {value: 'Schedule a Test Drive', link: 'javascript:openSRAQ' + '(' + "'"  + GlobalNavBar.getServerInfoObj().mainServer + '/gm/english/hostredirect?host=https://apps.gm.ca/app/GMCanada/ContactADealer.do&amp;lang=en&amp;reqType=newveh&amp;year=2012&amp;nav=0' + "'" +')'}, fr: {value: 'Rendez-vous pour un essai routier', link: 'javascript:openSRAQ' + '(' + "'"  +  GlobalNavBar.getServerInfoObj().mainServer + '/gm/french/hostredirect?host=https://apps.gm.ca/app/GMCanada/ContactADealer.do&amp;lang=fr&amp;reqType=newveh&amp;year=2012&amp;nav=0' + "'" +')'}},
						{bURL: true, en: {value: 'Request a Quote', link: 'javascript:openSRAQ' + '(' + "'"  + GlobalNavBar.getServerInfoObj().mainServer + '/gm/english/hostredirect?host=https://apps.gm.ca/app/GMCanada/ContactADealer.do&amp;lang=en&amp;reqType=newveh&amp;year=2012&amp;nav=0' + "'" +')'}, fr: {value: 'Demande de soumission', link: 'javascript:openSRAQ' + '(' + "'"  +  GlobalNavBar.getServerInfoObj().mainServer + '/gm/french/hostredirect?host=https://apps.gm.ca/app/GMCanada/ContactADealer.do&amp;lang=fr&amp;reqType=newveh&amp;year=2012&amp;nav=0' + "'" +')'}},
						{en: {value: 'Appraise Trade-In Value', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/services/financial/financing/appraise-tradein-value'}, fr: {value: '&Eacute;valuez votre v&eacute;hicule', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/services/financial/financing/appraise-tradein-value'}},
						{bLink: true, bHover: true, en: {value: '', link: ''}, fr: {value: '', link: ''}},
						{en: {value: 'First New Car', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/shopping/first-new-car/overview'}, fr: {value: 'Premi&egrave;re voiture neuve', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/shopping/first-new-car/overview'}},
						{en: {value: 'Trailering Guide', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/trailering-guide/all-vehicles/home/overview'}, fr: {value: 'Guide sur le remorquage', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/trailering-guide/all-vehicles/home/overview'}},
						{en: {value: 'Financing &amp; Insurance', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/services/financial/overview'}, fr: {value: 'Financement et assurance', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/services/financial/overview'}}
					]
				]
			},
			
			{
				title: {bURL: true, en: {value: 'Offers and Promotions', link: 'javascript:openCurrentOffers(document.location.href)'}, fr: {value: 'Offres et promotions', link: 'javascript:openCurrentOffers(document.location.href)'}},
				rows:
				[
					[
						{bURL: true, en: {value: 'New Vehicle Offers', link: 'javascript:openCurrentOffers(document.location.href)'}, fr: {value: 'Offre de v&eacute;hicules neufs', link: 'javascript:openCurrentOffers(document.location.href)'}},
						{en: {value: 'Goodwrench Offers', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/services/goodwrench/offers'}, fr: {value: 'Offres Goodwrench', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/services/goodwrench/offers'}},	
						{bLink: true, bHover: true, en: {value: '', link: ''}, fr: {value: '', link: ''}},
						{en: {value: 'GM Card', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/services/gm-card/overview'}, fr: {value: 'La Carte GM', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/services/gm-card/overview'}},
						{en: {value: 'Military Program', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/corporate/offers/gm-military-program/overview'}, fr: {value: 'Programme pour militaires', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/corporate/offers/gm-military-program/overview'}},
						{en: {value: 'Mobility Program', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/corporate/offers/mobility-program/overview'}, fr: {value: 'Programme Mobilit&#233;', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/corporate/offers/mobility-program/overview'}},
						{en: {value: 'Student Bonus', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/corporate/offers/student-bonus-program/overview'}, fr: {value: 'Prime GM pour &eacute;tudiants', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/corporate/offers/student-bonus-program/overview'}},
						{en: {value: 'Supplier Program', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/corporate/supplier-program/overview'}, fr: {value: 'Programme de Fournisseur', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/corporate/supplier-program/overview'}}
					]
				]
			},
			
			{
				title: {bURL: true, en: {value: ' For Owners', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/owners/home'}, fr: {value: 'Propri&eacute;taires', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/owners/home'}},
				rows:
				[
					[
						{en: {value: 'Buick', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/owner_centre/buick/home/overview'}, fr: {value: 'Buick', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/owner_centre/buick/home/overview'}},
						{en: {value: 'Cadillac', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/owner_centre/cadillac/home/overview'}, fr: {value: 'Cadillac', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/owner_centre/cadillac/home/overview'}},
						{en: {value: 'Chevrolet', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/owner_centre/chevrolet/home/overview'}, fr: {value: 'Chevrolet', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/owner_centre/chevrolet/home/overview'}},
						{en: {value: 'GMC', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/owner_centre/gmc/home/overview'}, fr: {value: 'GMC', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/owner_centre/gmc/home/overview'}},
						{en: {value: 'HUMMER', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/owner_centre/hummer/home/overview'}, fr: {value: 'HUMMER', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/owner_centre/hummer/home/overview'}},
						{en: {value: 'Pontiac', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/owner_centre/pontiac/home/overview'}, fr: {value: 'Pontiac', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/owner_centre/pontiac/home/overview'}},
						{en: {value: 'Saturn', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/owner_centre/saturn/home/overview'}, fr: {value: 'Saturn', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/owner_centre/saturn/home/overview'}},
						{en: {value: 'Other', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/owner_centre/corporate/home/overview'}, fr: {value: 'Autres', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/owner_centre/corporate/home/overview'}},
						{bLink: true, bHover: true, en: {value: '', link: ''}, fr: {value: '', link: ''}},
						{en: {value: 'Goodwrench Service', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/services/goodwrench/overview'}, fr: {value: 'Service Goodwrench', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/services/goodwrench/overview'}},
						{en: {value: 'Financing and Insurance', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/services/financial/overview'}, fr: {value: 'Financement et assurance', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/services/financial/overview'}},
						{en: {value: 'Warranty', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/services/warranty/overview'}, fr: {value: 'Garanties', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/services/warranty/overview'}},
						{en: {value: 'Parts', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/shopping/parts/overview'}, fr: {value: 'Pi&egrave;ces', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/shopping/parts/overview'}},
						{en: {value: 'Accessories', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/shopping/accessories/overview'}, fr: {value: 'Accessoires', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/shopping/accessories/overview'}},
						{en: {value: 'OnStar', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/shopping/accessories/onstar'}, fr: {value: 'OnStar', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/shopping/accessories/onstar'}},
						{en: {value: 'XM Radio', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/shopping/xm-radio/overview'}, fr: {value: 'Radio XM', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/shopping/xm-radio/overview'}},
						{en: {value: 'Appraise Trade-In Value', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/services/financial/financing/appraise-tradein-value'}, fr: {value: '&Eacute;valuez votre v&eacute;hicule', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/services/financial/financing/appraise-tradein-value'}}
						
					]
				]
			},
			
			{
				title: {bURL: true, en: {value: 'Dealers', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=http://apps.gm.ca/app/GMCanada/DealerLocatorSearch.do&nav=0&cta=blank&lang=en'}, fr: {value: 'Concessionnaires', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/hostredirect?host=http://apps.gm.ca/app/GMCanada/DealerLocatorSearch.do&nav=0&cta=blank&lang=fr'}},
				rows:
				[
					[
						{bURL: true, en: {value: 'Locate a Dealer', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=http://apps.gm.ca/app/GMCanada/DealerLocatorSearch.do&nav=0&cta=blank&lang=en'}, fr: {value: 'Trouvez un concessionnaire', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/hostredirect?host=http://apps.gm.ca/app/GMCanada/DealerLocatorSearch.do&nav=0&cta=blank&lang=fr'}}
					]
				]
			},
			
			{
				title: {bURL: true, en: {value: 'About Us', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/about'}, fr: {value: '&Agrave; notre sujet', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/about'}},
				rows:
				[
					[
						{en: {value: 'Our Company', link: GlobalNavBar.getServerInfoObj().mainServer+'/inm/gmcanada/english/about/index.html'}, fr: {value: 'Aper&ccedil;u de la soci&eacute;t&eacute;', link: GlobalNavBar.getServerInfoObj().mainServer+'/inm/gmcanada/french/about/index.html'}},
						{en: {value: 'News and Events', link: GlobalNavBar.getServerInfoObj().mainServer+'/inm/gmcanada/english/about/News/news.html'}, fr: {value: 'Nouvelles et &eacute;v&eacute;nements', link: GlobalNavBar.getServerInfoObj().mainServer+'/inm/gmcanada/french/about/News/news.html'}},
						{en: {value: 'The Olympic Games', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/corporate/olympics/overview'}, fr: {value: 'Les Jeux olympiques', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/corporate/olympics/overview'}},
						{en: {value: 'Career Centre', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/corporate/about/career'}, fr: {value: 'Centre des carri&egrave;res', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/corporate/about/career'}},
						{bURL: true, en: {value: 'Contact Us', link: 'https://contactus.gm.ca/english/email_us.aspx'}, fr: {value: 'Renseignements', link: 'https://contactus.gm.ca/french/email_us.aspx'}}
					]
				]
			}
		],
		
		/**
		* @note		Drop down menu data.
		*/
		GlobalMenuDataRight =
		[
			{
				title: {bURL: true, en: {value: 'GM Home', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/home'}, fr: {value: 'Accueil GM', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/home'}}
			},
			
			{
				title: {bURL: true, en: {value: 'My GM.ca', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=https://apps.gm.ca/app/mygm/Logon.do&lang=en'}, fr: {value: 'Mon GM.ca', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/hostredirect?host=https://apps.gm.ca/app/mygm/Logon.do&lang=fr'}},
				rows:
				[
					[
						{bURL: true, en: {value: 'My Showroom', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=https://apps.gm.ca/app/mygm/MyShowroom.do&lang=en&cta=myshowroom'}, fr: {value: 'Ma salle d\'exposition', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/hostredirect?host=https://apps.gm.ca/app/mygm/MyShowroom.do&lang=fr&cta=myshowroom'}},
						{bURL: true, en: {value: 'My Dealers', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=https://apps.gm.ca/app/mygm/MyDealers.do&lang=en&cta=mydealers&ComponentName=buycentre'}, fr: {value: 'Mes concessionnaires', link:GlobalNavBar.getServerInfoObj().mainServer+ '/gm/french/hostredirect?host=https://apps.gm.ca/app/mygm/MyDealers.do&lang=fr&cta=mydealers&ComponentName=buycentre'}},
						{bURL: true, en: {value: 'My Driveway', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=https://apps.gm.ca/app/mygm/MyDriveway.do&nav=mygm&lang=en'}, fr: {value: 'Mon garage', link:GlobalNavBar.getServerInfoObj().mainServer+ '/gm/french/hostredirect?host=https://apps.gm.ca/app/mygm/MyDriveway.do&nav=mygm&lang=fr'}},
						{bURL: true, en: {value: 'My Preferences', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/hostredirect?host=https://apps.gm.ca/app/mygm/ManageProfile.do&lang=en'}, fr: {value: 'Mes pr&eacute;f&eacute;rences', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/hostredirect?host=https://apps.gm.ca/app/mygm/ManageProfile.do&lang=fr'}}
					]
				]
			}
			/**
			,{
				title: {en: {value: 'Help', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/corporate/help/overview'}, fr: {value: 'Aide', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/corporate/help/overview'}},
				rows:
				[
					[
						{en: {value: 'Search', link: GlobalNavBar.getServerInfoObj().mainServer+'/servlet/advsearch?client=english_pref_search&proxystylesheet=english_pref_search&output=xml_no_dtd&site=english_pref_search&proxycustom=%3CHOME/%3E'}, fr: {value: 'Recherche', link: GlobalNavBar.getServerInfoObj().mainServer+'/servlet/advsearch?client=french_pref_search&proxystylesheet=french_pref_search&output=xml_no_dtd&site=french_pref_search&proxycustom=%3CHOME/%3E'}},
						{en: {value: 'FAQ', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/corporate/help/faq'}, fr: {value: 'FAQ', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/corporate/help/faq'}},
						{en: {value: 'Privacy Policy', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/corporate/help/privacy/overview'}, fr: {value: 'Vie Priv&eacute;e', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/corporate/help/privacy/overview'}},
						{en: {value: 'Legal', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/english/corporate/help/legal'}, fr: {value: 'Juridique', link: GlobalNavBar.getServerInfoObj().mainServer+'/gm/french/corporate/help/legal'}}
					]
				]
			},
			
			{
				title: {id: 'nav_lang', bURL: true, en: {value: 'Fran&#231;ais', link: GlobalNavBar.getServerInfoObj().mainServer+'javascript:switchLangWithSession();'}, fr: {bURL: true, value: 'English', link: GlobalNavBar.getServerInfoObj().mainServer+'javascript:switchLangWithSession();'}}
			}
			*/
		],
		
		
		/**
		* * note	Create a single instance of the GlobalNavBarCSS object.
		*/
		GlobalNavBarCSS = (function ()
		{
			var globalNavWidth = '100%';
			if (window.location.href.indexOf('ca/inm/') != -1){
				globalNavWidth = '990px';
			}
			
			var oStyle = document.createElement('style'),
				sCSS = '#GlobalNav, #GlobalNavMarker {position: relative; width: ' + globalNavWidth + '; height: 32px;z-index: 100000;}\
						#GlobalNavBar {position: absolute; top: 0; left: 0; width:  ' + globalNavWidth + '; z-index: 100000; background: #fff;}\
						#GlobalNavBar a {font-size: 11px; text-decoration: none;}\
						#GlobalNavBar a:hover {text-decoration: underline;}\
						#GlobalNavBar ul {padding: 0 0; margin: 0 0; list-style: none; text-align: left;}\
						#GlobalNavBar ul li {height: 16px; line-height: 16px; white-space: nowrap;}\
						#GlobalNavBar .GlobalNavBarMenuContainer {float: left; position: relative; width: 100%; height: 34px;}\
						#GlobalNavBarMenuListLeft, .MenuList, .MenuListName {float: left; position: relative;}\
						#GlobalNavBarMenuListRight {float: right; position: relative;}\
						#GlobalNavBarMenuListRight .MenuListItems {right: 0;}\
						#GlobalNavBarMenuListLeft .MenuListItems {left: 0;}\
						#GlobalNavBar .MenuListName {height: 32px; line-height: 32px; cursor: pointer; background: #fff;}\
						#GlobalNavBar .MenuListName a {padding: 0 8px; font-weight: bold; color: #000; white-space: nowrap; outline: none; border-right: 1px solid #000;}\
						#GlobalNavBar .MenuList:hover .MenuListName a {color: #777;}\
						#GlobalNavBar .MenuListItems {position: absolute; top: 32px; display: none; visibility: hidden; background: #fff; border: 1px solid #ccc; border-top: none; -moz-border-radius: 3px; -webkit-border-radius: 3px;}\
						#GlobalNavBar .MenuList:hover .MenuListItems {display: block; visibility: visible;}\
						#GlobalNavBar .MenuListItems ul {background: #fff; }\
						#GlobalNavBar .MenuListItems ul li {_width: 175px; height: 18px; border-bottom: 1px dashed #ccc; cursor: pointer;}\
						#GlobalNavBar .MenuListItems ul li:hover {background: #777;}\
						#GlobalNavBar .MenuListItems ul li.GlobalNavBarMenuListOpen {background: #777;}\
						#GlobalNavBar .MenuListItems ul li.bHover {background: #fff;}\
						#GlobalNavBar .MenuListItems ul li.GlobalNavBarMenuListOpen a {color: #fff; text-decoration: none;}\
						#GlobalNavBar .MenuListItems ul li a {height: 18px; line-height: 18px; outline: none; color: #000; text-decoration: none; cursor: pointer; }\
						#GlobalNavBar .MenuListItems ul li:hover a, .MenuListItems ul li:hover .GlobalNavBarMenuListItem {color: #fff; text-decoration: none;}\
						#GlobalNavBar .GlobalNavBarMenuListItem {position: relative; width: 100%; padding-left: 10px;padding-right: 25px;}';
						
				oStyle.type = 'text/css';
	
				if(oStyle.styleSheet)
				{
					oStyle.styleSheet.cssText = sCSS;
				}
				else
				{
					oStyle.appendChild(document.createTextNode(sCSS));
				}
				
				document.getElementsByTagName('head')[0].appendChild(oStyle);
				
				return oStyle;
		}) (),
		
		
		/**
		* * note	Create a single instance of the GlobalNavBarHTML object.
		*/
		GlobalNavBarHTML = (function ()
		{
			var sHTML = '<div id="GlobalNavBar">\
							<div class="GlobalNavBarMenuContainer">\
								<div id="GlobalNavBarMenuListLeft"></div>\
								<div id="GlobalNavBarMenuListRight"></div>\
							</div>\
						</div>';
				
				return sHTML;
		}) ();
		
		
		/**
		* @note		Set a marker, to determine if the script is placed in the header to avoid writing the GlobalNavMarker.
		*/
		document.write('<script type="text/javascript" id="GlobalNavScriptMarker"><\/script>');
		
		var oScript = document.getElementById('GlobalNavScriptMarker');
		
		if (oScript.parentNode != document.getElementsByTagName('head')[0])
		{
			document.write('<div id=\"GlobalNavMarker\" style=\"display:none;visibility:hidden;\"><\/div>');
		}
		
		/**
		* @function		init
		* @usage		Builds the Global Nav menu.
		*/
		function init ()
		{
			var oGlobal = document.getElementById('GlobalNav');
				
				/**
				* @note We are in an inline scenario
				*/
				if (!oGlobal)
				{
					var oDiv1 = document.getElementById('GlobalNavMarker');
					
						oGlobal = document.createElement('div');
						oGlobal.id = 'GlobalNav';
						
						if (oDiv1)
						{
							oDiv1.appendChild(oGlobal);
							oDiv1.style.display = 'block';
							oDiv1.style.visibility = 'visible';
						}
				}
				
				if (document.getElementById('GlobalNav'))
				{
					/***
					@note Prior to rendering GlobalNav, fix any problems in the page body structure
					***/
					GlobalNavBeforeRender();
					
					/**
					* @note If here before the if statement is executed, then the element GlobalNav was placed.
					*/
					oGlobal.innerHTML = GlobalNavBarHTML;
						
					/**
					* @note		Build the menus.
					*/
					var oMenu1 = document.getElementById('GlobalNavBarMenuListLeft');
					
					if (typeof oMenu1 == 'object')
					{
						oMenu1.appendChild(GlobalNavBar.create(GlobalMenuDataLeft, 'MenuList', 'MenuListItems', 'MenuListName', '', true));
					}
					
					var oMenu2 = document.getElementById('GlobalNavBarMenuListRight');
					
					if (typeof oMenu2 == 'object')
					{
						oMenu2.appendChild(GlobalNavBar.create(GlobalMenuDataRight, 'MenuList', 'MenuListItems', 'MenuListName', '', true));
					}
				}
		}
		
		
		/**
		* @note		DOM Ready handler.
		*/
		var alreadyrunflag = 0 //flag to indicate whether target function has already been run
		
		if (document.addEventListener)
		{
			document.addEventListener("DOMContentLoaded", function()
			{
				alreadyrunflag = 1;
				init();
			}, false)
		}
		else if (document.all && !window.opera)
		{
			var sSRC ="javascript:void(0)";
			var sAgent = navigator.userAgent;
			if(sAgent.indexOf('MSIE') > -1)
			{
				sSRC = (location.protocol == "https:") ? "//:" : "javascript:void(0)";
			}
			document.write('<script type="text/javascript" id="GlobalNavContentLoadTag" defer="defer" src="'+sSRC+'"><\/script>')
			var contentloadtag=document.getElementById('GlobalNavContentLoadTag')
			
				contentloadtag.onreadystatechange=function()
				{
					if (this.readyState == 'complete')
					{
							alreadyrunflag = 1
							init();
					}
				}
		}
		
		/**
		* @note		Souble check on the nav bar being set.
		*/
		setTimeout(function ()
		{
			if (!alreadyrunflag)
			{
				init();
			}
		}, 2000);
	
	}) ();
	
	/*
		------------------------------------------- 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;
		
		var redirectionFromApps = "";
		
		var sLoc = window.location.href;
		var theDomain = 'http://' + sLoc.split('/')[2];
		
		if (sLoc.indexOf('www.') != -1){
				var serverURL = 'http://www.gm.ca';
		}
		else if (sLoc.indexOf('itl-pnt.') != -1 || 
			sLoc.indexOf('itl001.') != -1){
				var serverURL = theDomain;
		}				
		else if (sLoc.indexOf('itl.preview.') != -1){
				var serverURL = 'http://itl.preview.tech.mminteractive.com';
		}	
		else if (sLoc.indexOf('itl.') != -1){
				var serverURL = 'http://itl.gm.ca';
		}
		else if (sLoc.indexOf('preprod.preview.') != -1){
				var serverURL = 'http://preprod.preview.tech.mminteractive.com';
		}
		else if (sLoc.indexOf('preprod.') != -1){
				var serverURL = 'http://preprod.gm.ca';
		}					
		else if (sLoc.indexOf('prod.preview.') != -1){
				var serverURL = 'http://prod.preview.tech.mminteractive.com';
		}
		else if (sLoc.indexOf('localhost') != -1){
				var serverURL = 'http://localhost';
		}
		else{
				var serverURL = 'http://www.gm.ca';
		}
		
		if (sLoc.indexOf('apps.') != -1 || sLoc.indexOf('autodata.') != -1 || sLoc.indexOf('contactus.') != -1){
				redirectionFromApps = "apps";
		}

		if(division != "" && division != "all/" && postal != "" && !ChangeInput){	// Make redirection when we have brand + postal + we don`t wan`t to change brand / postal
			document.location = serverURL + "/gm/" + language + "/vehicles/" + division + "all/current-offers?postalCode=" + postal + ADVURL1;
		}else{
			var popWindow = window.open (serverURL + "/gm/" + language + "/vehicles/" + division + "all/current-offers/selection/" + redirectionFromApps + ADVURL2,"CurrentOffers","toolbar=0, status=0, width=" + w + "px, height=" + h + "px, top=" + topPos + "px, left=" + leftPos + "px");
			popWindow.focus();
		}

	}
	
	/*
	 * mhogg: August 2011
	 * Add Netmining pop-in to any non-MRM pages that's including this legacy nav script (work around Cap code freeze)
	 */
	
	var jsTimer = new Array(); 				// Used for checking if a script has loaded (below)
	var timerCounter = new Array();		// Track how many times we check for JS as a fallback to cancel loading when there's a failure
	
	// Utility function to check if some JS file exists
	// Parameter test is a function that you want to return true when the loaded file is ready to use (i.e., loaded AND parsed)
	function jsExists(url, test) {
		var exists = false;
		var assets = document.getElementsByTagName("script");
		for (var i = assets.length - 1; i >= 0; i--) {
			if (assets[i].getAttribute("src") != null && assets[i].getAttribute("src").indexOf(url) != -1) {
				exists = true;
				break;
			}
		}
		return (exists && test());
	}

	// Utility function for dynamically including JS
	// Parameter test is a function that you want to return true when the loaded file is ready to use (i.e., loaded AND parsed)
	// Parameter callback is a function to run when the file has been fully loaded
	// Have to poll to know when the JS file is finally present so that the callback can be executed
	function loadJS(url, test, callback) {
		jsTimer[url] = setInterval(function() {
			if (jsExists(url, test) || timerCounter[url] >= 150) {
				if (timerCounter < 150) if (typeof callback != "undefined") callback(); // i.e., the include was successful, rather than a timeout error
				clearInterval(jsTimer[url]);
				jsTimer[url] = null;
			}
			timerCounter[url] = timerCounter[url] + 1;
		}, 200);
		if (!jsExists(url, test)) {
			var asset = document.createElement("script");
			asset.type = "text/javascript";
			asset.async = true;
			asset.src = url;
			document.getElementsByTagName("body")[0].appendChild(asset);
		} else {
			clearInterval(jsTimer[url]);
			jsTimer[url] = null;
			if (typeof callback != "undefined") callback();
		}
	}
	
	(function () {
		
		// Function to request the Netmining script
		function netmngInit() {
			var netmngPath = document.location.protocol + "//com-gmtagging.netmng.com/";
			if (window.location.href.indexOf("www.") == -1) netmngPath += "?env=preprod";
			loadJS(netmngPath, function() { return true; });
		}
		
		// Initialize netmining when the DOM is ready, but only for non-MRM pages
		if (!/\/gm\//.test(window.location.href)) {
			var alreadyrunflag = 0;
			if (document.addEventListener) {
				document.addEventListener("DOMContentLoaded", function() {
					alreadyrunflag = 1;
					netmngInit();
				}, false)
			} else if (document.all && !window.opera) {
				var sSRC = "javascript:void(0)";
				var sAgent = navigator.userAgent;
				if (sAgent.indexOf('MSIE') > -1) sSRC = (location.protocol == "https:") ? "//:" : "javascript:void(0)";
				document.write('<script type="text/javascript" id="GlobalNavContentLoadTag" defer="defer" src="' + sSRC + '"><\/script>');
				var contentloadtag = document.getElementById('GlobalNavContentLoadTag');
				contentloadtag.onreadystatechange = function() {
					if (this.readyState == 'complete') {
						alreadyrunflag = 1;
						netmngInit();
					}
				}
			}
			setTimeout(function() {
				if (!alreadyrunflag) { netmngInit(); }
			}, 2000);
		}
		
		// Check to see if jQuery is loaded, and if not, add it to DOM
		function isJQueryLoaded() {
			if (typeof jQuery != 'undefined') { 
				//alert("jQuery library is loaded!");
			} else { // no jQuery library, so add it
				//alert("jQuery library is not found!");
				var serverURL = getServerDomain(); 
				var element1 = document.createElement("script");
				element1.src = serverURL + "/js/common/jquery-1.4.4.min.js";
				element1.type="text/javascript";
				document.getElementsByTagName("head")[0].appendChild(element1);
			}	
		}
		
		// check for plugin, otherwise add it to DOM (must in form of jquery.<pluginName>-min.js)
		function isPluginLoaded(pluginName) {
			if ($().pluginName) { 
				//alert(pluginName + " plugin is loaded");
			} else { // not found, so add it
				//alert(pluginName + " plugin is NOT found!");
				var serverURL = getServerDomain(); 
				var element1 = document.createElement("script");
				element1.src = serverURL + "/js/common/jquery." + pluginName + "-min.js";
				element1.type="text/javascript";
				document.getElementsByTagName("head")[0].appendChild(element1);
				// css
				var element2 = document.createElement("link");
				element2.href = serverURL + "/css/common/" + pluginName + ".css";
				element2.type= "text/css";
				element2.rel= "stylesheet";
				element2.media= "screen";
				document.getElementsByTagName("head")[0].appendChild(element2);
			}
		}

		
	})();		
	
function getServerDomain(){

	var sLoc = window.location.href;
	var theDomain = 'http://' + sLoc.split('/')[2];

	if (sLoc.indexOf('www.') != -1){
			var serverURL = 'http://www.gm.ca';
	}
	else if (sLoc.indexOf('pnt.') != -1 || sLoc.indexOf('itl001.') != -1){
			var serverURL = theDomain;
	}				
	else if (sLoc.indexOf('itl.preview.') != -1){
			var serverURL = 'http://itl.preview.tech.mminteractive.com';
	}	
	else if (sLoc.indexOf('itl.') != -1){
			var serverURL = 'http://itl.gm.ca';
	}
	else if (sLoc.indexOf('preprod.preview.') != -1){
			var serverURL = 'http://preprod.preview.tech.mminteractive.com';
	}
	else if (sLoc.indexOf('preprod.') != -1){
			var serverURL = 'http://preprod.gm.ca';
	}					
	else if (sLoc.indexOf('prod.preview.') != -1){
			var serverURL = 'http://prod.preview.tech.mminteractive.com';
	}
	else if (sLoc.indexOf('localhost') != -1){
			var serverURL = 'http://localhost';
	}
	else{
			var serverURL = 'http://www.gm.ca';
	}

	return serverURL;
}

