$(document).ready(function() {
	$('.default-value').each(function() {
		var default_value = this.value;
		$(this).focus(function() {
			if(this.value == default_value) {
				this.value = '';
			}
		});
		$(this).blur(function() {
			if(jQuery.trim(this.value) == '') {
				this.value = default_value;
			}
		});
	});
	
	$("form").submit(function() {
		$('.default-value').each(function() {
			var default_value = this.defaultValue;
			if(this.value == default_value) {
				this.value = '';
			}
	      });
	 });
});

function openAjaxDialog(url, dailogName, loadingMsg) {
	try{
		//debugger;
	    $.blockUI({
	        message: '<h3><img src="/framework/images/loader.gif" />'+loadingMsg+' </h3>'
	    });
	    var result = $.ajax({
	        type: 'POST',
	        url: url,
	        dataType: 'html',
	        mimeType: 'text/html',
	        cache:false,
	        success: function (_data) {
	        	$(dailogName).html("");
	            $(dailogName).html(_data);
	            $(dailogName).dialog('open');
	            $.unblockUI();
	        }
	    });
	}catch(e){
		printLog('***** IOL --> Scheduling--> openAjaxDialog  page--> Got error while initiating scheduling process  '+e);
		$.unblockUI();
	}
}
