/////////////////////////////////////////////////////////
// JavaScript Until Function Document
/////////////////////////////////////////////////////////
/*--------------------------------------------------------
取得一個HTML DOM對像
-------------------------------------------------------*/
function Get(objectId){
	if(document.getElementById&&document.getElementById(objectId)){
		return document.getElementById(objectId);
	}else if(document.all&&document.all(objectId)){
		return document.all(objectId);
	}else if(document.layers&&document.layers[objectId]){
		return document.layers[objectId];
	}else{
		return false;
	}
}
/*--------------------------------------------------------
創建一個XMLHttpRequest
xmlHttpRequest = getXMLHttpRequest();
-------------------------------------------------------*/
function GetXMLHttpRequest(){
	if(window.XMLHttpRequest){
		return new XMLHttpRequest();
	}else if (window.ActiveXObject){
		request = new ActiveXObject("Microsoft.XMLHTTP");
		if (!request){
			request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		return request;
	}
}
/*--------------------------------------------------------
添加事件
-------------------------------------------------------*/
function AddHandler(hobj,e,pFn){
	if(hobj.addEventListener){hobj.addEventListener(e.substring(2),pFn,false);}
	else if(hobj.attachEvent){hobj.attachEvent(e,pFn);}
	else{var punk = hobj[e];if(punk == null){hobj[e] = pFn;} else {hobj[e] = function(){punk();pFn();}}}
}
/*--------------------------------------------------------
移除事件
-------------------------------------------------------*/
function RemoveHandler(hobj,e,pFn){
	if(hobj.removeEventListener){hobj.removeEventListener(e.substring(2),pFn,false);}
	else if(hobj.detachEvent){hobj.detachEvent(e,pFn);
	}else{var punk=hobj[e];if(punk!=null){hobj[e]=null}}
}
/*--------------------------------------------------------
FCKeditor
取得編輯器內的值,帶上html標簽
-------------------------------------------------------*/
function GetEditorHTMLContents(EditorName) { 
    var oEditor = window.FCKeditorAPI.GetInstance(EditorName); 
    return(oEditor.GetXHTML(true)); 
}
/*--------------------------------------------------------
FCKeditor
取得編輯器內的值,不帶上html標簽
-------------------------------------------------------*/
function GetEditorTextContents(EditorName) {
	var oEditor = window.FCKeditorAPI.GetInstance(EditorName);
	return(oEditor.EditorDocument.body.innerText);
}
/*--------------------------------------------------------
FCKeditor
設定編輯器內的值
-------------------------------------------------------*/
function SetEditorContents(EditorName, ContentStr) {
	var oEditor = FCKeditorAPI.GetInstance(EditorName) ;
	oEditor.SetHTML(ContentStr) ;
}

/*--------------------------------------------------------
取得mouse 的坐標
-------------------------------------------------------*/
function GetXY(){
	var x=0,y=0;
	var e=event;
	if(null==e)e=event;
	y=e.clientY?e.clientY+document.documentElement.scrollTop:e.pageY;
	x=e.clientX?e.clientX+document.documentElement.scrollLeft:e.pageX;
	return [x,y];//返回一個數組
}
/*--------------------------------------------------------
取得某一元素的絕對位置
-------------------------------------------------------*/
function GetElementPos(obj){   
    var left = 0;   
    var top = 0;   
    if(obj.x){   
        left= obj.x;   
        top = obj.y;   
    }else if(obj.offsetParent){      
        while(obj.offsetParent){          
            left += obj.offsetLeft;   
            top  += obj.offsetTop;   
            obj = obj.offsetParent;   
        }    
    }   
    return [left,top];//返回一個數組
} 
/*--------------------------------------------------------
寫入Cookie
-------------------------------------------------------*/
function SetCookie(name,value,Days){
    //var Days = 30;
    var exp  = new Date();    //new Date("December 31, 9998");
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
/*--------------------------------------------------------
取得Cookie
-------------------------------------------------------*/
function GetCookie(name){
	var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
	if(arr != null) return unescape(arr[2]); return null;
}
/*--------------------------------------------------------
刪除Cookie
-------------------------------------------------------*/
function DelCookie(name){
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval=getCookie(name);
    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}
/*--------------------------------------------------------
生成縮圖
-------------------------------------------------------*/
function DrawImage(ImgD, iwidth, iheight) {
	var image = new Image();
	image.src = ImgD.src;
	if (image.width > 0 && image.height > 0) {//圖片的長和寬都必需大於0
		if (image.width / image.height >= iwidth / iheight) {//長和寬大於指定的長和寬時縮小圖片
			if (image.width > iwidth) {
				ImgD.width = iwidth;
				ImgD.height = (image.height * iwidth) / image.width;
			} else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
		} else {
			if (image.height > iheight) {
				ImgD.height = iheight;
				ImgD.width = (image.width * iheight) / image.height;
			} else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
		}
	}
}
/*--------------------------------------------------------
生成縮圖,特用於在div中無法居中對齊的時候
-------------------------------------------------------*/
function DrawImage1(ImgD, iwidth, iheight , iDivHeight) {
	var image = new Image();
	image.src = ImgD.src;
	if (image.width > 0 && image.height > 0) {//圖片的長和寬都必需大於0
		if (image.width / image.height >= iwidth / iheight) {//長和寬大於指定的長和寬時縮小圖片
			if (image.width > iwidth) {
				ImgD.width = iwidth;
				ImgD.height = (image.height * iwidth) / image.width;
			} else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
		} else {
			if (image.height > iheight) {
				ImgD.height = iheight;
				ImgD.width = (image.width * iheight) / image.height;
			} else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
		}
		//ImgD.setAttribute("style","margin-top:" + (iDivHeight-ImgD.height)/2 + "px;");
		ImgD.style.margin=(iDivHeight-ImgD.height)/2 + "px 0 0 0";
		//ImgD.setAttribute("style","margin-top:20px;");
	}
}
/*--------------------------------------------------------
驗讓是否有漢字
-------------------------------------------------------*/
function CheckHaveChina(str){
  if(/[^\x00-\xff]/.test(str)){
		return true;
	}else{
		return false;
	}
}
/*--------------------------------------------------------
//返回字符的長度,一個漢字算2個字節數
-------------------------------------------------------*/
function GetStringLenth(str,gbklen){
	str=ltrim(str);
	if(2==gbklen) {
    	str=str.replace(/[^\x00-\xff]/g,'**');
	}
	return str.length;
}
/*--------------------------------------------------------
去兩邊的空格
-------------------------------------------------------*/
function Trim(str){
	return str.replace(/(^\s*)|(\s*$)/g,'');
}
/*--------------------------------------------------------
去左邊的空格
-------------------------------------------------------*/
function Ltrim(str){
	return str.replace(/(^\s*)/g,'');
}
/*--------------------------------------------------------
去右邊的空格
-------------------------------------------------------*/
function Rtrim(str){
	return str.replace(/(\s*$)/g,'');
}
/*--------------------------------------------------------
HTML過濾函數
-------------------------------------------------------*/
function HTMLEncode(text){
	text = text.replace(/&/g, "&amp;");
	text = text.replace(/"/g, "&quot;");
	text = text.replace(/</g, "&lt;");
	text = text.replace(/>/g, "&gt;");
	text = text.replace(/'/g, "&#146;");
	return text ;
}
/*--------------------------------------------------------
驗證http://url地址
-------------------------------------------------------*/
function IsHttpUrl(url){
	var Reg=/^https?:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^\"\"])*$/;
	if(url==''){
		return true;
	}else{
		return Reg.test(url);
	}
}
/*--------------------------------------------------------
驗證EMAIL
-------------------------------------------------------*/
function IsEmail(sEmail){
	var regEx=/^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
	if (sEmail!=''){
    if(regEx.test(sEmail)){
      return true;
	  }else{
	    return false;		
    }
	}else{
		return true;
	}	
}
/*--------------------------------------------------------
//驗證是不是一個數字
/// 1: 正整數 
/// 2: 非負整數（正整數 + 0)
/// 3: 非正整數（負整數 + 0）
/// 4: 負整數 
/// 5: 整數
/// 6: 非負浮點數（正浮點數 + 0）
/// 7: 正浮點數
/// 8: 非正浮點數（負浮點數 + 0)
/// 9: 負浮點數 
/// 10: 浮點數
-------------------------------------------------------*/
function CheckNum(obj,t){
	var regEx='',msg='';
	var a=parseInt(t);
	switch(a){
		case 1:
		  	regEx=/^[0-9]*[1-9][0-9]*$/;
			msg='请输入大于零的整数';
			break;
		case 2:
		  	regEx=/^\d+$/;
			msg='请输入大于等于零整数';
			break;
		case 3:
		  	regEx=/^((-\d+)|(0+))$/;
			msg='请输入小于等于零的整数';
			break;
		case 4:
		  	regEx=/^-[0-9]*[1-9][0-9]*$/;
			msg='请输入小于零的整数';
			break;
		case 5:
		  	regEx=/^-?\d+$/;
			msg='请输入整数';
			break;
		case 6:
		  	regEx=/^\d+(\.\d+)?$/;
			msg='请输入大于等于零的数值';
			break;
		case 7:
		  	regEx=/^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/;
			msg='请输入大于零的数值';
			break;
		case 8:
		  	regEx=/^((-\d+(\.\d+)?)|(0+(\.0+)?))$/;
			msg='请输入小于等于零的数值';
			break;
		case 9:
		  	regEx=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;
			msg='请输入小于零的数值';
		case 10:
		  	regEx=/^(-?\d+)(\.\d+)?$/;
			msg='请输入数值';
			break;
		default:
		  	regEx='';
			break;
	}
	if (obj.value!='' && regEx!=''){
    	if(regEx.test(obj.value)){
      		return true;
	  	}else{
      		alert(msg);
	    	obj.focus();
	    	obj.select();
	    	return false;		
    	}
	}else{
		return true;
	}
}
/*--------------------------------------------------------
驗證字符是不是全是數字
-------------------------------------------------------*/
function ChkNum(tempstr){
	ptempstr=new String("0123456789");
	for(i=0;i<tempstr.length;i++){
		if(ptempstr.indexOf(tempstr.charAt(i))==-1){
			return false;
		}
	}
	return true;
}
/*--------------------------------------------------------
驗證字符是不是全是字母
-------------------------------------------------------*/
function ChkAbc(tempstr){
	ptempstr=new String("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
	for(i=0;i<tempstr.length;i++){
		if(ptempstr.indexOf(tempstr.charAt(i))==-1){
			return false;
		}
	}
	return true;
}
/*--------------------------------------------------------
驗證字符是不是全是字母和數字
-------------------------------------------------------*/
function ChkAbcNum(tempstr){
	ptempstr=new String("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
	for(i=0;i<tempstr.length;i++){
		if(ptempstr.indexOf(tempstr.charAt(i))==-1){
			return false;
		}
	}
	return true;
}
/*--------------------------------------------------------
驗證日期
-------------------------------------------------------*/
function IsDate(sDate){
	var dateExp=/^([1-2]\d{3})[\/|\-](0?[1-9]|10|11|12)[\/|\-]([1-2]?[0-9]|0[1-9]|30|31)$/;
	if(dateExp.test(sDate)){
		return true;
	}else{
		return false;		
	}
}
/*--------------------------------------------------------
驗證日期帶時分
-------------------------------------------------------*/
function IsDateTime(dt) {
	if(dt!=""){
		//日期格式為2007/12/23 00:00 or 2007-12-23 00:00這個要考試到2月份的情況
		var dateExp=/^((((1[6-9]|[2-9]\d)\d{2})\/(0?[13578]|1[02])\/(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})\/(0?[13456789]|1[012])\/(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})\/0?2\/(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))\/0?2\/29)) (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$/;
		if(dateExp.test(dt)){
			return true;
		}else{
	    	return false;		
		}
	}else{
		return true;
	}
} 
/*--------------------------------------------------------
開啟一個新的窗口
-------------------------------------------------------*/
function OpenWin(url,winname,width,height,scrollbars,resizable){
	var sw = screen.availWidth;
	var sh = screen.availHeight;
	var newwin=window.open(url,winname,["toolbar=0,menubar=0,location=0,scrollbars="+scrollbars+",resizable="+resizable+",width="+width+",height="+height+",top="+((sh-height-20)*.5)+",left="+((sw-width-30)*.5)]);
	return newwin;
}
/*--------------------------------------------------------
開啟一個新的窗口
-------------------------------------------------------*/
function OpenDialogWin(url,winname,width,height,scrollbars,resizable){
	var newwin=window.showModalDialog(url,winname,"DialogWidth:"+width+"px;DialogHeight:"+height+"px;help:no;status:no;center:yes;resizable:"+resizable+";scroll:"+scrollbars);
	return newwin;
}
/*--------------------------------------------------------
刪除記錄時的確認
-------------------------------------------------------*/
function OnDelete(url,msg){
	msg = (msg==undefined) ? "确认要删除吗？":msg;
  	var answer=confirm(msg);
  	if (answer){
    	window.location.href = url;
  	}
}

/*--------------------------------------------------------
計算兩個日期相差的天數
-------------------------------------------------------*/
function DateDiff(sDate1,sDate2){    //sDate1和sDate2是2006-12-18格式
	var aDate,oDate1,oDate2,iDays;
 	if(sDate1.indexOf('-')!=-1){
   		aDate=sDate1.split('-');
   		oDate1=new Date(aDate[1]+'-'+aDate[2]+'-'+aDate[0]);//轉換為12-18-2006格式 
 	}else{
   		aDate=sDate1.split('/');
   		oDate1=new Date(aDate[1]+'-'+aDate[2]+'-'+aDate[0]);//轉換為12-18-2006格式 
 	}
 	if(sDate2.indexOf('-')!=-1){
	 	aDate=sDate2.split('-');  
   		oDate2=new Date(aDate[1]+'-'+aDate[2]+'-'+aDate[0]);
 	}else{
   		aDate=sDate2.split('/');  
   		oDate2=new Date(aDate[1]+'-'+aDate[2]+'-'+aDate[0]);
 	}
 	iDays=parseInt(Math.abs(oDate1-oDate2)/1000/60/60/24);    //把相差的ms轉換成天數
 	return iDays;  
}
/*--------------------------------------------------------
計算第一個日期是否在第二個日期前
-------------------------------------------------------*/
function DateComp(smallDate,bigDate){    //sDate1和sDate2是2006-12-18格式
	var aDate,oDate1,oDate2,iDays;
	if(smallDate.indexOf('-')!=-1){
  		aDate=smallDate.split('-');  
  		oDate1=new Date(aDate[1]+'-'+aDate[2]+'-'+aDate[0]);//轉換為12-18-2006格式 
	}else{
  		aDate=smallDate.split('/');  
  		oDate1=new Date(aDate[1]+'-'+aDate[2]+'-'+aDate[0]);//轉換為12-18-2006格式 
	}
	if(bigDate.indexOf('-')!=-1){
		aDate=bigDate.split('-'); 
    	oDate2=new Date(aDate[1]+'-'+aDate[2]+'-'+aDate[0]);  
	}else{
		aDate=bigDate.split('/'); 
    	oDate2=new Date(aDate[1]+'-'+aDate[2]+'-'+aDate[0]);  
	}
 	iDays=parseInt((oDate2-oDate1)/1000/60/60/24);    //把相差的ms轉換成天數
 	if (iDays>0 || iDays==0){
	 	return true;
 	}else{
	 	return false;
 	}
}  
/*--------------------------------------------------------
驗證是否符合給定的正則表達式
-------------------------------------------------------*/
function RunRegEx(RegEx,Str){
	if (Str!='' && RegEx!='' && Str!=null && RegEx!=null){
		if(eval(RegEx).test(Str)){
			return true;
		}else{
	    	return false;		
		}
	}
}
/*--------------------------------------------------------
取文件的副檔名
-------------------------------------------------------*/
////////////////////////////////////////////////////////
function GetFileExtName(file_str){
	var filename,ext;
	if(file_str!=''){
	  	filename=file_str.split('.');
		ext=filename[1].toString().toLowerCase();
	}else{
		ext='';
	}
	return ext;
}
/*--------------------------------------------------------
取文件的主檔名
-------------------------------------------------------*/
function GetFileName(obj1,obj2){
	if(obj1.value!=''){
		var a,b,c,n;
		a=obj1.value;
		b=a.split('\\');
		c=b[b.length-1];
		n=c.lastIndexOf(".");
		obj2.value=c.substring(0,n);
	}
}
/*--------------------------------------------------------
檢查文件是否在FileList中
-------------------------------------------------------*/
function CheckFileExt(arg,fileList){
	if (arg!=''){
	  	var file,fileExt,n;
		if((arg.indexOf("."))!=-1){
			n=arg.lastIndexOf(".")+1;
			fileExt=arg.substring(n,arg.length);
			if(fileList.indexOf(fileExt.toLowerCase())==-1){
				return false;
			}else{
				return true;
			}
		}else{
			return false;
		}
	}else{
	  	return true;
	}
}
/*--------------------------------------------------------
插入Flash
-------------------------------------------------------*/
function Flash(url,width,height){
	var agt = navigator.userAgent.toLowerCase();
	var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	if (is_ie) {
		document.write("<object classid=\"CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\""+width+"\" height=\""+height+"\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"movie\" value=\""+url+"\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"Opaque\"><param name=\"bgcolor\" value=\"#ffffff\" /><param name=\"flashVars\" value=\"\" /></object>");
	} else {
		document.write("<object classid=\"CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\""+width+"\" height=\""+height+"\" align=\"middle\"><embed src=\""+url+"\" quality=\"high\" wmode=\"Opaque\" bgcolor=\"#ffffff\" width=\""+width+"\" height=\""+height+"\" name=\"Demo\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>");
	}
}
/*--------------------------------------------------------
js查看圖片
<div id="ViewImageDiv" style="position:absolute;z-index:1;display:none;"></div>
onmouseover="ViewImage(this,true,image);" 
onmouseout="ViewImage(this,false,image);
-------------------------------------------------------*/
function ViewImage(obj,ViewBoolean,image_src){
	if(ViewBoolean){
		var offsetWidth=document.body.offsetWidth/2;
		var pos = GetElementPos(obj);
		var x=pos[0];
		var y=pos[1];
		var image = new Image();
		image.src = image_src;
		if(x>offsetWidth){
			x=x-image.width-30;
		}else{
			x=x+30;
		}
		var s='';
		s+='<img src="'+image_src+'" style="border:10px #ccc solid;" />';
		$("#ViewImageDiv").empty().append(s);
		$("#ViewImageDiv").css({left:x,top:y,display:''});
	}else{
		$("#ViewImageDiv").css({display:'none'});
	}
}
/*--------------------------------------------------------
js查看圖片
<div id="ViewImageDiv" style="position:absolute;z-index:1;display:none;"></div>
onmouseover="ViewImage(this,true,image);" 
onmouseout="ViewImage(this,false,image);
-------------------------------------------------------*/
function ViewImage1(obj,ViewBoolean,image_src,iWidth,iHeight){
	if(ViewBoolean){
		var offsetWidth=document.body.offsetWidth/2;
		var pos = GetElementPos(obj);
		var x=pos[0];
		var y=pos[1];
		if(x>offsetWidth){
			x=x-iWidth-30;
		}else{
			x=x+30;
		}
		var s='';
		s+='<img src="'+image_src+'" style="border:10px #ccc solid;cursor:pointer;" width="'+iWidth+'" height="'+iHeight+'" onclick="Get(\'ViewImageDiv\').style.display=\'none\';" alt="点击关闭" />';
		$("#ViewImageDiv").empty().append(s);
		$("#ViewImageDiv").css({left:x,top:y,display:''});
	}else{
		$("#ViewImageDiv").css({display:'none'});
	}
}
function ViewImage2(obj,ViewBoolean,image_src){
	if(ViewBoolean){
		var offsetWidth=document.body.offsetWidth/2;
		var pos = GetElementPos(obj);
		var x=pos[0];
		var y=pos[1];
		var image = new Image();
		image.src = image_src;
		
		if(x>offsetWidth){
			x=x-image.width-30;
		}else{
			x=x+30;
		}
		var s='';
		s+='<img src="'+image_src+'" style="border:10px #ccc solid;cursor:pointer;" onclick="Get(\'ViewImageDiv\').style.display=\'none\';" alt="点击关闭" />';
		$("#ViewImageDiv").empty().append(s);
		$("#ViewImageDiv").css({left:x,top:y,display:''});
	}else{
		$("#ViewImageDiv").css({display:'none'});
	}
}

/*--------------------------------------------------------
javascript取屏幕信息的一些對像 
-------------------------------------------------------*/
function DisplayScreenInfo(){
	var bodyWidth =document.body.clientWidth; 					//網頁可見區域寬
	var bodyHeight =document.body.clientHeight; 				//網頁可見區域高
	var bodyWidthWithBorder =document.body.offsetWidth; 		//網頁可見區域寬(包括邊線的寬)
	var bodyHeightWithBorder=document.body.offsetHeight; 		//網頁可見區域高(包括邊線的寬)
	var bodyWidthWithScroll =document.body.scrollWidth; 		//網頁正文全文寬
	var bodyHeightWithScroll=document.body.scrollHeight; 		//網頁正文全文高
	var bodyTopHeight =document.body.scrollTop; 				//網頁被卷去的上邊距
	var bodyLeftWidth =document.body.scrollLeft; 				//網頁被卷去的左邊距
	var windowTopHeight =window.screenTop; 						//網頁正文部分上邊距
	var windowLeftWidth =window.screenLeft; 					//網頁正文部分左邊距
	var screenHeight =window.screen.height; 					//螢幕解析度的高
	var screenWidth =window.screen.width; 						//螢幕解析度的寬
	var screenAvailHeight =window.screen.availHeight; 			//螢幕可用工作區高度
	var screenAvailWidth =window.screen.availWidth; 			//螢幕可用工作區寬度

	var Str="";
	Str+="网页可见区域宽:"+bodyWidth+"px\n";
	Str+="网页可见区域高:"+bodyHeight+"px\n";
	Str+="网页可见区域宽(包括边线的宽):"+bodyWidthWithBorder+"px\n";
	Str+="网页可见区域高(包括边线的宽):"+bodyHeightWithBorder+"px\n";
	Str+="网页正文全文宽:"+bodyWidthWithScroll+"px\n";
	Str+="网页正文全文高:"+bodyHeightWithScroll+"px\n";
	Str+="网页被卷去的上边距:"+bodyTopHeight+"px\n";
	Str+="网页被卷去的左边距:"+bodyLeftWidth+"px\n";
	Str+="网页正文部分上边距:"+windowTopHeight+"px\n";
	Str+="网页正文部分左边距:"+windowLeftWidth+"px\n";
	Str+="屏幕分辨率的高:"+screenHeight+"px\n";
	Str+="屏幕分辨率的宽:"+screenWidth+"px\n";
	Str+="屏幕可用工作区高度:"+screenAvailHeight+"px\n";
	Str+="屏幕可用工作区宽度:"+screenAvailWidth+"px\n";
	alert(Str);
}
/**********************************jQuery UI Function******************************************/
function split( val ) {
	return val.split( /,\s*/ );
}
function extractLast( term ) {
	return split( term ).pop();
}
