﻿<!--

if (typeof(km_scripts) == 'undefined') var km_scripts = new Object();
km_myclass_import('../Common/ui/jquery-latest.pack.js');
km_myclass_import('../Common/ui/ui.scrollPane.js');

function km_myclass_import(jsFile) {
  if (km_scripts[jsFile] != null) return;
  var scriptElt = document.createElement('script');
  scriptElt.type = 'text/javascript';
  scriptElt.src = jsFile;
  document.getElementsByTagName('head')[0].appendChild(scriptElt);
  km_scripts[jsFile] = jsFile; // or whatever value your prefer
}


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){
  
	var docs = document.getElementById('RangeContent');	
	if(docs){
		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);
		
		docs.style.fontSize = currentTextSize + '%';
		//docs.style.lineHeight = currentLineHeight +'px';

		if(document.getElementById("ctl00_wucBag_imgpt0")){
			for( var ix=0; ix<imgArr.length; ix++){
				if(imgArr[ix]==size){				
					document.getElementById("ctl00_wucBag_imgpt" + ix).src="../images/ico_pt"+ ix +"_2.gif";
				}else{
					document.getElementById("ctl00_wucBag_imgpt" + ix).src="../images/ico_pt"+ ix +".gif";	
				}
			}
		}
	}	
}

//頁籤
function initTagElement(iPos, iLang, iName, iPath){
    if(iPath.indexOf("style")>0){
        iPath = iPath + iPos +"_"+ iLang;
    }else{
        iPath = iPath + iPos;
    };  
    $("#pan"+ iName +"1").css("background-image","url(" + iPath +".gif)");
    $("#pan"+ iName +"1 > .sence0").css("display","none");
    $("#pan"+ iName +"1 > .sence1").css("display","none");
    $("#ifax"+ iName + iPos).show();
}

//首頁推薦景點換圖
function initSceneImg(iPath, iHead){
    $("#imgA1").attr("src", iPath);
    $("#imgA1").attr("alt", iHead);
}

function initRecommend(iSNo, iLang){   //景點推廌
    $("#ifaxRecommend").load("../user/ajaxExec.aspx?Lang="+iLang, { iDo:"P", SNo:iSNo});
    $("#btnRecommend").fadeOut("slow"); 
}


function init_flash(w){	
	var fw = 0;
	var pos = "M";
	var docs = document.getElementById('dFlayer');	
	if(docs){	
		if(pos=="M"){	//置中
			fw = (screen.width-w)/2;
		}else{
			fw = 0;
		}
		docs.style.position = "absolute";
		docs.style.left = fw + "px";
		docs.style.top = "0px";
	}
}

function showBig(iLang, iThum, iSNo){
    $("#bigPhoto").load("../user/ajaxExec.aspx?Lang="+iLang, { iDo:"B", SNo:iSNo, thum:iThum });  

}

-->




