 jQuery(document).ready(function()
{	
       setTimeout(function()
    	{
    	   jQuery('#msg').fadeOut(1000);
	   }, 3000);
       setTimeout(function()
    	    	{
    	    	   jQuery('#authMessage').fadeOut(1000);
    		   }, 3000);
       
       jQuery('#editlink').click(function() {
			jQuery('#edit').toggle(); // First click should toggle to 'show'
			jQuery('#st').toggle(); // First click should toggle to 'show'
		   });
       jQuery('#menumaster').click(function() {
			jQuery('#menuchild').toggle(); // First click should toggle to 'show'
		   });
       jQuery('#menumasterschoolcode').click(function() {
			jQuery('#menuchildschoolcode').toggle(); // First click should toggle to 'show'
		   });
});
 function click(id)
 {
	 jQuery("#"+id).html('');
 }
 
 function close_div(id)
 {
	 //$("table > #"+id).slideUp('slow');
	 jQuery("#"+id).html('');
 }
 function toggle_details_link(id,id2,tab_id){
	 jQuery("#"+id2).fadeOut('slow');
	 jQuery("#"+id).fadeIn('slow');
	 
	 if(tab_id){
		 jQuery("#"+tab_id).html('');
	 }
 }

function jqCheckAll( id, name,master)
{
   if (jQuery('#'+master).is(':checked'))
   {
      jQuery("form#" + id + " INPUT[@name=" + name + "][type='checkbox']").attr('checked', true);
   }
   else
   {
      jQuery("form#" + id + " INPUT[@name=" + name + "][type='checkbox']").attr('checked', false);
   }
}
function checkChangePasswordForm(){
	var errorMsg = "";
	if(jQuery("#UserOldPassword").val() == ""){
		errorMsg += "Old password must not be blank \n";
	}
	if(jQuery("#UserNewPassword").val() == ""){
		errorMsg += "New password must not be blank \n";
	}
	if(jQuery("#UserConfirmPassword").val() == ""){
		errorMsg += "Confirm password must not be blank and should match with new password. \n";
	}
	
	if(errorMsg != ""){
		alert(errorMsg);
		return false;
	}
	return true;
}