function getdirections(markernumber, coords) { var listingaddr = $('[name=directionslisting'+markernumber+']').val(); var useraddr = $('[name=directionsuser'+markernumber+']').val(); var tofrom = $('[name=directionstofrom'+markernumber+']').val(); useraddr = useraddr.replace(/\./g,''); // google driving directions chokes on N.E. Main Street or S.W. Main Street, needs NE or SW listingaddr = listingaddr.replace(/\./g,''); listingaddr = listingaddr + "@" + coords; // to avoiding choking with stupid did you mean prompts, include lat/lon to be super-clear if (tofrom == "to") { var start = useraddr; var end = listingaddr; } else { var end = useraddr; var start = listingaddr; } var request = { origin:start, destination:end, travelMode: google.maps.DirectionsTravelMode.DRIVING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } }); } function getdirectionstoshow(markernumber) { $(".directionsbox").css('display', 'inline'); $(".directionsto").addClass("selecteddirection"); $(".directionsfrom").removeClass("selecteddirection"); $('[name=directionstofrom'+markernumber+']').val('to'); } function getdirectionsfromshow(markernumber) { $(".directionsbox").css('display', 'inline'); $(".directionsfrom").addClass("selecteddirection"); $(".directionsto").removeClass("selecteddirection"); $('[name=directionstofrom'+markernumber+']').val('from'); } function updatestate(country) { if (country.value == '{DEFAULTCOUNTRY}') { document.getElementById('americanstate').style.display = "block"; document.getElementById('foreignstate').style.display = "none"; } else { document.getElementById('americanstate').style.display = "none"; document.getElementById('foreignstate').style.display = "block"; } } function getnextlevel(value) { var xmlhttp = false; var tosend = ''; var message = value; var aet = $("#addedittype").val(); $.post("http://www.10000campgrounds.com/ajax.php",{ action: 'catlevels', id: message, addedittype: aet }, function(xml) { // ajax.php will return levelid[|||]html and we'll split the array to use var rarr = xml.split('[|||]'); var levelid = rarr[0]; var response = rarr[1]; if (response != '') { var levelboxid = "#levelbox" + levelid; var start = parseInt(levelid) + 1; for (x = start; x < 10; x++) { var higherlevel = "#levelbox" + x; try { $(higherlevel).html(''); } catch(error) { } } $(levelboxid).html(response); } else { for (x = levelid; x < 10; x++) { var higherlevel = "#levelbox" + x; try { $(higherlevel).html(''); } catch(error) { } } } }); } function toggle(divid, onoff) { if (onoff == 0) document.getElementById(divid).style.display = "none"; else document.getElementById(divid).style.display = "block"; } function minmax(divid) { if (document.getElementById(divid).style.display == "none") document.getElementById(divid).style.display = "block"; else document.getElementById(divid).style.display = "none"; } function dropmenu(divid) { var ourdiv = document.getElementById(divid); if(ourdiv.style.display == "block") ourdiv.style.display = "none"; else ourdiv.style.display = "block"; return false; } function makecookie(name, value, expires, path, domain, secure) { var today = new Date(); today.setTime( today.getTime() ); if (expires) expires = expires * 1000 * 60 * 60 * 24; var expires_date = new Date(today.getTime() + (expires)); document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); } function update(msg) { field = document.commentform.message; if (document.selection) { field.focus(); sel = document.selection.createRange(); sel.text = msg; } else if (field.selectionStart || field.selectionStart == 0) { var startPos = field.selectionStart; var endPos = field.selectionEnd; field.value = field.value.substring(0, startPos) + msg + field.value.substring(endPos, field.value.length); } else { field.value += msg; } } function checkall() { $("INPUT[type='checkbox']").attr('checked', 'checked'); } function uncheckall() { $("INPUT[type='checkbox']").attr('checked', ''); } function counthit(linkid, hittype) { var hittype = (hittype == null) ? "regular" : hittype; var tosend = "http://www.10000campgrounds.com/ajax.php?action=counthit" + escape("&") + "linkid=" + linkid + escape("&") + "hittype=" + hittype; $.get(tosend,{},function(response) {}) } function imageover(ima) { ima.style.borderColor = 'blue'; } function imageout(ima) { ima.style.borderColor = 'black'; } function sndRequest(vote,id_num,ip_num) { var selectit = '#unit_long'+id_num; var element = $(selectit); element.html('