function activateCacheImgIE6(){
	try {
	  javascript:void(document.execCommand("BackgroundImageCache",false,true));
	} catch(e) {}
}

activateCacheImgIE6();

function OnEnterItemList(anchor) {
	anchor.childNodes[2].style.display = "block";
	anchor.childNodes[1].style.display = "none";
}

function OnExitItemList(anchor) {
	anchor.childNodes[1].style.display = "block";
	anchor.childNodes[2].style.display = "none";
}

//http://www.biasecurities.com/blogs/jim/archive/2005/04/28/1794.aspx
function AttachEvent(elementObj, eventName, eventHandlerFunctionName)
{
  if (elementObj.addEventListener)
  { // Non-IE browsers
    elementObj.addEventListener(eventName, eventHandlerFunctionName, false);
  }
  else if (elementObj.attachEvent)
  { // IE 6+
    elementObj.attachEvent('on' + eventName, eventHandlerFunctionName);
  }
  else
  { // Older browsers
    var currentEventHandler = elementObj['on' + eventName];
    if (currentEventHandler == null)
    {
      elementObj['on' + eventName] = eventHandlerFunctionName;
    }
    else
    {
      elementObj['on' + eventName] = function(e) { currentEventHandler(e); eventHandlerFunctionName(e); }
    }
  }
}

function getObj(eventArgs){
 	var obj;

	if (eventArgs.target) {
		obj = eventArgs.target;
	} else if (eventArgs.srcElement) {
		obj = eventArgs.srcElement;
	}
	/* For most browsers, obj would now be the object we're after; Safari however
		returns a text node so we need to check the node type to make sure */
	if (obj.nodeType == 3) {
	    obj = obj.parentNode;
	}

 	return obj;
}

function getObjID(eventArgs){
  var obj = getObj(eventArgs)
  return obj.id;
}

function replaceAll( str, from, to ) {
    var idx = str.indexOf( from );

    while ( idx > -1 ) {
        str = str.replace( from, to );
        idx = str.indexOf( from );
    }
    return str;
}

function getESTHour() {
	var date = new Date();
	date = new Date(Date.UTC(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate(),date.getUTCHours(),date.getUTCMinutes(),date.getUTCSeconds()) - 18000000);
	var dsti = 14 - (Math.floor (1 + date.getUTCFullYear() * 5 / 4) % 7);
	var dste = 7 - (Math.floor (1 + date.getUTCFullYear() * 5 / 4) % 7);
	var tmpi = new Date(Date.UTC(date.getUTCFullYear(), 2, dsti, 2));
	var tmpe = new Date(Date.UTC(date.getUTCFullYear(), 10, dste, 2));
	if ((date.getTime() >= tmpi.getTime()) && (date.getTime() <= tmpe.getTime())) date = new Date(Date.UTC(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate(),date.getUTCHours(),date.getUTCMinutes(),date.getUTCSeconds()) + 3600000);
	return date.getUTCHours();
}

function getElemRefs(id) {
    var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
    if (el) el.css = (el.style)? el.style: el;
    return el;
}

// --------------------------------------------------------------
// generic name/value pair function
// return a hash (of sorts) of name value pairs from the querystring
// uasge: var qsParams = getQsParams();
// then: qsParams['url'] whould equal whatever url=XXX in the querystring

function getQsParams() {
	var qs = location.search;
	qs = qs.substring(1);
	// create an 'array' called newArray with the name value pairs from the querystring
	var qsArray = new Array;
	qsArray = qs.split('&'); //creating an array in which the values are separated by ampersands in the code//
	var keyValueArray = new Array; //this one loads the names and values into a hash (of sorts)//
	for(i=0; i<qsArray.length; i++) {
		var nameValue = qsArray[i].split('='); //splitting what we find between each ampersand into key value pairs //
		keyValueArray[nameValue[0]] = unescape(nameValue[1]); //we are then turning all the escaped characters back into the 'real thing' ie. %3F turns into a '?' //
	}
	return keyValueArray;
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	} else {
		var expires = "";
	}
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

/* pop-up function. only needs a url and winName parameter -- attributes are defaulted.
it is recommended that call to function at least include width and height attributes.
any attribute passed in will take precedence over default. -- dtw 8/5/05 */
function popUpWindow(url,winName,attributes,parent) {
  if (navigator.appName=="Microsoft Internet Explorer" && winName=="gallery")
  {
		attributes += ",width=709";
		attributes += ",height=675";
		attributes += ",top=5";
		attributes += ",left=50";
	}
	if(winName=="onstarpopup"){
		parent.close();	
	}
	if (attributes.indexOf("directories") == -1) { attributes += ",directories=0"; }
	if (attributes.indexOf("location") == -1) {	attributes += ",location=0"; }
	if (attributes.indexOf("menubar") == -1) { attributes += ",menubar=0"; }
	if (attributes.indexOf("resizable") == -1) { attributes += ",resizable=0"; }
	if (attributes.indexOf("scrollbars") == -1) { attributes += ",scrollbars=1"; }
	if (attributes.indexOf("status") == -1) { attributes += ",status=0"; }
	if (attributes.indexOf("toolbar") == -1) { attributes += ",toolbar=0"; }
	if (attributes.indexOf("top") == -1) { attributes += ",top=80";	}
	if (attributes.indexOf("left") == -1) { attributes += ",left=50"; }
	
	var newWindow = window.open(url,winName,attributes);
	if(winName=="onstarpopup"){
		newWindow.moveTo(0,0);
		newWindow.resizeTo(screen.width,screen.height);
	}
	if(winName=="GM_Conversations") {
		dTagChats();	
	}
	if (window.focus && newWindow) { newWindow.focus() }
}

// We have a lot of popup windows that show up all over the site.
// We define them commonly here, so that should a request come in to change a param of the window (say the size, or position),
// we can update it in one place as opposed to accross the site.

function getParameter (queryString, parameterName ) {
	// Add "=" to the parameter name (i.e. parameterName=value)
	var parameterName = parameterName + "=";
	if (queryString.length > 0 ) {
		// Find the beginning of the string
		begin = queryString.indexOf ( parameterName );
		// If the parameter name is not found, skip it, otherwise return the value
		if ( begin != -1 ) {
			// Add the length (integer) to the beginning
			begin += parameterName.length;
			// Multiple parameters are separated by the "&" sign
			end = queryString.indexOf ( "&" , begin );
			if ( end == -1 ) {
				end = queryString.length
			}
			// Return the string
			return unescape ( queryString.substring ( begin, end ) );
		}
		// Return "null" if no parameter has been found
		return "null";
	}
}


function addParameter (queryString, parameterName, parameterValue) {
	if(queryString.indexOf ( "?" )==-1){
		queryString+="?";
	}
	else{
		queryString+="&";
	}
	queryString+=parameterName+"="+parameterValue;
	return queryString;
}


function breakWord(word) {
	if (word.indexOf("/") > -1) word = word.split("/").join("/<wbr/>");
	if (word.indexOf("-") > -1) word = word.split("-").join("-<wbr/>");
	if (word.indexOf("_") > -1) word = word.split("_").join("_<wbr/>");
	if (word.indexOf(",") > -1) word = word.split(",").join(",<wbr/>");
	word = word.split(" ").join(" <wbr/>");
	return word;
}

function breakName(word) {
	if(word.indexOf("/")>-1){
		word = word.split("/").join("/<wbr/>");
	}
	if(word.indexOf(",")>-1){
		word = word.split(",").join(",<wbr/>");
	}
	return word;
}

function clickTrackBar(){
	if (!document.getElementsByTagName) return;
		//var anchors = document.getElementById("zoneBrandBar").getElementsByTagName("a");
		var anchors = document.getElementsByTagName("a");
		var pageName = "GM | SHOP GM VEHICLES | DIVISION LINK | ";
		for (var i=0; i<anchors.length; i++) {
			var anchor = anchors[i];
			var s_prop1 = "SHOP GM VEHICLES";
			var s_prop2 = "DIVISION LINK";
			var s_prop3 = s_prop1 + " |" + s_prop2;
			var s_prop5 = "";
			var s_prop38 = "";
			var s_prop44 = "";
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "Omni_Chevy")
				anchor.onclick = function(){
					s_prop38 = "CHEVROLET";
					s_prop3 = s_prop1 + " |" + s_prop38;
					s_prop44 = s_prop38 + " | " + s_prop2;
					s_prop5 = pageName + s_prop38;
					pageTrack(pageName +  s_prop38,{s_prop1:s_prop1,s_prop2:s_prop38,s_prop3:s_prop3,s_prop5:s_prop5,s_prop38:s_prop38,s_prop44:s_prop44});
				}
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "Omni_Buick")
				anchor.onclick = function(){
					s_prop38 = "BUICK";
					s_prop3 = s_prop1 + " |" + s_prop38;
					s_prop44 = s_prop38 + " | " + s_prop2;
					s_prop5 = pageName + s_prop38;
					pageTrack(pageName +  s_prop38,{s_prop1:s_prop1,s_prop2:s_prop38,s_prop3:s_prop3,s_prop5:s_prop5,s_prop38:s_prop38,s_prop44:s_prop44});
				}
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "Omni_Pontiac")
				anchor.onclick = function(){
					s_prop38 = "PONTIAC";
					s_prop3 = s_prop1 + " |" + s_prop38;
					s_prop44 = s_prop38 + " | " + s_prop2;
					s_prop5 = pageName + s_prop38;
					pageTrack(pageName +  s_prop38,{s_prop1:s_prop1,s_prop2:s_prop38,s_prop3:s_prop3,s_prop5:s_prop5,s_prop38:s_prop38,s_prop44:s_prop44});
				}
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "Omni_GMC")
				anchor.onclick = function(){
					s_prop38 = "GMC";
					s_prop3 = s_prop1 + " |" + s_prop38;
					s_prop44 = s_prop38 + " | " + s_prop2;
					s_prop5 = pageName + s_prop38;
					pageTrack(pageName +  s_prop38,{s_prop1:s_prop1,s_prop2:s_prop38,s_prop3:s_prop3,s_prop5:s_prop5,s_prop38:s_prop38,s_prop44:s_prop44});
				}
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "Omni_Saturn")
				anchor.onclick = function(){
					s_prop38 = "SATURN";
					s_prop3 = s_prop1 + " |" + s_prop38;
					s_prop44 = s_prop38 + " | " + s_prop2;
					s_prop5 = pageName + s_prop38;
					pageTrack(pageName +  s_prop38,{s_prop1:s_prop1,s_prop2:s_prop38,s_prop3:s_prop3,s_prop5:s_prop5,s_prop38:s_prop38,s_prop44:s_prop44});
				}
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "Omni_Hummer")
				anchor.onclick = function(){
					s_prop38 = "HUMMER";
					s_prop3 = s_prop1 + " |" + s_prop38;
					s_prop44 = s_prop38 + " | " + s_prop2;
					s_prop5 = pageName + s_prop38;
					pageTrack(pageName +  s_prop38,{s_prop1:s_prop1,s_prop2:s_prop38,s_prop3:s_prop3,s_prop5:s_prop5,s_prop38:s_prop38,s_prop44:s_prop44});
				}
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "Omni_Saab")
				anchor.onclick = function(){
					s_prop38 = "SAAB";
					s_prop3 = s_prop1 + " |" + s_prop38;
					s_prop44 = s_prop38 + " | " + s_prop2;
					s_prop5 = pageName + s_prop38;
					pageTrack(pageName +  s_prop38,{s_prop1:s_prop1,s_prop2:s_prop38,s_prop3:s_prop3,s_prop5:s_prop5,s_prop38:s_prop38,s_prop44:s_prop44});
				}
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "Omni_Cadillac")
				anchor.onclick = function(){
					s_prop38 = "CADILLAC";
					s_prop3 = s_prop1 + " |" + s_prop38;
					s_prop44 = s_prop38 + " | " + s_prop2;
					s_prop5 = pageName + s_prop38;
					pageTrack(pageName +  s_prop38,{s_prop1:s_prop1,s_prop2:s_prop38,s_prop3:s_prop3,s_prop5:s_prop5,s_prop38:s_prop38,s_prop44:s_prop44});
				}
		}
}window.onload = clickTrackBar;

function pageTrack(pagename, oArg) {
	s_pageName = pagename;
	if (oArg) {
		if (typeof(oArg.s_prop5) == "string") { s_prop5 = oArg.s_prop5.toUpperCase(); }
		if (typeof(oArg.s_prop1) == "string") { s_prop1 = oArg.s_prop1.toUpperCase(); }
		if (typeof(oArg.s_prop2) == "string") { s_prop2 = oArg.s_prop2.toUpperCase(); }
		if (typeof(oArg.s_prop3) == "string") { s_prop3 = oArg.s_prop3.toUpperCase(); }
		if (typeof(oArg.s_prop11) == "string") { s_prop11 = oArg.s_prop11.toUpperCase(); }
		if (typeof(oArg.s_prop12) == "string") { s_prop12 = oArg.s_prop12.toUpperCase(); }
		if (typeof(oArg.s_prop13) == "string") { s_prop13 = oArg.s_prop13.toUpperCase(); }
		if (typeof(oArg.s_prop14) == "string") { s_prop14 = oArg.s_prop14.toUpperCase(); }
		if (typeof(oArg.s_prop15) == "string") { s_prop15 = oArg.s_prop15.toUpperCase(); }
		if (typeof(oArg.s_prop16) == "string") { s_prop16 = oArg.s_prop16.toUpperCase(); }
		if (typeof(oArg.s_prop17) == "string") { s_prop17 = oArg.s_prop17.toUpperCase(); }
		if (typeof(oArg.s_prop19) == "string") { s_prop19 = oArg.s_prop19.toUpperCase(); }
		if (typeof(oArg.s_prop26) == "string") { s_prop26 = oArg.s_prop26.toUpperCase(); }
	 	if (typeof(oArg.s_prop27) == "string") { s_prop27 = oArg.s_prop27.toUpperCase(); }
	 	if (typeof(oArg.s_prop28) == "string") { s_prop28 = oArg.s_prop28.toUpperCase(); }
		if (typeof(oArg.s_prop38) == "string") { s_prop38 = oArg.s_prop38.toUpperCase(); }
		if (typeof(oArg.s_prop44) == "string") { s_prop44 = oArg.s_prop44.toUpperCase(); }
	}
	
	s_prop25 = "GM";
	s_linkName = "";
	s_lnk = false;
	s_linkType = "";
	s_gs(s_account);
}

function clickTrack(oArg,noPageName) {
   if (typeof(oArg.s_lnk) == "boolean") {s_lnk = oArg.s_lnk;} else {s_lnk = false;}
   if (typeof(oArg.s_linkName) == "string") { s_linkName = oArg.s_linkName; }
   if (typeof(oArg.s_linkType) == "string") { s_linkType = oArg.s_linkType; } else { s_linkType="o"; }
   if (typeof(oArg.s_prop5) == "string") { s_prop5 = oArg.s_prop5.toUpperCase(); }
	 if (typeof(oArg.s_prop1) == "string") { s_prop1 = oArg.s_prop1.toUpperCase(); }
	 if (typeof(oArg.s_prop2) == "string") { s_prop2 = oArg.s_prop2.toUpperCase(); }
	 if (typeof(oArg.s_prop3) == "string") { s_prop3 = oArg.s_prop3.toUpperCase(); }
	  if (typeof(oArg.s_prop4) == "string") { s_prop4 = oArg.s_prop4.toUpperCase(); }
	 if (typeof(oArg.s_prop11) == "string") { s_prop11 = oArg.s_prop11.toUpperCase(); }
	 if (typeof(oArg.s_prop12) == "string") { s_prop12 = oArg.s_prop12.toUpperCase(); }
	 if (typeof(oArg.s_prop13) == "string") { s_prop13 = oArg.s_prop13.toUpperCase(); }
	 if (typeof(oArg.s_prop14) == "string") { s_prop14 = oArg.s_prop14.toUpperCase(); }
	 if (typeof(oArg.s_prop15) == "string") { s_prop15 = oArg.s_prop15.toUpperCase(); }
	 if (typeof(oArg.s_prop16) == "string") { s_prop16 = oArg.s_prop16.toUpperCase(); }
	 if (typeof(oArg.s_prop17) == "string") { s_prop17 = oArg.s_prop17.toUpperCase(); }
	if (typeof(oArg.s_prop19) == "string") { s_prop19 = oArg.s_prop19.toUpperCase(); }
	if (typeof(oArg.s_prop25) == "string") { s_prop25 = oArg.s_prop25.toUpperCase(); }
	 if (typeof(oArg.s_prop26) == "string") { s_prop26 = oArg.s_prop26.toUpperCase(); }
	 if (typeof(oArg.s_prop27) == "string") { s_prop27 = oArg.s_prop27.toUpperCase(); }
	 if (typeof(oArg.s_prop28) == "string") { s_prop28 = oArg.s_prop28.toUpperCase(); }
	 if (typeof(oArg.s_prop30) == "string") { s_prop30 = oArg.s_prop30.toUpperCase(); }
	 if (typeof(oArg.s_prop37) == "string") { s_prop37 = oArg.s_prop37.toUpperCase(); }
	 if (typeof(oArg.s_prop38) == "string") { s_prop38 = oArg.s_prop38.toUpperCase(); }
	 if (typeof(oArg.s_prop40) == "string") { s_prop40 = oArg.s_prop40.toUpperCase(); }
	 if (typeof(oArg.s_prop41) == "string") { s_prop41 = oArg.s_prop41.toUpperCase(); }
	 if (typeof(oArg.s_prop42) == "string") { s_prop42 = oArg.s_prop42.toUpperCase(); }
	 if (typeof(oArg.s_prop43) == "string") { s_prop43 = oArg.s_prop43.toUpperCase(); }
	 if (typeof(oArg.s_prop44) == "string") { s_prop44 = oArg.s_prop44.toUpperCase(); }
	 if (typeof(oArg.s_prop46) == "string") { s_prop46 = oArg.s_prop46.toUpperCase(); }
	 if (typeof(oArg.s_prop47) == "string") { s_prop47 = oArg.s_prop47.toUpperCase(); }
	 if (typeof(oArg.s_prop48) == "string") { s_prop48 = oArg.s_prop48.toUpperCase(); }
	 if (typeof(oArg.s_events) == "string") { s_events = oArg.s_events; }
	 if (getESTHour() == 0){
		s_prop26 = "0";
	}else{
		s_prop26 = getESTHour();
	}
	 if (noPageName=="true"){
		s_pageName = "";
	 }
	 else{
		s_pageName = s_linkName;
	 }
	 if (!s_lnk) {
		s_linkType="";
	 }
	 s_gs(s_account);
}


function twiceFunction(var1,var2){
	clickTrack({s_linkName:var2, s_prop1:'', s_prop5:var2, s_prop3:'', s_prop2:''},'true');
	window.location.href = var1;
}

function twiceFunctionWithoutC5(var1,var2){
	clickTrack({s_linkName:var2, s_prop1:'', s_prop5:'', s_prop3:'', s_prop2:''},'true');
	window.location.href = var1;
}


function superPopup(pOptions){

	var url, type, directories, location, menubar, resizable, scrollbars, status, toolbar, top, left, width, height, winName, clickTrackValue;

	// URL is the only required field.
	if (pOptions.url != null) {	url = pOptions.url;} else { alert('Error: Link URL Missing')};

	if (pOptions.type != null) { type = pOptions.type;};

	// type will set some basic options to make the function cleaner -- otherwise all values can be set
	if(type == "_blank"){	//used to generate a window the same size as the previous
		var windowWidth = f_clientWidth();
		var windowHeight = f_clientWidth();

		//used to generate original "window names"
		var randomNumber = Math.floor(Math.random()*1000);
		winName="blank" + randomNumber; width=windowWidth; height=windowHeight; scrollbars="yes"; menubar="yes"; toolbar="yes"; directories="yes"; location="yes"; top="0"; left="0";
	} else if(type == "mapwin"){
		winName="mapwin"; width = "586"; height= "550"; scrollbars = "yes"; resizable = "yes"; toolbar="no"; directories="no"; location="no"; status="no"; menubar="no";
	} else if(type == "KBB"){
		winName="kbbPopup"; width = "780"; height= "500"; scrollbars = "yes"; resizable = "yes"; toolbar="no"; directories="no"; location="no"; status="no"; menubar="no";
    } else if(type == "regionDetails"){
		winName="regionDetails"; width = "750"; height= "650"; scrollbars = "yes"; resizable = "yes"; toolbar="no"; directories="no"; location="no"; status="no"; menubar="no";
    } else if(type == "otherPage"){
		winName="outsidePage"; width = "780"; height= "780"; scrollbars = "yes"; resizable = "yes"; toolbar="yes"; directories="no"; location="yes"; status="yes"; menubar="yes";
    } else if(type == "reqBrochure"){
		winName="reqBrochure"; width = "800"; height= "600"; scrollbars = "no"; resizable = "yes"; toolbar="no"; directories="no"; location="no"; status="no"; menubar="no";
    } else if(type == "bonusCash"){
		winName="bonusCash"; width = "720"; height= "610"; scrollbars = "no"; resizable = "no"; toolbar="no"; directories="no"; location="no"; status="no"; menubar="no";
    } else if(type == "windowSticker"){
		winName="windowSticker"; width = "900"; height= "610"; scrollbars = "no"; resizable = "no"; toolbar="no"; directories="no"; location="no"; status="no"; menubar="no";
    } else if(type == "map"){
		winName="map"; width = "590"; height= "630"; scrollbars = "yes"; resizable = "no"; toolbar="no"; directories="no"; location="no"; status="no"; menubar="no";
    }


	// test to see if we have set a window option on the function or in a profile above, if not then set the value to be a default.
	if (pOptions.directories != null) { directories = pOptions.directories;} else if (directories == null) { directories = "no" ;}
	if (pOptions.location != null) { location = pOptions.location;} else if (location == null) { location = "no" ;}
	if (pOptions.menubar != null) { menubar = pOptions.menubar;} else if (menubar == null) { menubar = "no" ;}
	if (pOptions.resizable != null) { resizable = pOptions.resizable;} else if (resizable == null) { resizable = "no" ;}
	if (pOptions.scrollbars != null) { scrollbars = pOptions.scrollbars;} else if (scrollbars == null) { scrollbars = "yes" ;}
	if (pOptions.status != null) { status = pOptions.status; } else if (status == null) { status = "yes" ;}
	if (pOptions.toolbar != null) { toolbar = pOptions.toolbar; } else if (toolbar == null) { toolbar = "no" ;}
	if (pOptions.top != null) { top = pOptions.top} else if (top == null) { top = "50";}
	if (pOptions.left != null) { left = pOptions.left;} else if (left == null) { left = "50" ;}
	if (pOptions.width != null) { width = pOptions.width;} else if (width == null) { width = "250" ;}
	if (pOptions.height != null) { height = pOptions.height;} else if (height == null) { height = "250" ;}
	if (pOptions.winName != null) { winName = pOptions.winName;} else if (winName == null) { winName = "popUp" ;}
	if (pOptions.clickTrack != null) { clickTrackValue = pOptions.clickTrack;}

	// build our complete window options statement
	windowOptions = "width=" + width + ", height=" + height + ", directories=" + directories + ", location=" + location + ", menubar=" + menubar + ", resizable=" + resizable + ", scrollbars=" + scrollbars + ", toolbar=" + toolbar + ", status=" + status + ", toolbar=" + toolbar + ", top=" + top + ", left=" + left;

	var newWindow = window.open(url,winName,windowOptions);
	//alert(windowOptions);
	if (newWindow == null){
		//alert('A popup containing important information was blocked by your browser. Please enable popups for this site in order to view this information.');
		var errorBox = document.getElementById("blockedPopup");
		errorBox.style.display = "block";


	} else {
		if (window.focus && newWindow) { newWindow.focus() }
	}
}

/**********/
var interstitialPopUp = null;
var exLink = "";
var openNewWin = true;
var ifPopUp = null;
var type = "";

function interstitialExternal(strLink,optOpenWin,popUp,typePop){
	exLink = strLink;
	if(optOpenWin != null){
		openNewWin = optOpenWin;
	}
	if(popUp != null){
		ifPopUp = popUp;
		type = typePop;
	}
	var w = 355, h = 340;
	var popW = 355, popH = 192;
	if (navigator.appName=="Microsoft Internet Explorer"){
		if(navigator.appVersion.indexOf("MSIE 7.0")!=-1){
			var popW = 354, popH = 187;
		}
		 else{
			var popW = 354, popH = 187;
		}
	}
	if (document.all || document.layers) {
		w = screen.availWidth;
	    h = screen.availHeight;
	}
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	interstitialPopUp =  window.open("/include/interstitial_warning/interstitialWarning.htm","","toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+popW+",height="+popH+",top="+topPos+",left="+leftPos);
}

function exitGMCOM(){
	if(ifPopUp != null)
		openWin();
	else
		if(openNewWin)
			window.open(exLink);
		else
			document.location = exLink;
}

function openWin(){
	if(!window.opener || window.opener.closed)
	{
		if (type=="new"){
			var newW;
			newW =	window.open(exLink);
			newW.focus();
		}
		else{
			window.open(exLink);
		}
	}
	else{
		if (type=="new"){
			var newW;
			newW =	window.opener.open(exLink, "blank");
			newW.focus();
		}else{
			window.opener.location.href=exLink;
			window.opener.focus();
		}
	}
}
/*
var interstitialPopUp = null;
var exLink = "";
var openNewWin = true;

function interstitialExternalRecall(strLink,optOpenWin){
	exLink = strLink;
	if(optOpenWin != null){
		openNewWin = optOpenWin;
	}
	var w = 480, h = 340;
	var popW = 320, popH = 300;
	if (document.all || document.layers) {
		w = screen.availWidth;
	    h = screen.availHeight;
	}
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	interstitialPopUp =  window.open("/include/interstitial_warning/interstitialWarningRecall.htm?query=recall","","toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+popW+",height="+popH+",top="+topPos+",left="+leftPos);
}

function exitGMCOM(){
	if(openNewWin)
		window.open(exLink);
	else
		document.location = exLink;
}


var interstitialPopUp = null;
var exLink = "";
var openNewWin = true;

function interstitialExternalWarranty(strLink,optOpenWin){
	exLink = strLink;
	if(optOpenWin != null){
		openNewWin = optOpenWin;
	}
	var w = 480, h = 340;
	var popW = 320, popH = 300;
	if (document.all || document.layers) {
		w = screen.availWidth;
	    h = screen.availHeight;
	}
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	interstitialPopUp =  window.open("/include/interstitial_warning/interstitialWarningWarrantee.htm?query=warrantee","","toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+popW+",height="+popH+",top="+topPos+",left="+leftPos);
}

function exitGMCOM(){
	if(openNewWin)
		window.open(exLink);
	else
		document.location = exLink;
}
*/

function showTab(mdiv)
{
   var e1= document.getElementById(mdiv);
   e1.className= "divOn";
   var e2= "";
   if (mdiv=="houston1")
      e2= document.getElementById("houston2");
   else
      e2= document.getElementById("houston1");
   e2.className= "divOff";
}

function openWindow(url, type){
	if(!window.opener || window.opener.closed)
	{
		if (type=="new"){
			var newW;
			newW =	window.open(url);
			newW.focus();
		}
		else{
			window.open(url);
		}
	}
	else{
		if (type=="new"){
			var newW;
			newW =	window.opener.open(url, "blank");
			newW.focus();
		}else{
			window.opener.location.href=url;
			window.opener.focus();
		}
	}
}

function searchPopup(anchor){
		if (anchor.href.indexOf("/utilities/contact_us/contact.jsp") > -1) {
			anchor.target = "contactus";
			window.open('', 'contactus', 'width=737px,height=600px,scrollbars=yes');
		}
		return true;
}

function setLinkNameFooter(wLink){
	loc = window.location.href;
	var	siteSec = "HOMEPAGE";
	if ((loc.search("/corporate/about/")!= -1)){
		siteSec = "ABOUT GM";
	}else
	if ((loc.search("/corporate/careers/")!= -1)){
		siteSec = "CAREERS";
	}else
	if ((loc.search("/corporate/responsibility/")!= -1)){
		siteSec = "CORPORATE RESPONSIBILITY";
	}else
	if ((loc.search("/vehicles/currentoffers/")!= -1)){
		siteSec = "CURRENT OFFERS";
	}else
	if (loc.search("/vehicles/dealer/")!= -1){
		siteSec = "DEALER LOCATOR";
	}else
	if ((loc.search("/corporate/dealers/")!= -1)){
		siteSec = "DEALERS & SUPPLIERS";
	}else
	if (loc.search("/experience/education/")!= -1){
		siteSec = "EDUCATION";
	}else
	if (loc.search("/vehicles/catalog")!= -1){
		siteSec = "ELECTRONIC VEHICLE CATALOG";
	}else
	if ((loc.search("/corporate/employees/")!= -1)){
		siteSec = "EMPLOYEES & RETIREES";
	}else
	if ((loc.search("/experience/entertainment/")!= -1)){
		siteSec = "ENTERTAINMENT & SPECIAL EVENTS";
	}else
	if ((loc.search("/experience/fuel_economy/")!= -1)){
		siteSec = "FUEL ECONOMY & ALTERNATIVE FUELS";
	}else
	if ((loc.search("/servlets/irf?sc=EC2000307")!= -1) || (loc.search("/vehicles/guides/")!= -1)){
		siteSec = "GUIDES & BROCHURES";
	}else
	if ((loc.search("/corporate/investor_information/")!= -1)){
		siteSec = "INVESTOR INFORMATION";
	}else
	if ((loc.search("/experience/quality/")!= -1)){
		siteSec = "QUALITY";
	}else
	if ((loc.search("/corporate/responsibility/safety")!= -1) || (loc.search("/experience/safety/")!= -1)){
		siteSec = "SAFETY";
	}else
	if ((loc.search("/search/")!= -1)){
		siteSec = "SEARCH RESULTS";
	}else
	if ((loc.search("/vehicles/services/")!= -1)){
		siteSec = "SERVICES";
	}else
	if ((loc.search("/vehicles/parts/")!= -1)){
		siteSec = "SHOP PARTS & ACCESSORIES";
	}else
	if ((loc.search("/experience/technology/")!= -1)){
		siteSec = "TECHNOLOGY";
	}else
	if ((loc.search("/vehicles/tophat.jsp")!= -1)){
		siteSec = "TOPHAT";
	}else
	if ((loc.search("/experience/entertainment/woodward/index.jsp")!= -1)){
		siteSec = "WOODWARD DREAM CRUISE";
	}

	var name = "GM | " + siteSec;
	name = name + " | GLOBAL FOOTER | ";
	name = name + wLink;
	return name;
}

//initialization, browser, os detection
var d, dom, nu='', brow='', ie, ie4, ie5, ie5x, ie6, ie7;
var ns4, moz, moz_rv_sub, release_date='', moz_brow, moz_brow_nu='', moz_brow_nu_sub='', rv_full='';
var mac, win, old, lin, ie5mac, ie5xwin, konq, saf, op, op4, op5, op6, op7;

d=document;
n=navigator;
nav=n.appVersion;
nan=n.appName;
nua=n.userAgent;
old=(nav.substring(0,1)<4);
mac=(nav.indexOf('Mac')!=-1);
win=( ( (nav.indexOf('Win')!=-1) || (nav.indexOf('NT')!=-1) ) && !mac)?true:false;
lin=(nua.indexOf('Linux')!=-1);

if ( !document.layers )
{
	dom = ( d.getElementById ) ? d.getElementById : false;
}
else {
	dom = false;
	ns4 = true;
}

op=(nua.indexOf('Opera')!=-1);
saf=(nua.indexOf('Safari')!=-1);
konq=(!saf && (nua.indexOf('Konqueror')!=-1) ) ? true : false;
moz=( (!saf && !konq ) && ( nua.indexOf('Gecko')!=-1 ) ) ? true : false;
ie=((nua.indexOf('MSIE')!=-1)&&!op);
if (op)
{
	str_pos=nua.indexOf('Opera');
	nu=nua.substr((str_pos+6),4);
	brow = 'Opera';
}
else if (saf)
{
	str_pos=nua.indexOf('Safari');
	nu=nua.substr((str_pos+7),5);
	brow = 'Safari';
}
else if (konq)
{
	str_pos=nua.indexOf('Konqueror');
	nu=nua.substr((str_pos+10),3);
	brow = 'Konqueror';
}

else if (moz)
{
	pattern = /[(); \n]/;
	moz_types = new Array( 'Firebird', 'Phoenix', 'Firefox', 'Iceweasel', 'Galeon', 'K-Meleon', 'Camino', 'Epiphany', 'Netscape6', 'Netscape', 'MultiZilla', 'Gecko Debian', 'rv' );
	rv_pos = nua.indexOf( 'rv' );
	rv_full = nua.substr( rv_pos + 3, 6 );
	rv_slice = ( rv_full.search( pattern ) != -1 ) ? rv_full.search( pattern ) : '';
	( rv_slice ) ? rv_full = rv_full.substr( 0, rv_slice ) : '';
	nu = rv_full.substr( 0, 3 );
	for (i=0; i < moz_types.length; i++)
	{
		if ( nua.indexOf( moz_types[i]) !=-1 )
		{
			moz_brow = moz_types[i];
			break;
		}
	}
	if ( moz_brow )
	{
		str_pos=nua.indexOf(moz_brow);
		moz_brow_nu = nua.substr( (str_pos + moz_brow.length + 1 ) ,3);
		moz_brow_nu = ( isNaN( moz_brow_nu ) ) ? moz_brow_nu = nu: moz_brow_nu;
		moz_brow_nu_sub = nua.substr( (str_pos + moz_brow.length + 1 ), 8);
		sub_nu_slice = ( moz_brow_nu_sub.search( pattern ) != -1 ) ? moz_brow_nu_sub.search( pattern ) : '';
	( sub_nu_slice ) ? moz_brow_nu_sub = moz_brow_nu_sub.substr( 0, sub_nu_slice ) : '';
	}
	if ( moz_brow == 'Netscape6' )
	{
		moz_brow = 'Netscape';
	}
	else if ( moz_brow == 'rv' || moz_brow == '' )
	{
		moz_brow = 'Mozilla';
	}
	if ( !moz_brow_nu )
	{
		moz_brow_nu = nu;
		moz_brow_nu_sub = nu;
	}
	if (n.productSub)
	{
		release_date = n.productSub;
	}
}
else if (ie)
{
	str_pos=nua.indexOf('MSIE');
	nu=nua.substr((str_pos+5),3);
	brow = 'Microsoft Internet Explorer';
}
else
{
	brow = nan;
}
op5=(op&&(nu.substring(0,1)==5));
op6=(op&&(nu.substring(0,1)==6));
op7=(op&&(nu.substring(0,1)==7));
op8=(op&&(nu.substring(0,1)==8));
op9=(op&&(nu.substring(0,1)==9));
ie4=(ie&&!dom);
ie5=(ie&&(nu.substring(0,1)==5));
ie6=(ie&&(nu.substring(0,1)==6));
ie7=(ie&&(nu.substring(0,1)==7));

if(!nu)
{
	nu = nav.substring(0,1);
}
ie5x=(d.all&&dom);
ie5mac=(mac&&ie5);
ie5xwin=(win&&ie5x);

function brows_footer ( ) {
	n = navigator;
	if ( saf ){
		return true;
	}
	else {
		return false;
	}
}


function setDateP(){
	var daysofweek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
	return daysofweek[(new Date()).getDay()].toUpperCase();
}

function compareTracking(url,tracking){
	clickTrack({s_linkName:tracking,s_prop1:'',s_prop2:'',s_prop3:'',s_prop5:tracking},'true');
	window.location.href=url;
}