function applyEffect (element, valueAccessor, allBindingsAccessor, viewModel, effect, callback) {
		//we look for this flag to avoid a lot of iterations.
		if (viewModel.isChangeStarted) { return };
		// First get the latest data that we're bound to
		var value = valueAccessor(), allBindings = allBindingsAccessor();
		// Next, whether or not the supplied model property is observable, get its current value
		var valueUnwrapped = ko.utils.unwrapObservable(value);
		// Grab some more data from another binding property
		var duration = allBindings.vbDuration || 400; // 400ms is default duration unless otherwise specified
		var options = allBindings.vbOptions || {}
		var effectOnClose = allBindings.effectOnClose || false;
		//setting default callback if null
		callback=callback || JQuerUiEffect;
		//Now manipulate the DOM element
		var $el=$(element);
		if (valueUnwrapped) {
			//console.log('show ->' + $(element).attr('class'));
			//$(element).stop().slideDown(duration); // Make the element visible
			callback($el, effect, duration, options, false);
		} else {
			//Make the element invisible  
			 //hack: sometimes jquery ui sets height to 1 and won't make the element grow, attaching a lot of
			//css styles that will make your label loose its css... so we reset in that case and only keep the display property.
			var disp=$el.css('display');
			$el.attr('style', 'display:' + disp);
			//$el.attr('style', '');
			//now we hide.
			if (!effectOnClose) {
				$el.stop().hide();
			} else {
				callback($el, effect, duration, options, true);
			};
		};
	}
/**********************************************
	* Generic function to make jquery ui bindings:
	* We use applyEffect for the bindings and then
	* create our custom callbacks that will make 
	* the effect work.
	***********************************************/
Generic function to make jquery ui bindings:
We use applyEffect for the bindings and then
create our custom callbacks that will make
the effect work.
Generic function to make jquery ui bindings : We use applyEffect for the bindings and then create our custom callbacks that will make the effect work .
function applyEffect (element, valueAccessor, allBindingsAccessor, viewModel, effect, callback) {
		if (viewModel.isChangeStarted) { return };
		var value = valueAccessor(), allBindings = allBindingsAccessor();
		var valueUnwrapped = ko.utils.unwrapObservable(value);
		var duration = allBindings.vbDuration || 400; 
		var options = allBindings.vbOptions || {}
		var effectOnClose = allBindings.effectOnClose || false;
		callback=callback || JQuerUiEffect;
		var $el=$(element);
		if (valueUnwrapped) {
			callback($el, effect, duration, options, false);
		} else {
			var disp=$el.css('display');
			$el.attr('style', 'display:' + disp);
			if (!effectOnClose) {
				$el.stop().hide();
			} else {
				callback($el, effect, duration, options, true);
			};
		};
	}
function applyEffect ( element , valueAccessor , allBindingsAccessor , viewModel , effect , callback ) { if ( viewModel . isChangeStarted ) { return } ; var value = valueAccessor ( ) , allBindings = allBindingsAccessor ( ) ; var valueUnwrapped = ko . utils . unwrapObservable ( value ) ; var duration = allBindings . vbDuration || 400 ; var options = allBindings . vbOptions || { } var effectOnClose = allBindings . effectOnClose || false ; callback = callback || JQuerUiEffect ; var $el = $ ( element ) ; if ( valueUnwrapped ) { callback ( $el , effect , duration , options , false ) ; } else { var disp = $el . css ( 'display' ) ; $el . attr ( 'style' , 'display:' + disp ) ; if ( ! effectOnClose ) { $el . stop ( ) . hide ( ) ; } else { callback ( $el , effect , duration , options , true ) ; } ; } ; }
Generic function to make jquery ui bindings:
 We use applyEffect for the bindings and then
 create our custom callbacks that will make
 the effect work.
Generic function to make jquery ui bindings : We use applyEffect for the bindings and then create our custom callbacks that will make the effect work .
//we look for this flag to avoid a lot of iterations.
 // First get the latest data that we're bound to
 // Next, whether or not the supplied model property is observable, get its current value
 // Grab some more data from another binding property
 // 400ms is default duration unless otherwise specified
 //setting default callback if null
 //Now manipulate the DOM element
 //console.log('show ->' + $(element).attr('class'));
 //$(element).stop().slideDown(duration); // Make the element visible
 //Make the element invisible  
 //hack: sometimes jquery ui sets height to 1 and won't make the element grow, attaching a lot of
 //css styles that will make your label loose its css... so we reset in that case and only keep the display property.
 //$el.attr('style', '');
 //now we hide.
