// JavaScript Document
$(document).ready(function(){
						   
	// STOP IE6 FLICKER
	if ($.browser.msie && $.browser.version.substr(0,1)<7) { 
		document.execCommand('BackgroundImageCache', false, true);
		
	};
	
	// BUTTON SETUP
	 $(function(){
		//all hover and click logic for buttons
		$(".fg-button:not(.ui-state-disabled)")
		.hover(
			function(){ 
				$(this).addClass("ui-state-hover"); 
			},
			function(){ 
				$(this).removeClass("ui-state-hover"); 
			}
		)
		.mousedown(function(){
				$(this).parents('.fg-buttonset-single:first').find(".fg-button.ui-state-active").removeClass("ui-state-active");
				if( $(this).is('.ui-state-active.fg-button-toggleable, .fg-buttonset-multi .ui-state-active') ){ $(this).removeClass("ui-state-active"); }
				else { $(this).addClass("ui-state-active"); }	
		})
		.mouseup(function(){
			if(! $(this).is('.fg-button-toggleable, .fg-buttonset-single .fg-button,  .fg-buttonset-multi .fg-button') ){
				$(this).removeClass("ui-state-active");
			}
		});
	});
	 
	 
	 
	 
	/*$('#DateDiagnosed,#DOB,#ChildsDOB,#ChildDateDiagnosed').datepicker({
												   
		dateFormat: 'dd/mm/yy'
		
	});*/ 
	
	
	$('.Hidden').slideUp('fast');
	 
	    
	 
	 
});

function showhidediv(ControlSwitch, ThingToDrop) {

	//console.log(ControlSwitch + ' ' +ThingToDrop);

	if ( $("#"+ControlSwitch).attr("checked") ) {
		
		$("."+ThingToDrop).slideDown();
	
	} else {
	
		$("."+ThingToDrop).slideUp();
	
	};         

};  
