﻿<!--

function createCookie(name,value,days){
	if (days){
		var date = new Date();
		date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
		var expires = "; expires=" + date.toGMTString();
	} else {
			var expires = "";
	}
	document.cookie = name + "=" + value + expires + "; path=/";
}

function get_text_cookie ( cookie_name ){
	  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );

	  if ( results ) {
		return ( unescape ( results[1] ) );
	  }
	  else { return null; }
}

//設定字級
function ResetFontSize(size, paths){
	var imgArr = ["100","120", "130"];
	var currentTextSize = 100;
	var currentLineHeight = null;
	if(size==""){	//預設載入時判斷
		if(get_text_cookie("RangeSize")) {				
				size = get_text_cookie("RangeSize");
		}else{
			size = "100";
			createCookie("RangeSize","100", 1000);
		}	
	}else{
		createCookie("RangeSize",size, 1000);
	}	

	currentTextSize = parseInt(size);
	currentLineHeight = parseInt((currentTextSize/10) * 2.4);
	
		var docs = document.getElementById('RangeContent');	
		
		if(docs==null) return;
		
		docs.style.fontSize= currentTextSize + '%';
		docs.style.lineHeight = currentLineHeight +'px';
		//alert(currentLineHeight)
//		for( var ij=0; ij<docs.getElementsByTagName("td").length; ij++){
//			docs.getElementsByTagName("td")[ij].style.fontSize = currentTextSize + '%';
//			docs.getElementsByTagName("td")[ij].style.lineHeight = currentLineHeight +'px';
//		}
	if(document.getElementById("imgpt0")){
		for( var ix=0; ix<imgArr.length; ix++){
			if(imgArr[ix]==size){		
				document.getElementById("imgpt" + ix).src="../images/" + paths + "ico_pt"+ ix +"_2.gif";	
			}else{
				document.getElementById("imgpt" + ix).src="../images/" + paths + "ico_pt"+ ix +".gif";	
			}
		}
	}
		
}
   
//不Reload執行
function ReceivedData(dat, content){
	document.getElementById("RangeContent").innerHTML = dat;
	//ResetFontSize('');
	//document.documentElement.scrollTop = 220;
}

function ReceivedPan(dat, content){
	document.getElementById("PanContent").innerHTML = dat;

}

function ReceivedMap(dat, content){
	document.all.MapContent.innerHTML = dat;
//	document.documentElement.scrollTop = 420;
}

//有下滑效果的~
function ReceivedDown(dat, content){	
	document.all.ifxElement.innerHTML = dat;
	$('#ifxElement').BlindDown(500);return false;

}

function showbox(objId){
    $("#" + objId).slideToggle("slow");
}

function popWin(link, w, h){  
   var winObject=null;	
   var fw = (screen.width-w)/2;
   var fh = (screen.height-h)/2;  
       winObject=window.open(link,'','scrollbars=1,width='+ w +',height='+ h +',top='+fh+',left='+fw);	
}


function get_return(ofile, w, h){
	var tmp = showModalDialog(ofile,'','dialogWidth:'+ w +'px; dialogHeight:'+ h +'px; status:0;help:0');
//	if (tmp != null){		
//		var ss;
//	
//		thisfrm.tAccount.value = ss[0];
//		thisfrm.tName.value = ss[1] + "（" + ss[2] + "）";
//	}
}

function setHome(){
    document.body.style.behavior='url(#default#homepage)';
    document.body.setHomePage(window.location.href);
}


function removeField(iPos){
    if(confirm('您確定要刪除此篇文章嗎?')){	
        $("#share" + iPos).fadeOut("slow", function(){
            $.post("../user/exec_sys.aspx", { doId:"R", sno:iPos});
        }); 
    }
}

//語音行動導覽目前項目
function SetCurrentItem(id) {
        $(".NavigationItem").css("display", "none");
        $("#item" + id).css("display", "block");
    }

-->