function openPrint(id)
{
    var element = $(id);
    var html = element.innerHTML;
    var newPosWindow = HCPositionedWin(800,600,"printVersion",html);
    newPosWindow.print();
    newPosWindow.close();
}

AttachEvent(window, "load", function() {
    if(document.getElementById("vZipCode")!=null && document.getElementById("dZipCode")!=null){
		fillZipFields('vZipCode');
	    fillZipFields('dZipCode');
	}
  }
);

function printContent(html)
{

    var winO = "scrollbars=0,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,height=100,width=100,top=0,left=10000";
    var newPosWindow = window.open('', 'printVersion', winO);
    newPosWindow.hide();
    newPosWindow.document.write(html);
    newPosWindow.document.close();
    newPosWindow.print();
    newPosWindow.close();
}

function HCPositionedWin(width,height,name,content)
{
	// DEFAULTS //
	var winW = 800, winH = 600;
	var winO = ',scrollbars=1,toolbar=0,location=0,directories=0,status=0,menubar=1,resizable=0';

	//for vertical positioning detect for IE or NN
	if ((navigator.appName == "Microsoft Internet Explorer"))
	{
		var parOffsetX = 140, parOffsetY = 90;
	}
	else
	{
		var parOffsetX = 140, parOffsetY = 215;
	}

	var debug = 0; // 0 = off, 1 = on

	// PARENT WINDOW INFO //
	//If browser is IE
	if (document.all)
	{
		var x = window.screenLeft;
		var y = window.screenTop;
		var w = window.document.body.offsetWidth;
		var h = window.document.body.offsetHeight;
	}
	else //if browser isn't IE
	{
		var x = window.screenX;
		var y = window.screenY;
		var w = window.outerWidth;
		var h = window.outerHeight;
	}

	// CHILD WINDOW INFO //
	if (width) { winW = width; }
	if (height){ winH = height; }

	// some browsers don't have access to the parent's x and y coordinants
	// so default to centering the child in the center of the screen
	if ((!x && x != 0) || (!y && y != 0))
	{ // if x | y are NaN, default to centering in screen
		if (debug)
		{
			alert("WARNING! defaulting to centering in the screen!");
		}
		var lPos = Math.round((screen.availWidth - winW) / 2);
		var tPos = Math.round((screen.availHeight - winH) / 2);
	}
	else
	{
		// if the child window will be off the screen, attempt to fix x and y so that
		// we don't run off the edge of the screen (I got varying results on this one
		// depending on what options I had turned on for the child)
		x += parOffsetX; y += parOffsetY;
		if ( (x + winW) > screen.availWidth ) { if (debug) { alert("fixing x"); } x = screen.availWidth - winW - 25; }
		if ( (y + winH) > screen.availHeight ) { if (debug) { alert("fixing y"); } y = screen.availHeight - winH - 25; }
		var lPos = x;
		var tPos = y;
	}

	winO = ',width='+winW+',height='+winH+winO;
	// for overriding automatic positioning
	if (winO.indexOf("left=") == -1)
	{
		winO = ',left='+lPos+winO;
	}
	if (winO.indexOf("top=") == -1)
	{
		winO = ',top='+tPos+winO;
	}
	// sorry for the confusion, just trying to make it fool-proof
	// after all is said and done, if our winO starts with a comma, chop it off
	if (winO.indexOf(',') == 0) { winO = winO.substring(1); }

	var winName;
	if (!name)
	{
		var i = getRandom();
		winName = 'popup_'+i;
	}
	else
	{
		winName = name;
	}
	var newPosWindow = window.open('', winName, winO);
	newPosWindow.document.write(content);
	newPosWindow.document.close();
	newPosWindow.focus();
        return newPosWindow;
}

/*
 * Hopefully these helper functions will get implemented by some
 * other library, like prototype.js or something.
 *
 * for now, they're here.
 *
 */

	/*
	 * for users that don't have firefox/firebug, override console object
	 */
	if (!console)
	var console = {log: function(){}, trace: function(){}};



	function AttachEvent( obj, type, fn )
	{
		if (obj.addEventListener)
			obj.addEventListener( type, fn, false );
		else if (obj.attachEvent)
		{
			obj["e"+type+fn] = fn;
			obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
			obj.attachEvent( "on"+type, obj[type+fn] );
		}
	}

	String.prototype.trim = function() {
	    return this.replace( /^\s+|\s+$/, "" );
	}

	function addClassName (elem, className) {
	    removeClassName (elem, className);
	    elem.className = (elem.className + " " + className).trim();
	}

	function hasClassName (elem, className) {
		return (elem.className.indexOf(className) != -1);
	}

	function removeClassName (elem, className) {
	    elem.className = elem.className.replace(className, "").trim();
	}

	/*
		Written by Jonathan Snook, http://www.snook.ca/jonathan
		Add-ons by Robert Nyman, http://www.robertnyman.com
	*/

	function getElementsByClassName(oElm, strTagName, strClassName){
		var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
		var arrReturnElements = new Array();
		strClassName = strClassName.replace(/\-/g, "\\-");
		var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
		var oElement;
		for(var i=0; i<arrElements.length; i++){
			oElement = arrElements[i];
			if(oRegExp.test(oElement.className)){
				arrReturnElements.push(oElement);
			}
		}
		return (arrReturnElements)
	}


//-------------------------------------------------------------------------------------
// PositionedWin - function to open a child popup positioned relative to the parent.
// Child window will either open at a certain (x,y) coordinate below the parent
// OR default to centering within the user's screen
// @author Ean Rollings
// @date March 12, 2002
// @params URL - the only required parameter.
// @params width, height - defaults to 600, 450 respectively
// @params options - list of window options to pass to the window.open function
//                   if you want to override the default positioning, you can pass
//                   left=XXX,top=YYY in the window options parameter.  PLEASE ONLY
//                   OVERRIDE IF COMPLETELY NECESSARY!!
// @params name - default name is 'popup_'+random number.  Can be overridden.

function PositionedWin(url,width,height,options,name) {
  // DEFAULTS //
  var winW = 800, winH = 600;
  var winO = ',scrollbars=1,toolbar=0,location=1,directories=1,status=1,menubar=1,resizable=1';
  if (name == "email")
	  winO = ',scrollbars=1,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=0';
  //for vertical positioning detect for IE or NN
  if ((navigator.appName == "Microsoft Internet Explorer")){
      var parOffsetX = 140, parOffsetY = 90;
  }
  else {
              var parOffsetX = 140, parOffsetY = 215;
  }
  var debug = 0; // 0 = off, 1 = on
  // PARENT WINDOW INFO //
  if (document.all) {
    var x = window.screenLeft;
    var y = window.screenTop;
    var w = window.document.body.offsetWidth;
    var h = window.document.body.offsetHeight;
  } else {
    var x = window.screenX;
    var y = window.screenY;
    var w = window.outerWidth;
    var h = window.outerHeight;
  }
  // CHILD WINDOW INFO //
  if (width) { winW = width; }
  if (height){ winH = height; }
  // some browsers don't have access to the parent's x and y coordinants
  // so default to centering the child in the center of the screen
  if ((!x && x != 0) || (!y && y != 0)) { // if x | y are NaN, default to centering in screen
    if (debug) { alert("WARNING! defaulting to centering in the screen!"); }
            var lPos = Math.round((screen.availWidth - winW) / 2);
            var tPos = Math.round((screen.availHeight - winH) / 2);
  } else {
    // if the child window will be off the screen, attempt to fix x and y so that
    // we don't run off the edge of the screen (I got varying results on this one
    // depending on what options I had turned on for the child)
    x += parOffsetX; y += parOffsetY;
    if ( (x + winW) > screen.availWidth ) { if (debug) { alert("fixing x"); } x = screen.availWidth - winW - 25; }
    if ( (y + winH) > screen.availHeight ) { if (debug) { alert("fixing y"); } y = screen.availHeight - winH - 25; }
            var lPos = x;
            var tPos = y;
  }
  if (options) {
    if (options.indexOf(',') != 0) { options = "," + options; }
    winO = options;
  }
  winO = ',width='+winW+',height='+winH+winO;
  // for overriding automatic positioning
  if (winO.indexOf("left=") == -1) {
    winO = ',left='+lPos+winO;
  }
  if (winO.indexOf("top=") == -1) {
    winO = ',top='+tPos+winO;
  }
  // sorry for the confusion, just trying to make it fool-proof
  // after all is said and done, if our winO starts with a comma, chop it off
  if (winO.indexOf(',') == 0) { winO = winO.substring(1); }
  var winName;
  if (!name) {
    var i = getRandom();
            winName = 'popup_'+i;
  } else {
    winName = name;
  }
  var newPosWindow = window.open(url, winName, winO);
  newPosWindow.focus();
  if ((navigator.appName == "Microsoft Internet Explorer" &&
      parseInt(navigator.appVersion) > 4) || (navigator.appName == "Netscape")){
      newPosWindow.focus();
  }
}
//-- End of PositionedWin function ------------------------------------------------------------------------------


/*function PositionedWinTorrent(linka) {
	alert("Link "+linka);

	window.open(linka,'Safety Torrent','height=750,width=800,scrollbars=1,status=0,menubar=0');

	alert("paso por el window.open");
	return false;


}*/




var ui = function() {
	var private_var;
	function private_method() {
		// do stuff here
	}
	return {
		toggleAboutThisPage : function() {
			var obj = document.getElementById("gm_GfooterAboutWrapper");

			if (obj != null) {
				if (hasClassName(obj, "closed")) {
					removeClassName(obj, "closed");
				} else {
					addClassName(obj, "closed");
				}
			}
		},
		method_2 : function() {
			// do stuff here
		}
	};
}();

/**
 * COMMON DHTML FUNCTIONS
 * These are handy functions I use all the time.
 *
 * By Seth Banks (webmaster at subimage dot com)
 * http://www.subimage.com/
 *
 * Up to date code can be found at http://www.subimage.com/dhtml/
 *
 * This code is free for you to use anywhere, just keep this comment block.
 */

/**
 * X-browser event handler attachment and detachment
 * TH: Switched first true to false per http://www.onlinetools.org/articles/unobtrusivejavascript/chapter4.html
 *
 * @argument obj - the object to attach event to
 * @argument evType - name of the event - DONT ADD "on", pass only "mouseover", etc
 * @argument fn - function to call
 */
function addEvent(obj, evType, fn){
 if (obj.addEventListener){
    obj.addEventListener(evType, fn, false);
    return true;
 } else if (obj.attachEvent){
    var r = obj.attachEvent("on"+evType, fn);
    return r;
 } else {
    return false;
 }
}
function removeEvent(obj, evType, fn, useCapture){
  if (obj.removeEventListener){
    obj.removeEventListener(evType, fn, useCapture);
    return true;
  } else if (obj.detachEvent){
    var r = obj.detachEvent("on"+evType, fn);
    return r;
  } else {
    alert("Handler could not be removed");
  }
}

/**
 * Code below taken from - http://www.evolt.org/article/document_body_doctype_switching_and_more/17/30655/
 *
 * Modified 4/22/04 to work with Opera/Moz (by webmaster at subimage dot com)
 *
 * Gets the full width/height because it's different for most browsers.
 */
function getViewportHeight() {
	if (window.innerHeight!=window.undefined) return window.innerHeight;
	if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight;
	if (document.body) return document.body.clientHeight;

	return window.undefined;
}
function getViewportWidth() {
	var offset = 17;
	var width = null;
	if (window.innerWidth!=window.undefined) return window.innerWidth;
	if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth;
	if (document.body) return document.body.clientWidth;
}

/**
 * Gets the real scroll top
 */
function getScrollTop() {
	if (self.pageYOffset) // all except Explorer
	{
		return self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)
		// Explorer 6 Strict
	{
		return document.documentElement.scrollTop;
	}
	else if (document.body) // all other Explorers
	{
		return document.body.scrollTop;
	}
}
function getScrollLeft() {
	if (self.pageXOffset) // all except Explorer
	{
		return self.pageXOffset;
	}
	else if (document.documentElement && document.documentElement.scrollLeft)
		// Explorer 6 Strict
	{
		return document.documentElement.scrollLeft;
	}
	else if (document.body) // all other Explorers
	{
		return document.body.scrollLeft;
	}
}


function checkZipCode(zip, showCounty) {
	var zipValue = document.getElementById(zip).value;
	if(zipValue == "") {
		alert('Please insert a zip code.');
		if (showCounty!=""){ HideContent(showCounty);}
		return false;
	} else if( (zipValue).search(/^\d{5}$/) == -1) {
		if (showCounty!=""){HideContent(showCounty);}
		alert('Please insert a valid zip code.');
		return false;
	}
	if (showCounty!=""){
	 ShowContent(showCounty);
	}
    return true;

}

function HideContent(idCounty) {
	document.getElementById(idCounty).style.visibility="hidden";
}
function ShowContent(idCounty) {
	document.getElementById(idCounty).style.visibility="visible";
}


function isNumberKey(evt)
{
   var charCode = (evt.which) ? evt.which : evt.keyCode
   if (charCode > 31 && (charCode < 48 || charCode > 57))
      return false;

   return true;
}

function isDecimalNumberKey(evt)
{
   var charCode = (evt.which) ? evt.which : evt.keyCode
   if (charCode > 31 && (charCode < 48 || charCode > 57)){
   		if (navigator.appName != 'Microsoft Internet Explorer'){
   			if (charCode == 46 && evt.target.value.search(/\./) == -1){
   				return true;
   			} else {
   				return false;
   			}
   		} else if(charCode == 46 && evt.srcElement.value.search(/\./) == -1){
   				return true;
   		} else {
   			return false;
   		}
   }
   return true;
}

function characterCount(field, evt, maxChars){
	var charCode = evt.keyCode;
	characters=field.value;
	if ((characters.length>maxChars-1) && charCode != 8 && charCode != 46){
		alert("More than " + maxChars + " characters");
		return false;
	return true;
	}
}

function wordCount(field, evt, maxWords){
	var charCode = evt.keyCode;
	words=field.value.split(" ");
	if ((words.length>maxWords) && charCode != 8 && charCode != 46){
		alert("More than " + maxWords + " words");
		return false;
	return true;
	}
}

function isValidEmail(emailFieldId)
{
	var regExEmail = new RegExp("^[^ @,]+@[a-zA-Z0-9]+([\\-a-zA-Z0-9]*[a-zA-Z0-9]+)*(\\.[a-zA-Z0-9]+([\\-a-zA-Z0-9]*[a-zA-Z0-9]+)*)*\\.[a-zA-Z]{2,}$");

	var email = document.getElementById(emailFieldId).value;
	if (email==""){
		alert("Email Is Required");
		return false;
	} else	{
		email = rtrim(email);
		if (email.length == 0 ) return true;
	   	if (email.match(regExEmail)){return true;}
		else {
	      	alert("Invalid E-mail Address");
		    return false;
		 }
	}
	return true;
}

function showZipInput(){
	document.getElementById('zipCodeDiv').style.display = 'block';
	var body =document.getElementById('body');
	body.onclick = hideZipInput('zipCodeDiv');
}
function showBYOZipInput(buildURL, zipCode){
	var myId = getIdentity();
	if(null!=myId){
		window.location.href=buildURL;
	}
	else{
		document.getElementById(zipCode).style.display = 'block';
	}
}

function hideZipInput(zipCode){
	document.getElementById(zipCode).style.display = 'none';
}
function rtrim(s) {
   return s.replace(/\s+$/, "");
}

function downloadPDF(src){
			PositionedWin(document.getElementById(src).value,'1024','768','scrollbars=0,status=0,menubar=0,resizable=0','Interstitial');
			//alert (document.getElementById(src).value);
}

/*vibe year change subheader*/
var changeYearFlag = 0;
function showChangeYear(){
	if(changeYearFlag == 0) {
		document.getElementById('changeYear').style.display = 'block';
		changeYearFlag = 1;
	}else{
		document.getElementById('changeYear').style.display = 'none';
		changeYearFlag = 0;
	}
}

//---------------- TOOLTIPS & WINDOWS --------------------------
// Version 1.01 //
function DL_GetElementLeft(eElement){
    var nLeftPos = eElement.offsetLeft;
    var eParElement = eElement.offsetParent;
    while (eParElement != null)
    {
        nLeftPos += eParElement.offsetLeft;
        eParElement = eParElement.offsetParent;
    }
    return nLeftPos;
}
function DL_GetElementTop(eElement){
    var nTopPos = eElement.offsetTop;
    var eParElement = eElement.offsetParent;
    while (eParElement != null) {
        nTopPos += eParElement.offsetTop;
        eParElement = eParElement.offsetParent;
    }
    return nTopPos;
}

function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;} function pageHeight() {return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;} function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;} function posTop() {return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;} function posRight() {return posLeft()+pageWidth();} function posBottom() {return posTop()+pageHeight();}

function showTip(src, inHtml) {
        inHtml = '<a id="btnClose" href="javascript:void(0);" onclick="closeTip()"><span>CLOSE</span></a>'+inHtml;
	if (document.getElementById('toolTip')!=null){
		var toolTip = document.getElementById('toolTip');
		document.body.removeChild(toolTip);
	}
	var toolTipElm = document.createElement('div');
	toolTipElm.setAttribute('id','toolTip');
	toolTipElm.innerHTML = inHtml;
	document.body.appendChild(toolTipElm);
        var xPos = DL_GetElementLeft(src);
        if (xPos>700) {
          document.getElementById("toolTip").style.left=DL_GetElementLeft(src)-232+(src.offsetWidth/2)+"px";
        } else {
          document.getElementById("toolTip").style.left=DL_GetElementLeft(src)+(src.offsetWidth/2)+"px";
        }
        document.getElementById("toolTip").style.top=DL_GetElementTop(src)+"px";
	return true;
}
function closeTip() {
	var toolTipElm = document.getElementById('toolTip');
	document.body.removeChild(toolTipElm);
	return false;
}
function showZipDialog(src, targetPath){
  var myId = getIdentity();
  if(null!=myId){
      window.location.href=targetPath;
      return true;
  } else {
        inHtml='<a id="btnClose" href="javascript:void(0);" onclick="closeElement(\'zipDialog\');"><span>CLOSE</span></a>';
        inHtml+='<p>In order to provide you with the most relevant information, please enter your ZIP Code.</p>';
        inHtml+='<span><input value="Enter ZIP" onclick="this.value=\'\'" onkeypress="return inputZip(this, event);" type="text" id="zipBYOCode">';
        inHtml+='<a href="#" id="btnZipGo" class="btnZipGo_off" onmouseover="Over(this);" onmouseout="Out(this);" onclick="openBYO(\''+targetPath+'\'); return false;"></a><span>';
	if (document.getElementById('zipDialog')!=null){
		var toolTip = document.getElementById('zipDialog');
		document.body.removeChild(toolTip);
	}
	var toolTipElm = document.createElement('div');
	toolTipElm.setAttribute('id','zipDialog');
	toolTipElm.innerHTML = inHtml;
	document.body.appendChild(toolTipElm);
        var xPos = DL_GetElementLeft(src);
        document.getElementById("zipDialog").style.left=DL_GetElementLeft(src)+"px";
        document.getElementById("zipDialog").style.top=DL_GetElementTop(src)+"px";
	return true;
  }
}
function closeElement(id){
      	var Elmt = document.getElementById(id);
	document.body.removeChild(Elmt);
	return false;
}
function openBYO(targetPath) {
    zipValue = document.getElementById('zipBYOCode').value;
    if ( (zipValue=='') || (zipValue=='Enter ZIP') ) {
            alert('Please enter a valid Zip Code');
            document.getElementById('zipBYOCode').value='';
            document.getElementById('zipBYOCode').focus();
            return false;
    }
    if (zipValue.length!=5) {
        alert('The Zip Code must have 5 digits');
        document.getElementById('zipBYOCode').focus();
        return false;
    }
    saveIdentity(zipValue);
    window.location.href=targetPath;
}
//----------------------------------------------------------------------

function fillZipFields(zipField){
  var myId = getIdentity();
  if((null!=myId)&& (document.getElementById(zipField)!=null)){
	  	document.getElementById(zipField).value = myId.zip;
  }
  return true;
}

function returnZipCode(){
  var myId = getIdentity();
  if(null!=myId){
	return myId;
  }
  myId="";
  return myId;
}



//Get the name reference of the current Model depends of URL.
//Exepction return "unknow" if the current page is not a Model reference. Eg. ShowHelpCenter.do
function getModelReference(){
	var model="unknow";
	var url=location.href.toLowerCase();
	if(url.indexOf("g6sedan")!=-1){model="g6sedan";}
	if(url.indexOf("g6coupe")!=-1){model="g6coupe";}
	if(url.indexOf("g6convertible")!=-1){model="g6convertible";}
	if(url.indexOf("g5")!=-1){model="g5";}
	if(url.indexOf("solstice")!=-1){model="solstice";}
	if(url.indexOf("grandprix")!=-1){model="grandprix";}
	if(url.indexOf("vibe")!=-1){model="vibe";}
	if(url.indexOf("torrent")!=-1){model="torrent";}
	if(url.indexOf("g8")!=-1){model="g8";}
	return (model);
}

var spotlightNormal = new Array();

spotlightNormal["/tools/byo/summary"] = "src=1139844;type=ebyoi820;cat=byosu763";

function spotlight(uri) {

	console.log(uri);

	if (spotlightNormal[uri] != null) {
		writeSpotlight(spotlightNormal["/tools/byo/summary"]);
	}


}

function writeSpotlight(values) {
	var axel = Math.random()+"";
	var a = axel * 10000000000000;
	//var url = "http://fls.doubleclick.net/activityi;"+ values +";ord="+ a + '?';
	var url = "http://ad.doubleclick.net/activity;"+ values +";ord="+ a + '?'; //(PONTMAN-102)

	var img = document.createElement('img');
	img.setAttribute('src', url);
	img.setAttribute('width', "1");
	img.setAttribute('height', "1");
	img.setAttribute('border', "0");

	document.getElementById("gCopyright").appendChild(img);
	//console.log(values);
	//document.write('<IMG SRC="http://ad.doubleclick.net/activity;'+ values +';ord=1;num='+ a + '?" WIDTH=1 HEIGHT=1 BORDER=0>');
}


function getCookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );


		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}
function getRangDisplayValue(range){
	var va="";
	if(range == "300"){
		va ="within 150+ miles";
	}else
	if(range == "50"){
		va = "within within 50 miles";
	}else
	if(range == "25"){
		va = "within 25 miles";
	}else
	if(range == "5"){
		va = "within 5 miles";
	}
	return va;
}
function getRangSelected(cur,range){
	if(cur == rang){
		return "selected='selected'";
	}
	return null;
}
function showChangeCriteriaDL(src,type,zipCodeRange,cityRange,dealerName,cityCityName,cityState,vendorCityName,vendorState){

	var inHtml="";
	//search by zip code
	if(type == "ByPostalCode"){
		var cookieValue = getCookie("zipCode");
		var showValue = "Enter Zip Code";
		if(cookieValue != null){
			showValue = cookieValue;
		}

		inHtml+='<form name="dealerLocatorSearchActionForm" method="get" action="' + BASE_CONTEXT +  '/dealerLocatorSearch.do">';
		inHtml+='<input type="hidden" id="searchType" name="searchType" value="ByPostalCode"/>'
		inHtml+='<input type="hidden" id="desiredCount" name="desiredCount" value="25"/>'
	    inHtml+='<a id="btnClose" href="javascript:void(0);" onclick="closeElement(\'locateDialog\');"><span>CLOSE</span></a>';
		inHtml+='<p>Modify Your Search Criteria</p>';
		inHtml+='<span>Zip Code</span><input size="20" id="zipLocatorCode" onclick="this.value=\'\';" name="searchByPostalCodePostalCode" value=\"'+showValue+'\" class="fieldStyle" onkeypress="return inputZip(this, event);" type="text">';
		inHtml+='<span class="rangeClass">Range</span><div id="rangeSelect"><div style="z-index: 100; width: 122px;" class="graphicList">';
		inHtml+='<span><span onclick="toggleList(this)" onselectstart="return false;" style="-moz-user-select: none;">within 25 miles</span><a href="javascript:void(0);" onclick="toggleList(this)" class="btnArrow"></a></span>';
		inHtml+='<dl style="display: none;" id="PostalCodeProximity-UL">';
		inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">within 150+ miles</a></dt>';
		inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">within 50 miles</a></dt>';
		inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">within 25 miles</a></dt>';
		inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)" class="lastOption">within 5 miles</a></dt>';
		inHtml+='</dl>';
		inHtml+='</div><select style="display: none;" id="PostalCodeProximity" name="SearchByPostalCodeProximity">';
		inHtml+='<option value="300" >within 150+ miles</option>';
		inHtml+='<option value="50" >within 50 miles</option>';
		inHtml+='<option value="25" selected>within 25 miles</option>';
		inHtml+='<option value="5">within 5 miles</option>';
		inHtml+='</select></div>';
		inHtml+='<input onclick="return openLocator(this.form);" class="dlsubmitbutton" type="image" src="' + EN_IMAGE_PATH + '/gNav/bnt_update_results_off.gif" onmouseover="OverButton(this);" onmouseout="OutButton(this);"/>';
	    inHtml+='<a id="advancedSearch" href="' + BASE_CONTEXT + '/search-dealers/");">Advanced Search</a>';
	    inHtml+='</form>';

    }else{
	    //search by ByCityState
	    inHtml="";
	    if(type == "ByCityState"){
			inHtml+='<form name="dealerLocatorSearchActionForm" method="get" action="' + BASE_CONTEXT +  '/dealerLocatorSearch.do">';
			inHtml+='<input type="hidden" id="searchType" name="searchType" value="ByCityState"/>'
			inHtml+='<input type="hidden" id="desiredCount" name="desiredCount" value="25"/>'
		    inHtml+='<a id="btnClose" href="javascript:void(0);" onclick="closeElement(\'locateDialog\');"><span>CLOSE</span></a>';
			inHtml+='<p>Modify Your Search Criteria</p>';
			inHtml+='<span>City Name</span><input size="20" id="cityStateCityName" onclick="this.value=\'\';" name="searchByCityStateCityName" value=\"'+cityCityName+'\" class="fieldStyle" type="text">';
			inHtml+='<span class="rangeClass">State</span><div id="rangeSelect"><div style="z-index: 100; width: 122px;" class="graphicList">';
			inHtml+='<span><span onclick="toggleList(this)" onselectstart="return false;" style="-moz-user-select: none;">Michigan</span><a href="javascript:void(0);" onclick="toggleList(this)" class="btnArrow"></a></span>';
			inHtml+='<dl style="display: none;" id="CityStateStateName-UL">';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Alabama</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Alaska</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Arizona</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Arkansas</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">California</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Colorado</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Connecticut</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Delaware</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">District of Columbia</a></dt>';			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Florida</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Georgia</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Hawaii</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Idaho</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Illinois</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Indiana</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Iowa</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Kansas</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Kentucky</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Louisiana</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Maine</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Maryland</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Massachusetts</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Michigan</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Minnesota</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Mississippi</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Missouri</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Montana</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Nebraska</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Nevada</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">New Hampshire</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">New Jersey</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">New Mexico</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">New York</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">North Carolina</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">North Dakota</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Ohio</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Oklahoma</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Oregon</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Pennsylvania</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Rhode Island</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">South Carolina</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">South Dakota</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Tennessee</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Texas</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Utah</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Vermont</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Virginia</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Washington</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">West Virginia</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Wisconsin</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)" class="lastOption">Wyoming</a></dt>';
			inHtml+='</dl>';
			inHtml+='</div><select style="display: none;" id="CityStateStateName" name="searchByCityStateStateName">';
			inHtml+='<option value="AL">Alabama</option>';
			inHtml+='<option value="AK">Alaska</option>';
			inHtml+='<option value="AZ">Arizona</option>';
			inHtml+='<option value="AR">Arkansas</option>';
			inHtml+='<option value="CA">California</option>';
			inHtml+='<option value="CO">Colorado</option>';
			inHtml+='<option value="CT">Connecticut</option>';
			inHtml+='<option value="DE">Delaware</option>';
			inHtml+='<option value="DC">District of Columbia</option>';
			inHtml+='<option value="FL">Florida</option>';
			inHtml+='<option value="GA">Georgia</option>';
			inHtml+='<option value="HI">Hawaii</option>';
			inHtml+='<option value="ID">Idaho</option>';
			inHtml+='<option value="IL">Illinois</option>';
			inHtml+='<option value="IN">Indiana</option>';
			inHtml+='<option value="IA">Iowa</option>';
			inHtml+='<option value="KS">Kansas</option>';
			inHtml+='<option value="KY">Kentucky</option>';
			inHtml+='<option value="LA">Louisiana</option>';
			inHtml+='<option value="ME">Maine</option>';
			inHtml+='<option value="MD">Maryland</option>';
			inHtml+='<option value="MA">Massachusetts</option>';
			inHtml+='<option value="MI">Michigan</option>';
			inHtml+='<option value="MN">Minnesota</option>';
			inHtml+='<option value="MS">Mississippi</option>';
			inHtml+='<option value="MO">Missouri</option>';
			inHtml+='<option value="MT">Montana</option>';
			inHtml+='<option value="NE">Nebraska</option>';
			inHtml+='<option value="NV">Nevada</option>';
			inHtml+='<option value="NH">New Hampshire</option>';
			inHtml+='<option value="NJ">New Jersey</option>';
			inHtml+='<option value="NM">New Mexico</option>';
			inHtml+='<option value="NY">New York</option>';
			inHtml+='<option value="NC">North Carolina</option>';
			inHtml+='<option value="ND">North Dakota</option>';
			inHtml+='<option value="OH">Ohio</option>';
			inHtml+='<option value="OK">Oklahoma</option>';
			inHtml+='<option value="OR">Oregon</option>';
			inHtml+='<option value="PA">Pennsylvania</option>';
			inHtml+='<option value="RI">Rhode Island</option>';
			inHtml+='<option value="SC">South Carolina</option>';
			inHtml+='<option value="SD">South Dakota</option>';
			inHtml+='<option value="TN">Tennessee</option>';
			inHtml+='<option value="TX">Texas</option>';
			inHtml+='<option value="UT">Utah</option>';
			inHtml+='<option value="VT">Vermont</option>';
			inHtml+='<option value="VA">Virginia</option>';
			inHtml+='<option value="WA">Washington</option>';
			inHtml+='<option value="WV">West Virginia</option>';
			inHtml+='<option value="WI">Wisconsin</option>';
			inHtml+='<option value="WY">Wyoming</option>';
			inHtml+='</select></div>';
			inHtml+='<span class="rangeClass">Range</span><div id="rangeSelect"><div style="z-index: 100; width: 122px;" class="graphicList">';
			inHtml+='<span><span onclick="toggleList(this)" onselectstart="return false;" style="-moz-user-select: none;">within 25 miles</span><a href="javascript:void(0);" onclick="toggleList(this)" class="btnArrow"></a></span>';
			inHtml+='<dl style="display: none;" id="PostalCodeProximity-UL">';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">within 150+ miles</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">within 50 miles</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">within 25 miles</a></dt>';
			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)" class="lastOption">within 5 miles</a></dt>';
			inHtml+='</dl>';
			inHtml+='</div><select style="display: none;" id="PostalCodeProximity" name="SearchByCityStateProximity">';
			inHtml+='<option value="300">within 150+ miles</option>';
			inHtml+='<option value="50">within 50 miles</option>';
			inHtml+='<option value="25">within 25 miles</option>';
			inHtml+='<option value="5">within 5 miles</option>';
			inHtml+='</select></div>';
			inHtml+='<input onclick="return openLocator(this.form);" class="dlsubmitbutton" type="image" src="' + EN_IMAGE_PATH + '/gNav/bnt_update_results.gif"/>';
			inHtml+='<br/><br/><br/>';
		    inHtml+='<a id="advancedSearch1" href="' + BASE_CONTEXT + '/search-dealers/");">Advanced Search</a>';
		    inHtml+='</form>';
	    }else{
	    	inHtml="";
		    if(type == "ByVendor"){
				inHtml+='<form name="dealerLocatorSearchActionForm" method="get" action="' + BASE_CONTEXT +  '/dealerLocatorSearch.do">';
				inHtml+='<input type="hidden" id="searchType" name="searchType" value="ByCityState"/>'
				inHtml+='<input type="hidden" id="desiredCount" name="desiredCount" value="25"/>'
			    inHtml+='<a id="btnClose" href="javascript:void(0);" onclick="closeElement(\'locateDialog\');"><span>CLOSE</span></a>';
				inHtml+='<p>Modify Your Search Criteria</p>';
				inHtml+='<span>City Name</span><input size="20" id="VendorVendorName" onclick="this.value=\'\';" name="searchByVendorVendorName" value=\"'+dealerName+'\" class="fieldStyle" type="text">';
				inHtml+='<span>City Name</span><input size="20" id="cityStateCityName" onclick="this.value=\'\';" name="searchByCityStateCityName" value=\"'+vendorCityName+'\" class="fieldStyle" type="text">';
				inHtml+='<span class="rangeClass">State</span><div id="rangeSelect"><div style="z-index: 100; width: 122px;" class="graphicList">';
				inHtml+='<span><span onclick="toggleList(this)" onselectstart="return false;" style="-moz-user-select: none;">Michigan</span><a href="javascript:void(0);" onclick="toggleList(this)" class="btnArrow"></a></span>';
				inHtml+='<dl style="display: none;" id="CityStateStateName-UL">';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Alabama</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Alaska</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Arizona</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Arkansas</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">California</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Colorado</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Connecticut</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Delaware</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">District of Columbia</a></dt>';			inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Florida</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Georgia</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Hawaii</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Idaho</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Illinois</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Indiana</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Iowa</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Kansas</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Kentucky</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Louisiana</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Maine</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Maryland</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Massachusetts</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Michigan</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Minnesota</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Mississippi</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Missouri</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Montana</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Nebraska</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Nevada</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">New Hampshire</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">New Jersey</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">New Mexico</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">New York</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">North Carolina</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">North Dakota</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Ohio</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Oklahoma</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Oregon</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Pennsylvania</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Rhode Island</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">South Carolina</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">South Dakota</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Tennessee</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Texas</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Utah</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Vermont</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Virginia</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Washington</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">West Virginia</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">Wisconsin</a></dt>';
				inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)" class="lastOption">Wyoming</a></dt>';
				inHtml+='</dl>';
				inHtml+='</div><select style="display: none;" id="VendorStateName" name="searchByVendorStateName">';
				inHtml+='<option value="AL">Alabama</option>';
				inHtml+='<option value="AK">Alaska</option>';
				inHtml+='<option value="AZ">Arizona</option>';
				inHtml+='<option value="AR">Arkansas</option>';
				inHtml+='<option value="CA">California</option>';
				inHtml+='<option value="CO">Colorado</option>';
				inHtml+='<option value="CT">Connecticut</option>';
				inHtml+='<option value="DE">Delaware</option>';
				inHtml+='<option value="DC">District of Columbia</option>';
				inHtml+='<option value="FL">Florida</option>';
				inHtml+='<option value="GA">Georgia</option>';
				inHtml+='<option value="HI">Hawaii</option>';
				inHtml+='<option value="ID">Idaho</option>';
				inHtml+='<option value="IL">Illinois</option>';
				inHtml+='<option value="IN">Indiana</option>';
				inHtml+='<option value="IA">Iowa</option>';
				inHtml+='<option value="KS">Kansas</option>';
				inHtml+='<option value="KY">Kentucky</option>';
				inHtml+='<option value="LA">Louisiana</option>';
				inHtml+='<option value="ME">Maine</option>';
				inHtml+='<option value="MD">Maryland</option>';
				inHtml+='<option value="MA">Massachusetts</option>';
				inHtml+='<option value="MI">Michigan</option>';
				inHtml+='<option value="MN">Minnesota</option>';
				inHtml+='<option value="MS">Mississippi</option>';
				inHtml+='<option value="MO">Missouri</option>';
				inHtml+='<option value="MT">Montana</option>';
				inHtml+='<option value="NE">Nebraska</option>';
				inHtml+='<option value="NV">Nevada</option>';
				inHtml+='<option value="NH">New Hampshire</option>';
				inHtml+='<option value="NJ">New Jersey</option>';
				inHtml+='<option value="NM">New Mexico</option>';
				inHtml+='<option value="NY">New York</option>';
				inHtml+='<option value="NC">North Carolina</option>';
				inHtml+='<option value="ND">North Dakota</option>';
				inHtml+='<option value="OH">Ohio</option>';
				inHtml+='<option value="OK">Oklahoma</option>';
				inHtml+='<option value="OR">Oregon</option>';
				inHtml+='<option value="PA">Pennsylvania</option>';
				inHtml+='<option value="RI">Rhode Island</option>';
				inHtml+='<option value="SC">South Carolina</option>';
				inHtml+='<option value="SD">South Dakota</option>';
				inHtml+='<option value="TN">Tennessee</option>';
				inHtml+='<option value="TX">Texas</option>';
				inHtml+='<option value="UT">Utah</option>';
				inHtml+='<option value="VT">Vermont</option>';
				inHtml+='<option value="VA">Virginia</option>';
				inHtml+='<option value="WA">Washington</option>';
				inHtml+='<option value="WV">West Virginia</option>';
				inHtml+='<option value="WI">Wisconsin</option>';
				inHtml+='<option value="WY">Wyoming</option>';
				inHtml+='</select></div>';
				inHtml+='<input onclick="return openLocator(this.form);" class="dlsubmitbutton" type="image" src="' + EN_IMAGE_PATH + '/gNav/bnt_update_results.gif"/>';
				inHtml+='<br/><br/><br/>';
			    inHtml+='<a id="advancedSearch1" href="' + BASE_CONTEXT + '/search-dealers/");">Advanced Search</a>';
			    inHtml+='</form>';
		    }
	    }
    }
	if (document.getElementById('locateDialog')!=null){
		var toolTip = document.getElementById('locateDialog');
		document.body.removeChild(toolTip);
	}
	var toolTipElm = document.createElement('div');
	toolTipElm.setAttribute('id','locateDialog');
	toolTipElm.innerHTML = inHtml;
	document.body.appendChild(toolTipElm);
        var xPos = DL_GetElementLeft(src);
        document.getElementById("locateDialog").style.left=DL_GetElementLeft(src)+"px";
        document.getElementById("locateDialog").style.top=DL_GetElementTop(src)+"px";
	return true;
}

function showChangeCriteriaVL(src){
	var inHtml="";
	inHtml+='<form name="locateVehicleForm" method="GET" action="' + BASE_CONTEXT +  '/locateVehicle.do">';
    inHtml+='<a id="btnClose" href="javascript:void(0);" onclick="closeElement(\'locateDialog\');"><span>CLOSE</span></a>';
	inHtml+='<p>Modify Your Search Criteria</p>';
	inHtml+='<span>Zip Code</span><input size="20" id="zipLocatorCode" onclick="this.value=\'\';" name="searchByPostalCodePostalCode" value="Enter Zip Code" class="fieldStyle" onkeypress="return inputZip(this, event);" type="text">';
	inHtml+='<span class="rangeClass">Range</span><div id="rangeSelect"><div style="z-index: 100; width: 122px;" class="graphicList">';
	inHtml+='<span><span onclick="toggleList(this)" onselectstart="return false;" style="-moz-user-select: none;">within 25 miles</span><a href="javascript:void(0);" onclick="toggleList(this)" class="btnArrow"></a></span>';
	inHtml+='<dl style="display: none;" id="PostalCodeProximity-UL">';
	inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">within 150+ miles</a></dt>';
	inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">within 50 miles</a></dt>';
	inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)">within 25 miles</a></dt>';
	inHtml+='<dt style="width: 122px; display: block;"><a href="javascript:void(0);" onclick="listSelect(this)" class="lastOption">within 5 miles</a></dt>';
	inHtml+='</dl>';
	inHtml+='</div><select style="display: none;" id="PostalCodeProximity" name="searchByPostalCodeProximity">';
	inHtml+='<option value="300">within 150+ miles</option>';
	inHtml+='<option value="50">within 50 miles</option>';
	inHtml+='<option value="25" selected="selected">within 25 miles</option>';
	inHtml+='<option value="5">within 5 miles</option>';
	inHtml+='</select></div>';
	inHtml+='<input onclick="return openLocator(this.form);" class="dlsubmitbutton" type="image" src="' + EN_IMAGE_PATH + '/gNav/bnt_update_results.gif"/>';
    inHtml+='<a id="advancedSearch" href="' + BASE_CONTEXT + '/locate-vehicle/");">Advanced Search</a>';
    inHtml+='</form>';
	if (document.getElementById('locateDialog')!=null){
		var toolTip = document.getElementById('locateDialog');
		document.body.removeChild(toolTip);
	}
	var toolTipElm = document.createElement('div');
	toolTipElm.setAttribute('id','locateDialog');
	toolTipElm.innerHTML = inHtml;
	document.body.appendChild(toolTipElm);
        var xPos = DL_GetElementLeft(src);
        document.getElementById("locateDialog").style.left=DL_GetElementLeft(src)+"px";
        document.getElementById("locateDialog").style.top=DL_GetElementTop(src)+"px";
	return true;
}

function openLocator(form) {
    zipValue = document.getElementById('zipLocatorCode').value;
    if ( (zipValue=='') || (zipValue=='Enter Zip Code') ) {
            alert('Please enter a valid Zip Code');
            document.getElementById('zipLocatorCode').value='';
            document.getElementById('zipLocatorCode').focus();
            return false;
    }
    if (zipValue.length!=5) {
        alert('The Zip Code must have 5 digits');
        document.getElementById('zipLocatorCode').focus();
        return false;
    }else{
	    form.submit();
	    return true;
    }
}
/*Over Blue Boder Functions*/
function OverButton(obj){
	if  (obj.src!=null){
		var newSRC = obj.src.replace('_off.','_on.');
		obj.src = newSRC;
	}
	//Ie6 png filter fix
	else{
		var newFilter = obj.style.filter.replace('_off.','_on.');
		obj.style.filter = newFilter
	}

	 //progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://localhost:8080/myr/content/en/images/vehicles/g5/modelOverview/tiles/G5_highlight_3_09_off.png', sizingMethod='scale')
}

function OutButton(obj){
	if  (obj.src!=null){
		var newSRC = obj.src.replace('_on.','_off.');
		obj.src = newSRC;
	}
	//Ie6 png filter fix
	else{
		var newFilter = obj.style.filter.replace('_on.','_off.');
		obj.style.filter = newFilter
	}
}
function Over(obj){
	if (obj!=null){
		var newClass = obj.className.replace('_off','_on');
		obj.className = newClass;
	}
}

function Out(obj){
	if (obj!=null){
		var newClass = obj.className.replace('_on','_off');
		obj.className = newClass;
	}
}
function OverButtonMySafeInfo(obj){
	if (obj!=null){
		if (obj.src.indexOf('_off.')!=-1){
			var newSRC = obj.src.replace('_off.','_on.');
			obj.src = newSRC;
		}
	}
}

function OutButtonMySafeInfo(obj){
	if (obj!=null){
		if (obj.src.indexOf('_on.')!=-1){
			var newSRC = obj.src.replace('_on.','_off.');
			obj.src = newSRC;
		}
	}
}
/*END Over Blue Boder Functions*/


/*How to obtain parameters using JS...*/
function returnParameter(name){
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regExS = "[\\?&]" + name + "=([^&#]*)";
  var regEx = new RegExp(regExS);
  var results = regEx.exec(window.location.href);
  if(results == null)
    return "";
  else
    return results[1];
}