(function($){
	

	
	if (!window.console)
	{
		window.console = {};
		var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
			"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
		for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {};
	}

	
	$(document).ready(function(){

		window.onRenderIframeResponseCallback = function(result){
			if (result) {
				if (result.success) {
					$('#btnSave').attr('disabled', 'disabled');
					if (typeof onRenderIframeResponseCallbackSuccess == 'function') {
						onRenderIframeResponseCallbackSuccess(result);
					}
				}
				else {
					showErrorDialog('<span>' + result.message + '</span>');
					if (typeof onRenderIframeResponseCallbackFailure == 'function') {
						onRenderIframeResponseCallbackFailure(result);
					}
				}
			}
			$('#dialogLoader').dialog('close');
			$('#_iframe').attr('src', 'about:blank');
		}
		
		//create hidden iframe for Save functionality
		//var $iframe = $('<iframe />').attr({name:'_iframe', id:'_iframe'}).css({width:0,height:0}).hide();
		//var $hidden = $('<input />').attr({type:'hidden', name:'iframeSubmit'});
		//$('form:first').append($iframe, $hidden);

	})
})(jQuery);