 $(document).ready( function(){
							 
	Shadowbox.init();

	
	$('.fade').innerfade({ 
	speed: 'slow', 
	timeout: 5000, 
	type: 'sequence', 
	containerheight: '300px' });
							 
	
							 
 	$("#start_date,#end_date").datepicker({ 
		    beforeShow: customRange, 
		    showOn: "both", 
		    dateFormat: "dd-mm-yy",     
		    buttonImage: "img/cal.gif", 
		    buttonImageOnly: true ,
			mandatory: true,
			onSelect: function(dateText) { 
		     } 
	});
	clear_form_elements("#f1");
	$(".send_form").hide();
	
	$("#res_button").click (function() {
		$(".send_form").show("slow");
		$("#res_button").hide();
		$("#fullname").attr("isRequired",1);
		$("#phone").attr("isRequired",1);
		$("#email").attr("isRequired",1);
		return false;
	});

						 
  } ); 
  
  function clear_form_elements(ele) {

    $(ele).find(':input').each(function() {
        switch(this.type) {
            case 'password':
            case 'select-multiple':
            case 'select-one':
            case 'text':
            case 'textarea':
                $(this).val('');
                break;
            case 'checkbox':
            case 'radio':
                this.checked = false;
        }
    });

}

  
  function customRange(input) {
 return {minDate: (input.id == "end_date" ? $("#start_date").datepicker("getDate") : null)};
} 

  function validateFormEx() {

  if (!validateForm('f1'))
     return false;
     
  return true;
}
 
function sendme() 
{ 

alert ("Booking is currently unavailable. Please try later");
return false;

	if (!validateFormEx())
		return false;

    window.open("","myNewWin","width=850,height=650,toolbar=0,scrollbars=yes,location=no"); 
    var a = window.setTimeout("document.f1.submit();",500); 
    return true;
} 




    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.addControl(new GSmallMapControl());
						map.addControl(new GMapTypeControl(new GSize(10,10)));
						var ovMap = new GOverviewMapControl(new GSize(75,75));
						map.addControl(ovMap);

        map.setCenter(new GLatLng(39.390802, 22.997088), 15);
        map.setMapType(G_HYBRID_MAP);

        map.openInfoWindowHtml(map.getCenter(),
                   "<BR><b style='font-size:14px;font-family:verdana'>Alkistis Hotel</b>");
      }
    }

