// Noconflict

jQuery.noConflict();


// Loggin function
jQuery.fn.log = function (msg) {
      console.log("%s: %o", msg, this);
      return this;
  };


// Navigation
jQuery("#nav img").fadeTo("slow", 0.6); // This sets the opacity of the thumbs to fade down to 60% when the page loads

jQuery("#nav img").hover(function(){
    jQuery(this).fadeTo("fast", 1.0); // This should set the opacity to 100% on hover
    },function(){
    jQuery(this).fadeTo("fast", 0.6); // This should set the opacity back to 60% on mouseout
});



// Contact reservations
jQuery("div.reservations").hide();

jQuery("a.show_reservations").click(function(){
	   jQuery("div.reservations").toggle("slow");
	   return false;
 });


jQuery("div.faq").hide();

jQuery("a.show_faq").click(function(){
	   jQuery("div.faq").toggle("slow");
	   return false;
 });


	// extend the default setting to always include the zebra widget.
	//$.tablesorter.defaults.widgets = ['zebra'];
	// extend the default setting to always sort on the first column

	// $.tablesorter.defaults.sortList = [[0,0]];
// NOTE als de default sortlist hierboven aanstaat, doet de quick lookup het niet !!!!!!!!


	jQuery.tablesorter.addParser({
		// set a unique id
		id: 'now',
		is: function(s) {
			// return false so this parser is not auto detected
			return false;
		},
		format: function(s) {
			// format your data for normalization
			return s.toLowerCase().replace(/now/,0);
		},
		// set type, either numeric or text
		type: 'numeric'
	});

	// call the tablesorter plugin

	jQuery('table').tablesorter({
				headers: {
							0: {sorter: false },
							2: {sorter: false },
							3: {sorter:"currency"},
							4: {sorter:"now"}
				}
	});




jQuery('document').ready(function() { // DOC READY NEEDED
    jQuery("table#huizen tbody tr").quicksearch({
      position: 'before',
      attached: 'table#huizen',
      labelText: 'Search the table',
      inputText: '...',
      labelClass: 'textinput',
      inputClass: '',
      dalay: 500
    })
});


jQuery('document').ready(function() { // DOC READY NEEDED
    jQuery("form#iarrive").show('slow')
});


$("#datepicker").datepicker({
			numberOfMonths: 3,
			showButtonPanel: true,
			dateFormat: 'dd MM yy',
			altField: 'input#av',
			altFormat: 'yy-mm-dd',
			buttonImageOnly: true,
			showButtonPanel: true,
			onClose: function(){
					var newdate = $("input#av").val();
					$(".iarrive").prepend("Ken").prepend(newdate);
//					<input type="hidden" value="" name="av" id="av" />
				//	$("table#huizen tbody tr").slideUp("slow");
	   			//	$("table#huizen tbody tr[av^='2009']").slideDown("slow");
	   				}

 });

