  
  $(document).ready(function() {

    
    $('input.destination').focus(function() {
      
      $('#suggestion').toggle('fast');
      
      return false;
    
    });
    
  Date.format = 'dd-mm-yyyy';    

	$('.date').datePicker({
    clickInput:true,
    createButton:false  
  })
	$('#start-date').bind(
		'dpClosed',
		function(e, selectedDates)
		{
			var d = selectedDates[0];
			if (d) {
				d = new Date(d);
				$('#end-date').dpSetStartDate(d.addDays(1).asString());
				$('#end-date').val(d.addDays(0).asString());
			}
		}
	);
	$('#end-date').bind(
		'dpClosed',
		function(e, selectedDates)
		{
			var d = selectedDates[0];
			if (d) {
				d = new Date(d);
				$('#start-date').dpSetEndDate(d.addDays(-1).asString());
			}
		}
	);

  });


  function mail_a_friend(host){
    window.open (host+"/mail.php","mail","location=0,menubar=0,resizable=0,scrollbars=0,status=0,resizable=0,directories=0,toolbar=0,width=300,height=250,left=400,top=300"); 
    return false;
  }  
  
  
  
  function checkForm(){
  
    dest = date = formSubmit = false;
    
    if(document.getElementById("destination").value == "" )
      document.getElementById("dest_message").style.display="inline";
    else{
      document.getElementById("dest_message").style.display="none";
      dest = true; 
    }      

    if((document.getElementById("start-date").value == "" || document.getElementById("end-date").value == "" ) && !document.getElementById("no_date").checked )
      document.getElementById("date_message").style.display="inline";
    else{
      document.getElementById("date_message").style.display="none";
      date = true; 
    }      

    if( date && dest )
      formSubmit = true;
  
    return formSubmit;
  }
  
  

  function CreateBookmarkLink(title,url) {

    
    if (window.sidebar) { // Mozilla Firefox Bookmark
    	window.sidebar.addPanel(title, url,"");
    } 
    else if( window.external ) { // IE Favorite
    	window.external.AddFavorite( url, title); 
    }
    else if(window.opera && window.print) { // Opera Hotlist
    	return true; 
    }
  }
