$(document).ready(function(){ 						   						   // fill out hidden alt fields in the format needed$( "#fromField" ).datepicker({ dateFormat: 'dd.mm.yy',altField: "#hiddenFrom",altFormat: 'dd.mm.yy'})$( "#toField" ).datepicker({ dateFormat: 'dd.mm.yy',altField: "#hiddenTo",altFormat: 'dd.mm.yy'})// check if empty - this will be flagged as an option for open search at start / end$('#search_form').submit(function() {if ($("#fromField").val() == "") {var d = new Date();var curr_date = d.getDate();var curr_month = d.getMonth();var curr_year = d.getFullYear();$('#hiddenFrom').val(curr_date + "." + curr_month + "." + curr_year)}if ($("#toField").val() == "") {  $('#hiddenTo').val('11.11.2015')}});						   						   $("a[rel^='prettyPhoto']").prettyPhoto({			animation_speed: 'fast', /* fast/slow/normal */			slideshow: 3000, /* false OR interval time in ms */			overlay_gallery: false,			autoplay_slideshow: true /* true/false */									   });$(".ila[title]").tooltip({position:"top center",offset:[0,0],effect:"slide",slideOffset:5,direction:"down",delay:100,predelay:200,tipClass:"tooltip"});						   						   $("ul.sf-menu").superfish({ animation: {height:'show'},   // slide-down effect without fade-in delay:     1200               // 1.2 second delay on mouseout }); // make the form nice and nice with JQ Transform//$('#contact-form').jqTransform();$('ul#animated-course').cycle({		fx: 'fade',		prev:   '#prev',     	next:   '#next',		timeout: 2900,		pause: 1     // true to enable "pause on hover"	});// add controls to animating ul$('a#toggle').bind("click", function(e) {		e.preventDefault();          if ($(this).attr("class") == "pause") {             $(this).attr("class", "play"),			  $('ul#animated-course').cycle('pause'),			  $('#playpause').attr('src', '/courseslideimages/play.gif')		  } else {             $(this).attr("class", "pause");			 $('ul#animated-course').cycle('resume'),			  $('#playpause').attr('src', '/courseslideimages/pause.gif')		  }		}); $('#next, #prev').click(function(e) {     e.preventDefault();});$("ul#courseslist li").fadeTo('200',.8)//hover effects for homepage etc pods$('ul#courseslist li').hover(function(){	$(this).fadeTo('300',1);	}, function() {	$(this).fadeTo('300',.8);	});//add random class to rotate img in gallery listvar randLast = (Math.floor(Math.random() * 4))+1;  $("ul.gallerylist#courseslist li img").each(function() {        $(this).addClass("box_rotate" + createRandomPos());    });   function createRandomPos() {   var randPos = (Math.floor(Math.random() * 4))+1;   // checks if duplicate and only returns one that isn't   while (randPos == randLast) {    randPos = (Math.floor(Math.random() * 4))+1;   }   randLast = randPos   return randPos;  }});
