/**
 *
 * Standard scripts to be included on index page
 *
 **/

$(document).ready(function(){


//All setup functions
	//Menu
	$('#menu div').addClass('beam-menu-subitem');
	$('#menu div ul').addClass('ui-helper-reset');
	$('#menu div ul').css('cursor', 'pointer');
	$('#menu div ul').css('cursor', 'hand');

	$('#addBB').click(function(){
		showJobInfo();
	})

	//JQuery Theme Switcher
	//$('#switcher').themeswitcher();

	//Error area
	$('.errors').each(function(index, Element){
		if (! $(Element).children().length){
			$(Element).css("display", "none");
		}
	})

	//Javascript support test
	$("#compatibility").css("display", "none");  //Check for javascript support.

	// Set buttons to theme
	$("button, input:submit").button();

	//Login accordion
	$("#accordion").accordion({ header: "h3", autoHeight: false });


	// Dialog
	$('#dialog').dialog({
		autoOpen: false
	});

	// Dialog Link
	$('#dialog_link').click(function(){
		$('#dialog').dialog('open');
		return false;
	});

	//hover states on the static widgets
	$('#dialog_link, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); },
		function() { $(this).removeClass('ui-state-hover'); }
	);

	//datepickers
	$('.DatePicker').datepicker({
  		dateFormat: 'dd/mm/yy',
  		showOtherMonths: true,
  		selectOtherMonths: true,
  		firstDay: 1
  	});

  	//buttons
	$('input:submit, input:button').button();

	//call routine to insert any additional theme specific events
	//themeSpecificEvents();
});



