function openWindow(myURL) 
{
	myRef  = window.open (myURL,"new_window","width=550,height=520, location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,left=150,top=50,screenx=150,screeny=50");

}

//Google Maps 
function load(WINDOW_HTML, LATTUDE, LONGTUDE) 
{
    
      if (GBrowserIsCompatible()) 
	  {
        var map = new GMap2(document.getElementById("mapBite"));
	  	var point = new GLatLng(LATTUDE, LONGTUDE);
		
        map.setCenter(point, 15, G_HYBRID_MAP);
		

		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
	
		// Create our "tiny" marker icon
		var icon = new GIcon();
		icon.image = "/images/chattering_teeth.png";
		icon.shadow = "";
		icon.iconSize = new GSize(52, 44);
		icon.shadowSize = new GSize(0, 0);
		icon.iconAnchor = new GPoint(40, 3);
		icon.infoWindowAnchor = new GPoint(5, 1);
		//map.setMapType(givenmaptypes[1]); 


		
		var marker = new GMarker(point, icon);
  
 		map.addOverlay(marker);
 		
		GEvent.addListener(marker, "click", function() {
            marker.openInfoWindowHtml(WINDOW_HTML);
		
        });
		
		marker.openInfoWindowHtml(WINDOW_HTML);
        
        GEvent.addListener(marker, "infowindowclose", function() {
             map.setCenter(point, 15, G_HYBRID_MAP);
        });
	  }
	  
	  
		/*
		//Google Maps V3 API
		var myLatLng = new google.maps.LatLng(LATTUDE, LONGTUDE);
		var myOptions = {
		  zoom: 15,
		  center: myLatLng,
		  mapTypeId: google.maps.MapTypeId.HYBRID
		}
		
		var map = new google.maps.Map(document.getElementById("mapBite"), myOptions);
		
		var image = '/images/chattering_teeth.png';
		
		//MarkerImage(url:string, size?:Size, origin?:Point, anchor?:Point, scaledSize?:Size)
		
		var icon = new google.maps.MarkerImage("/images/chattering_teeth.png", null, null, new google.maps.Point(43, 3), new google.maps.Size(52, 44));

		
		var contentString = WINDOW_HTML;
		
		var infowindow = new google.maps.InfoWindow({
			content: contentString
		});
		
		var marker = new google.maps.Marker({
			position: myLatLng,
			map: map,
			icon: icon
		});

		infowindow.open(map,marker);
		
		google.maps.event.addListener(marker, 'click', function() {
		  infowindow.open(map,marker);
		});
		
		google.maps.event.addListener(marker, 'closeclick', function() {
             map.setCenter(myLatLng, 13);
        });
		
		*/
   
/*
    if (GBrowserIsCompatible()) {
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GSmallMapControl());
      map.setCenter(new GLatLng(37.4328, -122.077), 13);
      var marker = new GMarker(new GLatLng(37.4228, -122.085));
      map.addOverlay(marker);
      GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(WINDOW_HTML);
      });
      marker.openInfoWindowHtml(WINDOW_HTML);
    }
*/
}

function formCheck() 
{
		
        if (document.theform.username.value == "") 
        {
        alert("Please enter your name");
		document.theform.username.value="";
		document.theform.username.focus();
        return false;
        }
		
		if (document.theform.email.value == "") 
        {
        alert("Please enter a valid email address");
        return false;
        }
		
		if (echeck(document.theform.email.value)==false)
		{
			document.theform.email.value="";
			document.theform.email.focus();
			return false;
		}
		
		if (document.theform.comment.value == "")
        {
        alert("Please enter text in the comments field of the form.");
		document.theform.comment.value="";
		document.theform.comment.focus();
        return false;
        }
       
	   if (document.theform.security_code.value == "") 
        {
        alert("Please enter the security code.");
		document.theform.security_code.focus();
        return false;
        }
}

/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Please enter a valid email address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please enter a valid email address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please enter a valid email address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid email address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid email address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid email address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please enter a valid email address")
		    return false
		 }

 		 return true				
	}
