//function used to display a interactive map.
//includes the pan bars, zoom levels, and radio buttons.
//used with locmap and search.
//map - the map object to display
//identify - true - display identifyIcon functionality false - zoom and recenter is displayed
function mq_display_interactive_map(UId,parentId,map,identify) {
   if(!mq_ParamExists(map))
   return;
   // map size math
   // map wrap size
   // wrap_map = map width + east/west bars
   var wrap_map = parseInt(map.width) + 22;
   // wrap_size = wrap_map + zoom bar size
   var wrap_size = wrap_map + 70;
   // do math to size spacer images properly
   //  spacer_ns = (total map width - n/s marker)/ each side
   var spacer_ns = (map.width - 98)/2;
   //  spacer_ew = (total map height - e/w marker)/ each side
   var spacer_ew = (map.height - 98)/2;
   // preload images
   //mq_image_preload_interactive_map();
   /*
   ---------------------
   BEGIN INTERACTIVE MAP
   ---------------------

   */

   // TO GET WIDGET ADJUSTABLE.


   var height = map.height;
   var width = map.width;
   var minWidth = "463";
   var maxWidth = "1400";
   var paddingWidth = "12";
   var optionsWidth = "41";
   var sideWidth = "28";
   var gapWidth = "5";
   var widgetMinWidth = minWidth + optionsWidth + paddingWidth+ sideWidth + gapWidth;
   var widgetMaxWidth = maxWidth + optionsWidth + paddingWidth+ sideWidth + gapWidth;
   var nsSpacerOffset = 49 + 15 + 76 + 11 + 52 - sideWidth;
   var ewSpacerOffset = 37 + 13 + 76 + 10 + 37;
   var newMapWidth = Math.round(eval(width) + eval(optionsWidth) + eval(paddingWidth) + eval(sideWidth) + eval(gapWidth));
   var newMapHeight = Math.round(eval(height) + 4 + 32 + 22);
   var mapWellWidth = newMapWidth;
   var wrapperWidth = mapWellWidth;
   document.getElementById(parentId).style.height=newMapHeight+"px";
   document.getElementById(parentId).style.width=newMapWidth+"px";
   //mapImageId = "mqMap"+UId;
   parentDivId = parentId;


   /*
   if (document.getElementById(parentDivName) == null)
   {
      parentDivName = "map_parent_" + (Math.round((Math.random()*197)+1));
      var bodyObj = document.getElementsByTagName('body').item(0);
      parent = createDiv(bodyObj,"",parentDivName);
   }
   else
   {
      parent = document.getElementById(parentDivName);
   }
   */

   Mainparent  = document.getElementById(parentDivId);

   //----------------------------------------

   // one method

   //Mainparent =  document.createElement ('div');
   //Mainparent.className = "myMap";
   //Mainparent.id = "mqMap";


   var mapImgId = "map"+UId;
   //var m_dvMqContainer = createDiv (Mainparent, 'myMap', '');
   var m1wrapDiv = createDiv(Mainparent,"mqClear",mapImgId +"-wrapper");
   //var map1linkA = createA(m1wrapDiv,"","");
   //map1linkA.name = mapImgId +"-link";

   var mapwidgetDiv = createDiv(m1wrapDiv,"mqMapwidget",mapImgId +"-widget");
   mapwidgetDiv.style.width = mapWellWidth+'px';
   var mapctrlsDiv = createDiv(mapwidgetDiv,"mqMapcontrols",mapImgId +"-controls");
   mapctrlsDiv.style.width = eval(width) + eval(sideWidth) +'px';

   var nsSpacerWidth  =Math.round((eval(width) - eval(nsSpacerOffset)) / 2);


   var ewSpacerHeight =Math.round((eval(height) - eval(ewSpacerOffset)) / 2)-1;

   var d1,d2;

   if(eval(eval(width)-eval(nsSpacerOffset))/2 == nsSpacerWidth)
   d1 = 0;
   else
   d1 =1;

   if(eval(eval(height)-eval(ewSpacerOffset))/2 == ewSpacerHeight)
   d2 = 0;
   else
   d2 =1;



   // Div and images for nw-n-ne
   var ndirDiv = createImgDiv(mapctrlsDiv,"","",16,"","","");
   ndirDiv.className = "mqNw-n-ne";
   var nwImg = createImgDiv(ndirDiv,"",49,16,mapImgId +"-nw","","Pan Northwest");
   nwImg.className = "mqNw";
   nwImg.title = "Pan Northwest";
   var nxnwImg = createImgDiv(ndirDiv,"",15,16,mapImgId +"-nxnw","","Pan Northwest");
   nxnwImg.className = "mqNxnwc mqNxnw";
   nxnwImg.title = "Pan Northwest";
   var nspaImg = createImgDiv(ndirDiv,"",nsSpacerWidth,16,mapImgId +"-na","","Pan North");
   nspaImg.className = "mqNa";
   nspaImg.title = "Pan North";
   var nImg = createImgDiv(ndirDiv,"",76,16,mapImgId +"-n","","Pan North");
   nImg.className = "mqN";
   nImg.title = "Pan North";
   var nspbImg = createImgDiv(ndirDiv,"",eval(nsSpacerWidth) - eval(d1),16,mapImgId +"-nb","","Pan North");
   nspbImg.className = "mqNb";
   nspbImg.title = "Pan North";
   var nxneImg = createImgDiv(ndirDiv,"",11,16,mapImgId +"-nxne","","Pan Northeast");
   nxneImg.className = "mqNxnec mqNxne";
   nxneImg.title = "Pan Northeast";
   var neImg = createImgDiv(ndirDiv,"",52,16,mapImgId +"-ne","","Pan Northeast");
   neImg.className = "mqNe";
   neImg.title = "Pan Northeast";
   // wrapper div for w-map-e
   var ewdirDiv = createDiv(mapctrlsDiv,"mqW-map-e mqClear","");
   // Div and images for west
   var wDiv = createDiv(ewdirDiv,"mqWest",mapImgId +"-west");
   var wnwImg = createImgDiv(wDiv,"w",12,37,mapImgId +"-wnw","","Pan Northwest");
   wnwImg.className = "mqWnw";
   wnwImg.title = "Pan Northwest";
   var wxnwImg = createImgDiv(wDiv,"",12,13,mapImgId +"-wxnw","","Pan Northwest");
   wxnwImg.className = "mqWxnwc mqWxnw";
   wxnwImg.title = "Pan Northwest";
   var wspaImg = createImgDiv(wDiv,"",12,eval(ewSpacerHeight) + eval(d2),mapImgId +"-wa","","Pan West");
   wspaImg.className = "mqWa";
   wspaImg.title = "Pan West";
   var wImg = createImgDiv(wDiv,"",12,76,mapImgId +"-w","","Pan West");
   wImg.className = "mqW";
   wImg.title = "Pan West";
   var wspbImg = createImgDiv(wDiv,"",12,ewSpacerHeight,mapImgId +"-wb","","Pan West");
   wspbImg.className = "mqWb";
   wspbImg.title = "Pan West";
   var wxswImg = createImgDiv(wDiv,"",12,10,mapImgId +"-wxsw","","Pan Southwest");
   wxswImg.className = "mqWxswc mqWxsw";
   wxswImg.title = "Pan Southwest";
   var wswImg = createImgDiv(wDiv,"",12,37,mapImgId +"-wsw","","Pan Southwest");
   wswImg.className = "mqWsw";
   wswImg.title = "Pan Southwest";
   // Div and images for map
   var mDiv = createDiv(ewdirDiv,"mqMiddle","mapcontainer"+UId);
   mDiv.style.clip = "rect(0px," + String(eval(map.width) + 2) + "px," + String(eval(map.height) + 2) + "px,0px)";
   mDiv.style.height = String(map.height) + "px";
   mDiv.style.width = String(map.width) + "px";


   map1Img = createImg(mDiv,map.request,map.width,map.height,mapImgId,"map","Map");
   map1Img.style.position = "absolute";
   map1Img.style.left="0";
   map1Img.style.top="0";

   //addEvent(map1Img,"load",showPOILayers);



   map0Img = createImg(mDiv,"",0,0,"map0"+UId,"map","Map");
   map0Img.style.position = "absolute";
   map0Img.style.zindex = "-1";
   map0Img.style.visibility = "hidden";
   map0Img.style.left="0px";
   map0Img.style.top="0px";

   // Div and images for east
   var eDiv = createDiv(ewdirDiv,"mqEast",mapImgId +"-east");
   var eneImg = createImgDiv(eDiv,"",16,37,mapImgId +"-ene","","Pan Northeast");
   eneImg.className = "mqEne";
   eneImg.title = "Pan Northeast";
   var exneImg = createImgDiv(eDiv,"",16,13,mapImgId +"-exne","","Pan Northeast");
   exneImg.className = "mqExnec mqExne";
   exneImg.title = "Pan Northeast";
   var espaImg = createImgDiv(eDiv,"",16,eval(ewSpacerHeight) + eval(d2),mapImgId +"-ea","","Pan East");
   espaImg.className = "mqEa";
   espaImg.title = "Pan East";
   var eImg = createImgDiv(eDiv,"",16,76,mapImgId +"-e","","Pan East");
   eImg.className = "mqE";
   eImg.title = "Pan East";
   var espbImg = createImgDiv(eDiv,"",16,ewSpacerHeight,mapImgId +"-eb","","Pan East");
   espbImg.className = "mqEb";
   espbImg.title = "Pan East";
   var exseImg = createImgDiv(eDiv,"",16,10,mapImgId +"-exse","","Pan Southeast");
   exseImg.className = "mqExsec mqExse";
   exseImg.title = "Pan Southeast";
   var eseImg = createImgDiv(eDiv,"",16,37,mapImgId +"-ese","","Pan Southeast");
   eseImg.className = "mqEse";
   eseImg.title = "Pan Southeast";
   // Div and images for south
   var sdirDiv = createImgDiv(mapctrlsDiv,"","",16,"","","");
   sdirDiv.className = "mqSw-s-se";
   var swImg = createImgDiv(sdirDiv,"",49,16,mapImgId +"-sw","","Pan Southwest");
   swImg.className = "mqSw";
   swImg.title = "Pan Southwest";
   var sxswImg = createImgDiv(sdirDiv,"",15,16,mapImgId +"-sxsw","","Pan Southwest");
   sxswImg.className = "mqSxswc mqSxsw";
   sxswImg.title = "Pan Southwest";
   var sspaImg = createImgDiv(sdirDiv,"",nsSpacerWidth,16,mapImgId +"-sa","","Pan South");
   sspaImg.className = "mqSa";
   sspaImg.title = "Pan South";
   var sImg = createImgDiv(sdirDiv,"",76,16,mapImgId +"-s","","Pan South");
   sImg.className = "mqS";
   sImg.title = "Pan South";
   var sspbImg = createImgDiv(sdirDiv,"",eval(nsSpacerWidth) - eval(d1),16,mapImgId +"-sb","","Pan South");
   sspbImg.className = "mqSb";
   sspbImg.title = "Pan South";
   var sxseImg = createImgDiv(sdirDiv,"",11,16,mapImgId +"-sxse","","Pan Southeast");
   sxseImg.className = "mqSxsec mqSxse";
   sxseImg.title = "Pan Southeast";
   var seImg = createImgDiv(sdirDiv,"",52,16,mapImgId +"-se","","Pan Southeast");
   seImg.className = "mqSe";
   seImg.title = "Pan Southeast";

   // form at bottom click...



   var clickForm = document.createElement("form");
   mapctrlsDiv.appendChild(clickForm);
   clickForm.action = "#";
   clickForm.id = mapImgId +"-mapclick";
   clickForm.appendChild(document.createTextNode("Clicking on map will:"));
   var zoomin = null;
   var clickrcz = null;
   if (__mqcontainer.browser.isIE) {
   zoomin = document.createElement("<input name='clickAction'>");
   } else if (__mqcontainer.browser.isNS) {
   zoomin = document.createElement("input");
   zoomin.name = "clickAction";
   }
   zoomin.type = "radio";
   clickForm.appendChild(zoomin);
   zoomin.id = "map1-clickzoom";
   zoomin.value = "zoom";
   zoomin.checked=false;

   var zoominLbl = document.createElement("label");
   zoominLbl.setAttribute("for",zoomin.id);
   zoominLbl.appendChild(document.createTextNode("Zoom In"));
   clickForm.appendChild(zoominLbl);


   var clickrc = null;
   if (__mqcontainer.browser.isIE) {
   clickrc = document.createElement("<input name='clickAction'>");
   } else if (__mqcontainer.browser.isNS) {
   clickrc = document.createElement("input");
   clickrc.name = "clickAction";
   }

   clickrc.type = "radio";
   clickForm.appendChild(clickrc);
   clickrc.id = mapImgId +"-clickrecenter";
   clickrc.value = "zoom";
   clickrc.checked=true;
   var clickrcLbl = document.createElement("label");
   clickrcLbl.setAttribute("for",clickrc.id);
   clickrcLbl.appendChild(document.createTextNode("Re-Center"));
   clickForm.appendChild(clickrcLbl);

   if (__mqcontainer.browser.isIE) {
   clickrcz = document.createElement("<input name='clickAction'>");
   } else if (__mqcontainer.browser.isNS) {
   clickrcz = document.createElement("input");
   clickrcz.name = "clickAction";
   }
   clickrcz.type = "radio";
   clickForm.appendChild(clickrcz);
   clickrcz.id = "map1-clickrecenterzoom";
   clickrcz.value = "center_zoom";
   clickrcz.checked=false;
   var clickrczLbl = document.createElement("label");
   clickrczLbl.setAttribute("for",clickrcz.id);
   clickrczLbl.appendChild(document.createTextNode("Re-Center and Zoom In"));
   clickForm.appendChild(clickrczLbl);



   // Zoom options to left side
   var mapoptsDiv = createDiv(mapwidgetDiv,"mqMapoptions",mapImgId +"-options");
   var mzoom = createDiv(mapoptsDiv,"mqZoom",mapImgId +"-zoom");
   mzoom.style.marginTop = Math.round((eval(height) + 32 - 259) / 2) + "px";
   mzoom.style.position = "relative";
   mzoom.style.width = optionsWidth + "px";
   var zinImg = createImgDiv(mzoom,"",41,46,mapImgId +"-zin","","Zoom In");
   zinImg.className="mqZin";
   var z110Div = createDiv(mzoom,"","");
   var z10Img = createImgDiv(z110Div,"",32,17,mapImgId +"-z10","","Zoom Level 10");
   z10Img.className = "mqZ10";
   var z9Img = createImgDiv(z110Div,"",32,17,mapImgId +"-z9","","Zoom Level 9");
   z9Img.className = "mqZ9";
   var z8Img = createImgDiv(z110Div,"",32,17,mapImgId +"-z8","","Zoom Level 8");
   z8Img.className = "mqZ8";
   var z7Img = createImgDiv(z110Div,"",32,17,mapImgId +"-z7","","Zoom Level 7");
   z7Img.className = "mqZ7";
   var z6Img = createImgDiv(z110Div,"",32,17,mapImgId +"-z6","","Zoom Level 6");
   z6Img.className = "mqZ6";
   var z5Img = createImgDiv(z110Div,"",32,17,mapImgId +"-z5","","Zoom Level 5");
   z5Img.className = "mqZ5";
   var z4Img = createImgDiv(z110Div,"",32,17,mapImgId +"-z4","","Zoom Level 4");
   z4Img.className = "mqZ4";
   var z3Img = createImgDiv(z110Div,"",32,17,mapImgId +"-z3","","Zoom Level 3");
   z3Img.className = "mqZ3";
   var z2Img = createImgDiv(z110Div,"",32,17,mapImgId +"-z2","","Zoom Level 2");
   z2Img.className = "mqZ2";
   var z1Img = createImgDiv(z110Div,"",32,17,mapImgId +"-z1","","Zoom Level 1");
   z1Img.className = "mqZ1";
   var zoutImg = createImgDiv(mzoom,"",optionsWidth,43,mapImgId +"-zout","","Zoom Out");
   zoutImg.className = "mqZout";

   var rvtImg = createImgDiv(mzoom,"",optionsWidth,26,mapImgId +"-revert","","");
   // rvtImg.style.marginTop += Math.round((eval(height) + 32 - 259) / 2);
   rvtImg.style.display = "block";
   rvtImg.style.position = "relative";
   rvtImg.className = "mqRevert";
   var finclrDiv = createDiv(Mainparent,"mqClear","");

   /*
   -------------------
   END INTERACTIVE MAP
   -------------------

   // begin legal and navtech logo
   document.write("<div class=\"spacer\"><img src=\"images/maps/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"10\" id=\"spacer_clear\" name=\"spacer_clear\" /></div>");
   document.write("</div>"); // close <div class="mqMapZoom">
   document.write("</div>");// close <div class=\"mqWrap\">
   document.write("<div id=\"mqLegal\" style=\"width: "+ wrap_size +"px\"");
   document.write("<img src=\"images/navteq.gif\" alt=\"navtech\" border=\"0\" width=\"75\" height=\"34\" name=\"vendor\" />");
   document.write("<a class=\"mqAnchor\" href=\"http://www.mapquest.com/about/copyright2.adp?display=popup\">Use Subject to License/Copyright</a>");
   document.write("</div>");
   document.write("<div class=\"spacer\"><img src=\"images/maps/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"10\" id=\"spacer_clear\" name=\"spacer_clear\" /></div>");
   // end legal and navtech logo
   */
}//end function mq_display_interactive_map(av) {


//function used to display the outputting of a location
//address is outputted in format:
//
// Name (bold) and Anchor (optionaly)
// Address
// City, State PostalCode Country
//
function mq_display_address_location(loc,strURL) {
  var bSpace=false;
   if(!mq_ParamExists(loc))
      return;

   if (mq_ParamExists(loc.name) && loc.name.length) {
      if(strURL != "") {
           document.write("<strong><a class=\"mqAnchor\" href=\"");
         document.write(strURL);
           document.write("\">" + loc.name + "</a></strong><br>");
      } else {
         document.write("<b>"+loc.name+"</b><br/>");
      }
   }

   if (mq_ParamExists(loc.address) && loc.address.length)
        document.write(loc.address+"  <br>");
   if (mq_ParamExists(loc.city) && loc.city.length)
      document.write(loc.city+",  ");

   if (mq_ParamExists(loc.stateProvince) && loc.stateProvince.length) {
      document.write(loc.stateProvince);
      bSpace=true;
   }

   if (mq_ParamExists(loc.postalCode) && loc.postalCode.length) {
      if(bSpace)
      {
         document.write(" ");
      }
      document.write(loc.postalCode);
   }



   //example of how to output location parameters from the userfields
   if (mq_ParamExists(loc.userFields) && mq_ParamExists(loc.userFields.user1) && loc.userFields.user1.length)
      document.write("<br>" + loc.userFields.user1);

}//end function mq_display_address_location(loc,strURL) {

//this function is used to display the address in the single line format
//location - the location containing the info to output
//image - name of image to load, pass "" to not display an image
//width - width of the image to be displayed
//height - height of the image to be displayed
//address is outputted in format:
//
// image(optional) Address City, State PostalCode Country
//
function mq_display_address_location_single_line(loc,image,width,height) {
   var bSpace=false;
   if(!mq_ParamExists(loc))
      return;

   if(image != "")
      document.write("<img src=\"images/icons/" + image + "\" width=\"" + width + "\" height=\"" + height + "\" border=\"0\" alt=\"address icon\" />&nbsp;");

   if (mq_ParamExists(loc.address) && loc.address.length)
      document.write(loc.address+"  ");

   if (mq_ParamExists(loc.city) && loc.city.length)
      document.write(loc.city+"  ");

   if (mq_ParamExists(loc.stateProvince) && loc.stateProvince.length) {
      document.write(loc.stateProvince);
      bSpace=true;
   }

   if (mq_ParamExists(loc.postalCode) && loc.postalCode.length) {
      if(bSpace)
      {
         document.write("  ");
      }
      document.write(loc.postalCode);
   }


}//end function mq_display_address_location_single_line(loc,image,width,height) {

function mq_display_address_location_single_line_manuever(loc,image,width,height) {
   var bSpace=false;

   if(!mq_ParamExists(loc))
      return;

   if(image != "")
      document.write("<img src=\"images/icons/" + image + "\" width=\"" + width + "\" height=\"" + height + "\" border=\"0\" alt=\"address icon\" />&nbsp;");

   if (mq_ParamExists(loc.address) && loc.address.length)
      document.write(loc.address+",  ");

   if (mq_ParamExists(loc.city) && loc.city.length)
      document.write(loc.city+",  ");

   if (mq_ParamExists(loc.stateProvince) && loc.stateProvince.length) {
      document.write(loc.stateProvince);
      bSpace=true;
   }

   if (mq_ParamExists(loc.postalCode) && loc.postalCode.length) {
      if(bSpace)
      {
         document.write("  ");
      }
      document.write(loc.postalCode);
   }

   if (mq_ParamExists(loc.country) && loc.country.length) {
      if(bSpace) {
         document.write(" ");
      }
      //document.write(loc.country);
   }
}//end function mq_display_address_location_single_line_manuever(loc,image,width,height) {

//function used to format a number (num) to x(dec) decimal places
function formatNumber(num,dec) {
   return Math.floor(num * Math.pow(10,dec))/Math.pow(10,dec);
}

//function displays the time in format x hours, x.xx minutes or x.xx minutes
function mq_display_time(totalTime) {
   var newTime;
   // more than a minute
   if(totalTime > 3600)
   {
      newTime = totalTime/3600;
      document.write(Math.floor(newTime) + " hours ");
      newTime = (totalTime/60)%60;
      document.write(" " + Math.floor(formatNumber(newTime,2)) + " mins");
      return;
   }
   if(totalTime > 60)
   {
      newTime = totalTime/60;
      document.write(" " +Math.floor(formatNumber(newTime,2)) + " mins");
      return;
   } else {
      document.write(" " +Math.floor(formatNumber(totalTime,2)) + " mins");
      return;
    }
}

//function used to display distance formated in a div with right alignment.
//outputs miles or kilometers with 2 digits of precision
function mq_display_distance(totalDistance) {
   document.write("<div align=\"right\">" + formatNumber(totalDistance.value,2) + (totalDistance.units == "mi" ? " mi" : " kilometers") + "&nbsp;</div>");
   }

//display a map for driving directions
function mq_display_map_image_tag_for_direction(map,name) {
var request;
   var width;
   var height;

   if (mq_ParamExists(map.request)) {
      request = map.request;
   }
   if (mq_ParamExists(map.width)) {
      width = map.width;
   }
   if (mq_ParamExists(map.height)) {
      height = map.height;
   }
/*
   document.write("<img border='0' src='" + request + "' height='" + height + "px' width='" + map.width+"px'");
   
   if (name != "")
      document.write(" name=\"" + name + "\" id=\"" + name + "\"");
   
   document.write(" />");
   
}
//displays a map as an image using height,width and request.
function mq_display_map_image_tag(map,name) {
   
   var request;
   var width;
   var height;
   
   if (mq_ParamExists(map.request)) {
      request = map.request;
   }
   if (mq_ParamExists(map.width)) {
      width = map.width;
   }
   if (mq_ParamExists(map.height)) {
      height = map.height;
   }
   /*
   document.write("<img border='0' src='" + request + "' height='" + height + "px' width='" + map.width+"px'");
   
   if (name != "")
      document.write(" name=\"" + name + "\" id=\"" + name + "\"");
   
   document.write(" />");
   */
document.write("<img src='"+request+"' width='"+width+"px' height='"+height+"px' name='map' id='map' alt='Map' border='0' /> ");
document.write("<img name='map' id='map0' alt='Map' border='0' /> ");
 
   
}
//displays a map as an image using height,width and request.
function mq_display_map_image_tag(map,name) {
   
   var request;
   var width;
   var height;
   
   if (mq_ParamExists(map.request)) {
      request = map.request;
   }
   if (mq_ParamExists(map.width)) {
      width = map.width;
   }
   if (mq_ParamExists(map.height)) {
      height = map.height;
   }
   
   document.write("<img border='0' src='" + request + "' height='" + height + "px' width='" + width+"px'");
   
   if (name != "")
      document.write(" name=\"" + name + "\" id=\"" + name + "\"");
   
   document.write(" />");
}

//function used to return the status text for a given status number
function getErrTxt(loc, errNum) {
   var errStr = "";

   //single string return codes
   switch (eval(errNum))
   {
      case 200 :
         return "Client is not enabled to receive maps.  Please contact customer support.";
         break;
      case 201 :
         return "Client is not enabled to receive search results.  Please contact customer support.";
         break;
      case 202 :
         return "Client is not enabled to receive search results from specified table.  Please contact customer support.";
         break;
      case 203 :
         return "Client is not enabled to receive route results.  Please contact customer support.";
         break;
      case 250 :
         return "Client ID required.";
         break;
      case 251 :
         return "Invalid or Missing Client ID";
         break;
      case 252 :
         return "Client ID expired";
         break;
      case 253 :
         return "Unauthorized";
         break;
      case 400 :
         return "Transaction Required";
         break;
      case 500 :
         return "Server Error";
         break;
      case 900 :
         return "Invalid Latitude"
         break;
      case 901 :
         return "Invalid Longitude"
         break;
      case 902 :
         return "Error Parsing Input Parameters";
         break;
      case 903 :
         return "Invalid Param Name.  Params can only contains numbers, letters, and underscores and cannot begin with a number.";
         break;
      //Server Down
      case 9001 :
         return "We are unable to generate a map at this time.  Please try again shortly.";
         break;
      
   }

   return "An Unknown error occured";
}//function getErrTxt {
