    function headerbar(divid){
    var header = '<b><a href="http://www.takitwithme.com">Home</a>'+
                 ' - <a href="http://earthnc.com/category/takitwithme">Blog</a>'+ 
                 ' - <a href="http://www.takitwithme.com/faq.html">FAQ</a>'+
                 ' - <a href="http://www.takitwithme.com/contact">Contact</a></b>'+
                 ' - <b><a href="http://digg.com/submit?phase=2&url=http%3A%2F%2Fwww.takitwithme.com&title=TakitWithMe+Google+My+Maps+to+GPS+Converter&bodytext=Convert+Google+My+Maps+to+GPX+format+and+send+to+Garmin+GPS+devices+with+a+single+click&topic=tech_news">Digg This!</a></b>'+
                 ' - <b>Tools:</b> <a href="http://www.takitwithme.com/gpx.html">GPX to GPS</a> | <a href="//www.takitwithme.com/ge2gps.html">Google Earth to GPS</a> | '+
                 '<a href="http://www.takitwithme.com">MyMaps to GPS</a> | <a href="http://www.takitwithme.com/geembed.html>Embedded Maps</a>';
    document.getElementById(divid).innerHTML = header;   
    }
    
    function gload(buttonname,successmessage) {
	    var display = new Garmin.DeviceDisplay("garminDisplay", {
	    	pathKeyPairsArray: ["http://www.takitwithme.com",
                             "61b0b43a98d27dc8c4acfd0894fd9328"],
	    	 unlockOnPageLoad: false,                       //delays unlocking to avoid authorization prompt until action
                hideIfBrowserNotSupported: true,                              
                showStatusElement: true,                       //provide minimal feedback
                autoFindDevices: false,                        //it will search for devices upon action                      
                findDevicesButtonText: buttonname,      //allows you to customize the action text
                showCancelFindDevicesButton: false,            //no need to cancel small data transfers
                autoSelectFirstDevice: true,                   //pick the first device if several are found
                autoReadData: false,                           //don't automatically read the tracks/etc
                autoWriteData: true,                           //automatically write the data once devices found
                showReadDataElement: false,  

        getWriteData: function() { 
        return document.getElementById("writeDataText").value; },  
        afterFinishWriteToDevice: function(message, display) {
				alert(successmessage);
			  }
			});
   }  
   
   function selectall(id){
    document.getElementById(id).focus();
    document.getElementById(id).select();
    }
   
   function showgpx(){
   document.getElementById('showgpx').style.display="none";
   document.getElementById('hidegpx').style.display="block";
   document.getElementById('writeDataText').style.display="block";
   }
   function hidegpx(){
   document.getElementById('writeDataText').style.display="none";
   document.getElementById('hidegpx').style.display="none";
   document.getElementById('showgpx').style.display="block";   
   }
   
   function cleanurl(url){
   url = url.replace(/&/g,"%26");
   url = url.replace(/=/g,"%3D");
   url = url.replace("?","%3F"); 
   url = url.replace("/","%2F");
   url = url.replace("//","%2F%2F");
   return url;
   }
   

