$(document).ready(function() {
	// Closing Divs - used on Notification Boxes
	$(".canhide").click(function() {
		$(this).fadeOut(700);
	});
	
	// Load WYSIWYG Editor - add class 'wysiwyg' to any textarea to add functionality.
	//$('.wysiwyg').wysiwyg();
	
	// Check all the checkboxes when the head one is selected:
	$('.checkall').click(
		function(){
			$(this).parent().parent().parent().parent().find("input[type='checkbox']").attr('checked', $(this).is(':checked'));   
		} 
	);
	
	// Field-Formater
	$("input.field_format_number").change(function() {
		var value = $().number_format($(this).val(), {
										   numberOfDecimals:$(this).attr('x-decimals'),
										   decimalSeparator: '.',
										   thousandSeparator: ',',
										   symbol: ''}); 	
		$(this).val(value);
	});
	// Field-Multiply-Fields - calculates the sum of 2 fields
	$("input.field_format_number").change(function() {
		var value = $().number_format($(this).val(), {
										   numberOfDecimals:$(this).attr('x-decimals'),
										   decimalSeparator: '.',
										   thousandSeparator: ',',
										   symbol: ''}); 	
		$(this).val(value);
	});
	
	//toggle Next
	$(".toggleNext").next().addClass('toggleNext-target');	
	$(".toggleNext").click(function() {
		$(this).next().toggle('blind');
		return false;
	});	

// Closing jQuery
});
