﻿/*
 * Global.js
 * 
 *
 * Written and maintained by Highmore Hill (highmore@163.com)
 */

//	(function(){})(jQuery);	用于存放开发插件的代码，执行其中代码时DOM不一定存在，所以直接自动执行DOM操作的代码请小心使用。
//	$(function(){});		用于存放操作DOM对象的代码，执行其中代码时DOM对象已存在。不可用于存放开发插件的代码，因为jQuery对象没有得到传递，外部通过jQuery.method也调用不了其中的方法（函数）。

/*
********************************************************************************************************
*
* 工具函数
*
********************************************************************************************************
*/
function getRequestParam(idx) {
	var _urlpars = new Object();
	var _pars = document.location.search.substr(1).split("&");

	for (i = 0; i < _pars.length; i++) {
		var _par = _pars[i].split("=");
		_urlpars[_par[0]] = _par[1];
	};

	return _urlpars[idx];
}

// Accepts a url and a callback function to run.
function requestCrossDomain(site, callback) {
	// If no url was passed, exit.
	if (!site) {
		throw new Error("No site was passed.");
		return;
	}

	// Take the provided url, and add it to a YQL query. Make sure you encode it!
	var yql = "http://query.yahooapis.com/v1/public/yql?q=" + encodeURIComponent("select * from html where url='" + site + "'") + "&format=json&callback=?";

	// Request that YSQL string, and run a callback function.
	// Pass a defined function to prevent cache-busting.
	$.getJSON(yql, cbFunc);

	function cbFunc(data) {
		// If we have something to work with...
		if (data.results[0]) {
			// Strip out all script tags, for security reasons.
			// BE VERY CAREFUL. This helps, but we should do more.
			data = data.results[0].replace(/<script[^>]*>[\s\S]*?<\/script>/gi, "");

			// If the user passed a callback, and it
			// is a function, call it, and send through the data var.
			if (typeof callback === "function") {callback(data);}
		} else {
			// Else, Maybe we requested a site that doesn't exist, and nothing returned.
			throw new Error("Nothing returned from getJSON.");
			return;
		}
	}
}
//------------------------------------------------------------------------------------------------------
// 作用:		String原型功能扩展
//------------------------------------------------------------------------------------------------------
	String.prototype.len = function() {			//计算中英文混排字数
		return this.replace(/[^\x00-\xff]/g,"**").length;
	}
	String.prototype.getBytes = function() {
		var cArr = this.match(/[^\x00-\xff]/ig);
		return this.length + (cArr == null ? 0 : cArr.length);
	}

/*
********************************************************************************************************
*
* TrimPath参数
* Copyright (c) 2010 Highmore.Hill
*
********************************************************************************************************
*/
	var myModifiers = {
		hello		: function(str, greeting) { 
			if (greeting == null) {greeting = "您好";}
			return greeting + ", " + str;
		},
		zeroSuffix	: function(str, totalLength) {
			return (str + "000000000000000").substring(0, totalLength);
		},
		escapeURL		: function(str) {
			return escape(String(str));
		},
		encode		: function(str) {
			return String(str).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/[\",\']/g,"&quot;");
		},
		decode		: function(str) {
			return String(str).replace(/&amp;/g, "&").replace(/&nbsp;/g, " ").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '\"').replace(/<br>/g, "\n");
		},
		htmldecode	: function(str) {
			return String(str).replace(/&amp;/g, "&").replace(/&nbsp;/g, " ").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '\"');
		},
		trimhtml	: function(s) {
			return String(s).replace(/<\/?[^>]*>/g, "").replace(/[ | ]*\n/g, "\n").replace(/\n[\s| | ]*\r/g, "\n");
		},
		localedate	: function(str) {
			return new Date(Date.parse(str)).toLocaleDateString();
		},
		localetime	: function(str) {
			return new Date(Date.parse(str)).toLocaleTimeString();
		},
		shortdate	: function(str) {
			var _s = new Date(Date.parse(str));
			return _s.getMonth() + "-" + _s.getDay();
		},
		cutstring	: function(str, l, d) {
			var _s = "";
			for (var i = 0; i<str.length; i++) {
				_s += str.charAt(i);
				if (_s.len() > l) {
					return str.substring(0, i);
				}
			}
			return _s + d;
		},
		jsonstring	: function(json) {
			return JSON.stringify(json);
		}
	}

$.fx.interval = 26; //default:13

/*
********************************************************************************************************
*
* Form Error function
*
********************************************************************************************************
*/
	var setFormError = function($f, err) {
		for (var i=0 in err) {
			if (err[i].select) {
				if ($f.find(err[i].select).parents("li").find(".error").length==0) {
					$f.find(err[i].select).parents("li").addClass("error").append('<p class="error">' + err[i].message + '</p>');
				} else {
					$f.find(err[i].select).parents("li").find(".error").html(err[i].message);
				}
				$f.find(".formTab").height($f.find(err[i].select).parents("ul").height());		//更新.formTab的高度

				$f.find(err[i].select).one("blur", function() {
					$(this).parents("li").removeClass("error").find(".error").remove();
					$f.find(".formTab").height($f.find(err[i].select).parents("ul").height());	//更新.formTab的高度
				});
				if ($f.cle) {
					$($f.cle[0]).one("blur", function() {
						$(this).parents("li").removeClass("error").find(".error").remove();
					});
				}
			} else {
				$f.find(".formStatus").append(err[i].message);
			}
		}
	}

	var removeFormError = function($f) {
		$f.find("li>.error").remove();
		$f.find(".formStatus").empty();
	}

/*
********************************************************************************************************
*
* activeClass function
*
********************************************************************************************************
*/
	function activeClass(arr1, arr2, activeElement) {
		var i = 0, j = 0;
		for (i=0; i<arr1.length; i++) {
			while (undefined !== arr2[j]) {
				if (arr1[i][activeElement] == arr2[j][activeElement]) {arr1[i].active = true;}
				++j;
			}
			j = 0;
		}
		return arr1;
	}

/*
********************************************************************************************************
*
* renderFunction definitions
*
********************************************************************************************************
*/
	$.fn.RenderHtml.renderFunction = {
		replaceContainerHtml: {
			begin	: function($container) {
				$container.empty();
				$container.html('正在装载模板...');
			},
			pass	: function(html, $container) {
				//$container.hide();
				$container.html(html);
				//var _h = $container.height();
				//$container.animate({height:0}, {queue:false, duration:0});
				//$container.show();
				//$container.animate({height:_h}, {queue:false, duration:500});
			}
		},

		insertContainerHtml: {
			begin	: function($container) {
				$container.empty();
				$container.html('正在装载模板...');
			},
			pass	: function(html, $container) {
				$container.append(html);
			}
		},

		replaceContainer: {
			begin	: function($container) {},
			pass	: function(html, $container) {
				$container.replaceWith(html);
			}
		},

		//弹出式文章
		renderDialogARTICLE: {
			begin	: function($container) {},
			pass	: function(html, $container) {
/*
				Shadowbox.open({
					content	: html,
					player	: "html",
					title	: "<img src=''>",
					height	: 560,
					width	: 700,
					onOpen	: function() {alert("open");},
					onClose	: function() {alert("close");}
				});
*/
				uiDialogArticle.css.width = 700;
				uiDialogArticle.css.left = ($(window).width() - uiDialogArticle.css.width) / 2 + "px";
				uiDialogArticle.css.height = 600;
				uiDialogArticle.css.top = ($(window).height() - uiDialogArticle.css.height) / 2 + "px";

				uiDialogArticle.message = html;
				uiDialogArticle.onBlock = function() {
					$(".blockMsg").find(".closeDialog").bind("click", function(e) {
						e.preventDefault();
						$.unblockUI();
						return false;
					});
					$(".itemTitle").RenderText();
				}

				$.blockUI(uiDialogArticle);
			}
		},

		//普通表单
		renderForm: {
			begin	: function($container) {
				$container.html("正在加载表单...");
			},
			pass	: function(html, $container) {
				$container.html(html);

				var $form = $container.find("form");

				$form.ajaxForm({
					beforeSubmit: function (formData, jqForm, options) {
						removeFormError(jqForm);
						uiFormBlock.message = "正在传送数据...";
			           	jqForm.block(uiFormBlock);
						return true;
					},
			      	success		: function (json, status, xhr, jqForm) {
						jqForm.unblock();
						if (json.status == "error") {
							setFormError(jqForm, json.error);
						} else if (json.status == "ok") {
			                if (json.refresh != undefined) {
			                	//$(json.refresh+",.Refresh").RenderHtml();
			                } else if (json.refresh == "close") {
			                	window.close();
			                }
			            } else {
			              	alert("未知的状态代码!");
			            }
					},
					dataType	: "json",
					clearForm	: false,
					resetForm	: false,
					// $.ajax options can be used here too, for example:
					data		: {},
					global		: false
				});
			}
		},

		//对话框表单
		renderDialogForm: {
			begin	: function($container) {
				$.growlUI("正在加载表单...", "请等待....");
			},
			pass	: function(html, $container) {
				uiDialog.css.width = 640;
				uiDialog.css.left = ($(window).width() - uiDialog.css.width) / 2 + "px";
				//uiDialog.css.height = 580;
				//uiDialog.css.top = ($(window).height() - uiDialog.css.height) / 2 + "px";

				uiDialog.message = html;
				uiDialog.onBlock = function() {
					var $form = $(".blockMsg").find("form");
					var cle = $form.find("#item_description").cleditor({
						width		: 604,		// width not including margins, borders or padding
						height		: 250,		// height not including margins, borders or padding
						controls	:			// controls to add to the toolbar
							"bold italic underline strikethrough | font size style | color removeformat | alignleft center alignright justify | rule image link unlink | cut copy paste pastetext | print source",
						colors		:			// colors in the color popup
							"FFF FCC FC9 FF9 FFC 9F9 9FF CFF CCF FCF " +
							"CCC F66 F96 FF6 FF3 6F9 3FF 6FF 99F F9F " +
							"BBB F00 F90 FC6 FF0 3F3 6CC 3CF 66C C6C " +
							"999 C00 F60 FC3 FC0 3C0 0CC 36F 63F C3C " +
							"666 900 C60 C93 990 090 399 33F 60C 939 " +
							"333 600 930 963 660 060 366 009 339 636 " +
							"000 300 630 633 330 030 033 006 309 303",
						fonts		:			// font names in the font popup
							"Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond,Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",
						sizes		:			// sizes in the font size popup
							"1,2,3,4,5,6,7",
						styles		:			// styles in the style popup
							[["段落", "<p>"], ["标题 1", "<h1>"], ["标题 2", "<h2>"],
							["标题 3", "<h3>"],  ["标题 4","<h4>"],  ["标题 5","<h5>"],
							["标题 6","<h6>"]],
						useCSS		: false,	// use CSS to style HTML when possible (not supported in ie)
						docType		:			// Document type contained within the editor
							'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
						docCSSFile	:			// CSS file used to style the document contained within the editor
							"",
						bodyStyle	:			// style to assign to document body contained within the editor
							"margin:4px; font:12px Arial,Verdana; cursor:text; line-height:24px;"
					});

					$form.find(".field", ".cleditorMain>iframe")
						.focus(function() {$(this).parents("li").addClass("focused");})
						.blur(function() {$(this).parents("li").removeClass("focused");});
					$form.find(".formTab").cycle({
						fx		: "fade",
						speed	: "fast",
						timeout	: 0,
						pager	: ".formNav",
						pagerAnchorBuilder: function(idx, slide) {
							return "<a href=\"#\" style=\"font-size:12px;\">" + $(slide).attr("title") + "</a>";
						}
					});
					$form.find(".closeDialog").bind("click", function(e) {
						e.preventDefault();
						$.unblockUI();
						return false;
					});
					$form.find(".uploadFile").bind("click", function(e) {
						e.preventDefault();
//alert($(e.target).closest(".blockMsg").html());
						$(e.target).closest(".blockMsg")
						    .data("mode", "reqtemplate")
						    .data("object", $(e.target).attr("rel"))
						    .data("action", "upload")
						    .data("template", "blockui")
						    .data("LOCAL_DATA", {filetype:$(e.target).attr("rel")})
						    .RenderHtml({renderFunction: "renderDialogUploadForm"});
						return false;
					});
					/*
					$form.find(".editAttachment").bind("click", function(e) {
						e.preventDefault();
						$(e.target).closest(".blockMsg")
						    .data("OPTION", {template_url:$(e.target).attr("href"), data:{filetype:$(e.target).attr("rel"), filesize:$(e.target).attr("rev"), action:"edit"}})
						    .RenderHtml({renderFunction: "renderDialogUploadForm"});
						return false;
					});
					*/

					$form.ajaxForm({
						beforeSerialize	: function(jqForm, options) {
							// return false to cancel submit
							uiFormBlock.message = "正在传送数据...";
							jqForm.block(uiFormBlock);
							return true;
						},
						beforeSubmit	: function(formData, jqForm, options) {
							removeFormError(jqForm);
							return true;
						},
						success			: function(json, status, xhr, jqForm) {
							jqForm.unblock();

							if (json.status=="error") {
								jqForm.cle = cle;
								setFormError(jqForm, json.error);
							} else if (json.status=="ok") {
								$.unblockUI();
window.location.reload();
								if (json.refresh!==undefined) {$(json.refresh.target).RenderHtml();}
							} else {
								alert("未知的状态代码!");
							}
						},
						dataType	: "json",
						clearForm	: false,
						resetForm	: false,
						// $.ajax options can be used here too, for example:
						data		: {},
						global		: false
					});
				}

				$.blockUI(uiDialog);
			}
		},

		//UPLOADATTACHMENT 对话框 表单
		renderDialogUploadForm: {
			begin	: function($container) {},
			pass	: function(html, $container) {
				uiUploadAttachmentDialog.centerY = false;
				uiUploadAttachmentDialog.message = html;
				uiUploadAttachmentDialog.onBlock = function() {
					var $form = $container.find(".blockMsg form");

					$form.find(".closeDialog").bind("click", function(e) {
						e.preventDefault();
$container.unblock();
						return false;
					});
					$form.find(".field")
						.focus(function() {$(this).parents("li").addClass("focused");})
						.blur(function() {$(this).parents("li").removeClass("focused");});

					$form.ajaxForm({
						beforeSerialize: function(jqForm, options) {
							// return false to cancel submit
							uiFormBlock.message = "正在上传文件...";
				           	jqForm.block(uiFormBlock);
				           	return true;
						},
						beforeSubmit: function (formData, jqForm, options) {
							removeFormError(jqForm);
							return true;
						},
						success		: function (json, status, xhr, jqForm) {
							jqForm.unblock();

							if (json.status=="error") {
								setFormError(jqForm, json.error);
							} else if (json.status=="ok") {
								if (json.UPLOAD_FILE!==undefined) {
									var file_data = json.UPLOAD_FILE;
									// 上传 Attachment 后激活 Resizeimage
									/*
									if (file_data.TYPE=="ATTACHMENT") {
										jqForm.closest(".blockMsg")
											.data("mode", "reqtemplate")
											.data("object", "attachment")
											.data("action", "resize")
											.data("template", "blockui")
											.data("LOCAL_DATA", file_data)
											.data("renderfunction", "renderDialogResizeForm")
										.RenderHtml();
									} else {
									*/
$container.unblock();
										var $preview = $("#" + file_data.TYPE + "-CONTAINER");
										if (json.UPLOAD_FILE=="THUMBNAIL") {$preview.empty();}
										$preview.append("<div id=\"preview_" + file_data.TYPE + "_" + file_data[file_data.TYPE + "_NAME"] + "\" style=\"float:left; position:relative;\" data-mode=\"reqtemplate\" data-object=\"" + file_data.TYPE.toLowerCase() + "\" data-action=\"preview\" data-template=\"default\" data-renderfunction=\"replaceContainer\"></div>");

										$("#preview_" + file_data.TYPE + "_" + file_data[file_data.TYPE + "_NAME"])
				        					.data("LOCAL_DATA", file_data)
				        					.RenderHtml();
									/*}*/

								} else {
									alert("上传文件时发生意外！没有文件被正确上传");
								}
							} else {
								jqForm.find(".formStatus").html(json.error[0].message);
							}
						},
						dataType	: "json",
						iframe		: true,
						clearForm	: false,
						resetForm	: false,
						// $.ajax options can be used here too, for example:
						data		: {},
						global		: false
					});
				}

				$container.closest(".blockMsg").block(uiUploadAttachmentDialog);
			}
		},

		//RESIZEIMAGE 对话框 表单
		renderDialogResizeForm: {
			begin	: function($container) {
			},
			pass	: function(html, $container) {
				uiCorpAttachmentDialog.message = html;
				uiCorpAttachmentDialog.onBlock = function() {
					var $form = $container.find(".blockMsg form");
					$form.find(".closeDialog").bind("click", function(e) {
						e.preventDefault();
						$("#resizeImage").imgAreaSelect({hide:true});
//alert($container.html());
$container.unblock();
						return false;
					});

					$form.ajaxForm({
						beforeSerialize: function(jqForm, options) {
							// return false to cancel submit
							uiFormBlock.message = "正在剪裁文件...";
							jqForm.block(uiFormBlock);
							return true;
						},
						beforeSubmit: function (formData, jqForm, options) {
							return true;
						},
						success		: function (json, status, xhr, jqForm) {
							jqForm.unblock();

							jqForm.find(".formStatus").html(json.message);
							if (json.status=="error") {
								//if (json.select !== undefined) $(json.select).select();
								setFormError(jqForm, json.error);
							} else if (json.status=="ok") {
								if (json.CORP_FILE!==undefined) {
									var file_data = json.CORP_FILE;

									$("#resizeImage").imgAreaSelect({remove:true});
$container.unblock();
									var $preview = $("#" + file_data.TYPE + "-CONTAINER");
									$preview.append("<div id=\"preview_" + file_data.TYPE + "_" + file_data[file_data.TYPE + "_NAME"] + "\" style=\"float:left; position:relative;\" data-mode=\"reqtemplate\" data-object=\"" + file_data.TYPE.toLowerCase() + "\" data-action=\"preview\" data-template=\"default\" data-renderfunction=\"replaceContainer\"></div>");

									$("#preview_" + file_data.TYPE + "_" + file_data[file_data.TYPE + "_NAME"])
						        		.data("LOCAL_DATA", file_data)
						        		.RenderHtml();
						        } else {
						        	
						        }
							} else {
								jqForm.find(".formStatus").html(json.message);
							}
						},
						dataType	: "json",
						clearForm	: false,
						resetForm	: false,
						// $.ajax options can be used here too, for example:
						data		: {},
						global		: false
					});
				}

				$container.block(uiCorpAttachmentDialog);
			}
		},

		//编辑图片对话框
		renderSubEditAttachmentDialogForm: {
			begin	: function($container) {
			},
			pass	: function(html, $container) {
				uiEditAttachmentDialog.centerY = false;
				uiEditAttachmentDialog.message = html;

				uiEditAttachmentDialog.onBlock = function() {
					var $form = $container.find(".blockMsg form");

					$form.find(".closeDialog").bind("click", function(e) {
						e.preventDefault();
						$container.closest(".blockMsg").unblock();
						return false;
					});
					$form.find(".field")
						.focus(function() {$(this).parents("li").addClass("focused");})
						.blur(function() {$(this).parents("li").removeClass("focused");});

					$form.ajaxForm({
						beforeSerialize: function(jqForm, options) {
							// return false to cancel submit
							uiFormBlock.message = "正在上传数据...";
				           	jqForm.closest(".blockMsg").block(uiFormBlock);
				           	return true;
						},
						beforeSubmit: function (formData, jqForm, options) {
							removeFormError(jqForm);
							return true;
						},
						success		: function (json, status, xhr, jqForm) {
							jqForm.closest(".blockMsg").unblock();

							if (json.status == "error") {
								setFormError(jqForm, json.error);
							} else if (json.status == "ok") {
								$container.closest(".blockMsg").unblock();
								var $editattachment = $("#attachment_name_" + json.attachment.name);
								$editattachment.find("input[name='" + json.attachment.name + "_description']").val(json.attachment.description);
							} else {
								jqForm.find(".formStatus").html(json.error[0].message);
							}
						},
						dataType	: "json",
						clearForm	: false,
						resetForm	: false,
						// $.ajax options can be used here too, for example:
						data		: {},
						global		: false
					});

				}

				$container.closest(".blockMsg").block(uiEditAttachmentDialog);
			}
		}





	}

/*
********************************************************************************************************
*
* BloackUI 参数
*
********************************************************************************************************
*/
	var uiDialog				= {
		css				: {
			padding			: 0,
			margin			: 0,
			border			: "0px solid #aaaaaa",
			width			: "auto",
			height			: "auto",
			//left			: "30%",
			top				: "0px",
			cursor			: "default"
		},
		overlayCSS		: {
			backgroundColor	: "#000000",
			opacity			: "0.8",
			cursor			: null
		},
		showOverlay		: true,
		fadeIn			: 0,
		fadeOut			: 0,

		bindEvents		: false,	//block内容的键或鼠标事件将被禁用
		constrainTabKey	: true,		//默认情况下，blockUI将会抑制tab导航到block的内容之外（在bindEvents为true的情况下）

		allowBodyStretch: true,		//在IE6下允许body元素被拉伸，将会使block看起来更好一些，如果你想禁止改变高度可以将其禁用
		focusInput		: true,		//在page blocking时，如果为true将会把焦点放在第一个可用的输入域中
		forceIframe		: false,	//在非IE浏览器中强制使用iframe(handy for blocking applets)
		cursor			: null,
		centerY			: false
	}

	var uiFormBlock				= {
		css				: {
			padding			: 6,
			margin			: 0,
			border			: "0px solid #990000",
			width			: "120px",
			color			: "#ffffff",
			backgroundColor	: "#990000"
		},
		overlayCSS		: {
			backgroundColor	: "#ffffff",
			opacity			: "0.8"
		},
		centerX			: true,
		centerY			: false
	}

	var uiUploadAttachmentDialog= {
		css				: {
			padding			: 0,
			margin			: 0,
			border			: "0px solid #aaaaaa",
			width			: "auto",
			height			: "auto",
			left			: 0,
			top				: 0
		},
		overlayCSS		: {
			backgroundColor	: "#000000",
			opacity			: "0.8",
			cursor			: null
		},
		cursor			: null,
		centerX			: true,
		centerY			: true,
		iframeSrc		: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank",

		bindEvents		: false,
		constrainTabKey	: false
	}
	var uiCorpAttachmentDialog	= {
		css				: {
			padding			: 0,
			margin			: 0,
			border			: "0px solid #aaaaaa",
			width			: "auto",
			height			: "auto",
			top				: "0px",
			cursor			: "default"
		},
		overlayCSS		: {
			backgroundColor	: "#000000",
			opacity			: "0.8",
			cursor			: null
		},
		showOverlay		: true,
		fadeIn			: 0,
		fadeOut			: 0,

		cursor			: null,
		centerX			: true,
		centerY			: true,

		bindEvents		: false,
		constrainTabKey	: false
	}

	var uiEditAttachmentDialog	= {
		css				: {
			padding			: 0,
			margin			: 0,
			border			: "0px solid #aaaaaa",
			width			: "auto",
			height			: "auto",
			left			: 0,
			top				: 0
		},
		overlayCSS		: {
			backgroundColor	: "#000000",
			opacity			: "0.8",
			cursor			: null
		},
		cursor			: null,
		centerX			: true,
		centerY			: true,
		iframeSrc		: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank",

		bindEvents		: false,
		constrainTabKey	: false
	}

	var uiDialogArticle			= {
		css				: {
			padding			: 0,
			margin			: 0,
			border			: "0px solid #aaaaaa",
			width			: "auto",
			height			: "auto",

			cursor			: "default"
		},
		overlayCSS		: {
			backgroundColor	: "#000000",
			opacity			: "0.8",
			cursor			: null
		},
		showOverlay		: true,
		fadeIn			: 0,
		fadeOut			: 0,

		bindEvents		: false,	//block内容的键或鼠标事件将被禁用
		constrainTabKey	: true,		//默认情况下，blockUI将会抑制tab导航到block的内容之外（在bindEvents为true的情况下）

		allowBodyStretch: true,		//在IE6下允许body元素被拉伸，将会使block看起来更好一些，如果你想禁止改变高度可以将其禁用
		focusInput		: true,		//在page blocking时，如果为true将会把焦点放在第一个可用的输入域中
		forceIframe		: false,	//在非IE浏览器中强制使用iframe(handy for blocking applets)
		cursor			: null,
		centerY			: true
	}

	var uiDialogGMap				= {
		css				: {
			padding			: 0,
			margin			: 0,
			border			: "0px solid #aaaaaa",
			cursor			: "default"
		},
		overlayCSS		: {
			backgroundColor	: "#000000",
			opacity			: "0.8",
			cursor			: null
		},
		showOverlay		: true,
		fadeIn			: 0,
		fadeOut			: 0,

		bindEvents		: true,		//block内容的键或鼠标事件将被禁用
		constrainTabKey	: true,		//默认情况下，blockUI将会抑制tab导航到block的内容之外（在bindEvents为true的情况下）

		allowBodyStretch: true,		//在IE6下允许body元素被拉伸，将会使block看起来更好一些，如果你想禁止改变高度可以将其禁用
		focusInput		: true,		//在page blocking时，如果为true将会把焦点放在第一个可用的输入域中
		cursor			: null,
		centerY			: true
	}

