// JavaScript Document
	// check validation for newsletter
$(document).ready(function() {
	// validate signup form on keyup and submit
	$("#signup-newsletter").validate();
});
function resetImage(cityid) {
	if (confirm('Are you sure?')) top.location.href= '?reset=yes&cityid='+cityid;
}
function change_field (inputid,formid) {
	var form_id = document.getElementById(formid);
	if ((inputid.value != "0") && (form_id) ) {
		form_id.action = "?";
		form_id.submit();		
	}
}
function send_photo(barid) {window.open('/public_upload.asp?id='+barid,'photo','width=600,height=400,scrollbars=yes');}	
function bookmark(){
	bookmarkurl=top.location.href;	bookmarktitle=document.title;
	if (document.all)  { window.external.AddFavorite(bookmarkurl,bookmarktitle); }	return false;
}
var map = null; var geocoder = null;


function showAddress(address,nomarker) {
	geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
      zoom: 12,
      center: latlng,
    mapTypeControl: true,
    mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
    navigationControl: true,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById("map"), myOptions);
    if (geocoder) {
      geocoder.geocode( { 'address': address}, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
          if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
          map.setCenter(results[0].geometry.location);

            var infowindow = new google.maps.InfoWindow(
                { content: '<b>'+address+'</b>',
                  size: new google.maps.Size(150,50)
                });
    
            var marker = new google.maps.Marker({
                position: results[0].geometry.location,
                map: map, 
                title:address
            }); 
            google.maps.event.addListener(marker, 'click', function() {
                infowindow.open(map,marker);
            });

          } else {
            //alert("No results found");
          }
        } else {
          //alert("Geocode was not successful for the following reason: " + status);
        }
      });
    }
     

}












function showAddress_state(address,nomarker) {		 
geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
      zoom: 7,
      center: latlng,
    mapTypeControl: true,
    mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
    navigationControl: true,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById("map"), myOptions);
    if (geocoder) {
      geocoder.geocode( { 'address': address}, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
          if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
          map.setCenter(results[0].geometry.location);

            var infowindow = new google.maps.InfoWindow(
                { content: '<b>'+address+'</b>',
                  size: new google.maps.Size(150,50)
                });
    
            var marker = new google.maps.Marker({
                position: results[0].geometry.location,
                map: map, 
                title:address
            }); 
            google.maps.event.addListener(marker, 'click', function() {
                infowindow.open(map,marker);
            });

          } else {
            alert("No results found");
          }
        } else {
          alert("Geocode was not successful for the following reason: " + status);
        }
      });
    }
}

  
