var fnd_main_gui={
	showLoading:function(obj,cls) {
		if($('#xLoading')[0])
			$('#xLoading').remove();
		$('body').prepend('<div class="'+cls+'" id="xLoading"></div>');
		$("#xLoading").css('opacity','0.7');
		$("#xLoading").css('z-index','999');
		if(obj)
		{
			$("#xLoading").css('left',$(obj).offset().left);
			$("#xLoading").css('top',$(obj).offset().top);
			$("#xLoading").height($(obj).height()+'px');
			$("#xLoading").width($(obj).width()+'px');
		}
		else
		{
			$("#xLoading").css('left',0);
			$("#xLoading").css('top',$(window).scrollTop());
			$("#xLoading").height('100%');
			$("#xLoading").width('100%');
			$(window).scroll(
				function(){
					$("#xLoading").css('top',$(window).scrollTop());
				}
			)
		}
	},
	
	hideLoading:function(){
		$("#xLoading").remove();
	},
	
	hideBgr:function(){
		$("#xBgr").remove();
	},
	
	showBgr:function(obj,cls) {
		if($('#xBgr')[0])
			$('#xBgr').remove();
		$('body').prepend('<div class="'+cls+'" id="xBgr"></div>');
		$("#xBgr").css('opacity','0.7');
		$("#xBgr").css('z-index','100');
		if(obj)
		{
			$("#xBgr").css('left',$(obj).offset().left);
			$("#xBgr").css('top',$(obj).offset().top);
			$("#xBgr").height($(obj).height()+'px');
			$("#xBgr").width($(obj).width()+'px');
		}
		else
		{
			$("#xBgr").css('left',0);
			$("#xBgr").css('top',$(window).scrollTop());
			$("#xBgr").height('100%');
			$("#xBgr").width('100%');
			$(window).scroll(
				function(){
					$("#xBgr").css('top',$(window).scrollTop());
				}
			)
		}
	},
	
	centerObj:function(obj){
		obj.css('position','absolute');
		obj.css('left',$(window).width()/2-obj.width()/2);
		obj.css('z-index',101);
		obj.css('top',$(window).scrollTop()+$(window).height()/2-obj.height()/2);
		$(window).scroll(
			function(){
				obj.css('top',$(window).scrollTop()+$(window).height()/2-obj.height()/2);
			}
		)
	},
	
	getMCE:function(mode){
		return{	
			script_url : _sys.rootURL+'/3pary/tinyMCE/tiny_mce.js',
			relative_urls : false,
		  	remove_script_host : true,
			mode : "specific_textareas",
			theme : "advanced",
			language : _sys.lang.code,
			gecko_spellcheck : true,
			body_class : 'xContent',
			content_css : skinUrl,
			dialog_type : "modal",
			plugins : "emotions, inlinepopups, media, grifix",
			fullscreen_settings : {
				theme_advanced_path_location : "top"
			},
			
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_resizing : false,
			theme_advanced_resize_horizontal : false,
			theme_advanced_statusbar_location:"bottom",
			theme_advanced_buttons1 : "bold, italic, underline, strikethrough, sub, sup, |,"+
			"justifyleft, justifycenter, justifyright, justifyfull, |,"+
			"bullist, numlist, outdent, indent, |, link, unlink, image,media, emotions, grifix, grifix2",
			theme_advanced_buttons2 :false
		};
	}
}