// JavaScript Document
//-------change these items for every stop   rvDescription is for the RV Park, location is WHERE the park is relative to other landmarks
// CAUTION::::: ALSO change the location code in the xferWebCam.php program (reference to rvplaces.js)
// CAUTION
rvCity = "Camp Verde, AZ"
rvPark = "Camp Verde RV Resort";
rvLocationDescription = "High Desert of AZ";
rvDescription = " Western Horizon park next to Verde River, 30 Amps";
rvZip = "86322"
rvTime= "PST";
lat = "34.60033";
longx = "-111.88";
arrival = "3/14/10";
departure = "03/28/10";
//---------------------------------------------------
noaa ='<a href="http://www.wrh.noaa.gov/total_forecast/index.php?wfo=sgx&zone=caz056&fire=caz256&county=cac065&dgtl=1&lat=' + lat + ';&lon='+longx + '" target="_blank">here</a> '

 
weather = "<script src ='http://voap.weather.com/weather/oap/" + rvZip + "?template=DRIVV&par=null&unit=0&key=b3be79391ee85afd78ab27ede76ab696'></script>"
 function rvmap() {
    var map = new GMap(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.addMapType(G_SATELLITE_3D_MAP);
    map.centerAndZoom(new GPoint(longx, lat), 6);
    map.setMapType(G_HYBRID_TYPE );
	  var marker = new GMarker(new GPoint(longx, lat));
    map.addOverlay(marker);}
 
	
function rvcity(){document.write(rvCity)}
function rvpark(){document.write(rvPark)}
function rvlat(){document.write(lat)}
function rvlong(){document.write(longx)}
function rvnoaa(){document.write(noaa)}
function rvweather(){document.write(weather)}
function rvtime(){document.write(rvTime)}
function rvdescription(){document.write(rvDescription)}
function rvlocationdescription(){document.write(rvLocationDescription)}
function rvarrival(){document.write(arrival)}
function rvdeparture(){document.write(departure)}
function rvLeave(){document.write("<div id='cdClock'></div>")}
 // to use the countdown to leaving, make sure to add <body onLoad="countdown();">

function countdown()
         {
		 var countDown = "";
         Today = new Date();
         Todays_Year = Today.getFullYear() - 2000;
         Todays_Month = Today.getMonth() + 1;                  
         
         //Convert both today's date and the target date into miliseconds.                           
         Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), 
                                 Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();    
		 var dates1 = departure.split("/");
         Target_Date = (new Date(dates1[2], dates1[0], dates1[1], 9, 0, 00)).getTime();                  
         
         //Find their difference, and convert that into seconds.                  
         Time_Left = Math.round((Target_Date - Todays_Date) / 1000);
         
         if(Time_Left < 0)
            Time_Left = 0;
          
                    days = Math.floor(Time_Left / (60 * 60 * 24));
                    Time_Left %= (60 * 60 * 24);
                    hours = Math.floor(Time_Left / (60 * 60));
                
                    
                    dps = 's'; hps = 's'; 
					 
                    if(days == 1) dps ='';
                 //   if(hours == 1) hps ='';
               
                    
                    countDown = days + ' day' + dps + ' ';
                    countDown += hours + ' hr' + hps ;
                
					document.getElementById('cdClock').innerHTML =  " We are leaving here in " + countDown + ".";
				 
        
         };
		 // I need to change the slide show program to pause when called like this....
		 //  filex = "images_2005.xml";
function photos(filex,idx,numx) {

document.write("<a href='http://www.rvinteractive.com/rvguys/slides/index.html?xmlfile=" +  filex +  "#id=" +idx + "&amp;num=" + numx +"' target='_blank'><img src='camera.gif' width='24' height='21' border='0' /></a>"

);
}