jQuery(document).ready(function() {	// College and latest news tabs on the home page	$("#jq-tabs").tabs({		// Customise the tabs prefix.		idPrefix: 'jq-tabs-',		select: function(event, ui) {			// The DoE tab is special, it opens a different URL (not just reveals a hidden layer).			if (ui.index == 6) {				location.href = $.data(ui.tab, 'load.tabs');		        return false;			}			// Remember the currently selected tab			else {				// There might be a bug here as without +1 the script does not remember the selected tab properly.				$.cookie('jq-tab', ui.index + 1);			}		}	});	// The tab selected by default.	if ($.cookie('jq-tab') ) {		$("#jq-tabs").tabs('option', 'selected', $.cookie('jq-tab') );	}	// Date picker widget	$("#input-date-from").datepicker(  {		dateFormat: 'dd/mm/yy',		changeMonth: true,		changeYear: true,		/* These fix a bug with the submit button overlapping the calendar */		beforeShow: function() {			$("#input-submit-event").hide();		},		onClose: function() {			$("#input-submit-event").show();		}	});	// Show the reset icon instead of the word "Reset"	$("#input-date-from").after('<input type="button" id="click-reset-date-from" class="button-ico-cross" tabindex="6" value=" " title="Click to reset the date field" />');	// For resetting the date fields	$("#click-reset-date-from").click(function() {		$("#input-date-from").attr("value", "");	});	// End: Date picker widget	// Expand-collapse the events form	$(".action-showhide").each(function(){		var oAttrRel = $('#'+this.rel);		var oElemThis = $(this);		//checks if the content is meant to be hidden by checking the 'action-hidden' class		if(oAttrRel){			if(oAttrRel.hasClass('action-hidden')){				//remove the  'action-hidden' class and hide it				oAttrRel.removeClass('action-hidden');				//oAttrRel.addClass('hide');				oAttrRel.hide();				if(!oElemThis.hasClass('action-show')) oElemThis.addClass('action-show');			}			else{				if(!oElemThis.hasClass('action-hide')) oElemThis.addClass('action-hide');			}			//assign function to the toggle onclick handler			oElemThis.click(function() {				var oElemThis = $(this);				//assign class for the toogle								//'action-show' shows that when the mouse is clicked, the content will be shown  				oElemThis.toggleClass('action-show');				//'action-hide' shows that when the mouse is clicked, the content will be hidden				oElemThis.toggleClass('action-hide');								//if(oElemThis.hasClass('action-show')) oElemThis.title = 'Click to expand';				//else oElemThis.title = 'Click to hide';								//toogle the hide class				//$('#'+this.rel).toggleClass('hide');				$('#'+this.rel).toggle(500); // if the animation id not needed remove the number from this function				return false;			});		}	});});