// JavaScript Document


function fullscreen(){
        document.getElementById("nibiFrame").height = document.documentElement.clientHeight-50;
}
//window.onresize = function() {
//        fullscreen()
//}


//設定為上層視窗
if (window != top) top.location.href=location.href;

function callit(){
        document.getElementById("nibiFrame").height = nibiFrame.document.body.scrollHeight;
}


function markNode(k){
	//清除前一次點選所標記的tag
    var aAmount = document.getElementsByTagName('a');
    for(var i = 0; i < aAmount.length; i++)aAmount[i].removeAttribute("style");

    var isIE = navigator.appName.indexOf("Microsoft") != -1;//判斷瀏覽器
    while (k.nodeName == "LI"){//注意節點名稱須大寫
	  if(isIE){
		  k.childNodes[0].style.setAttribute("cssText","color:#f4811f")}
	  else{
		  k.childNodes[0].setAttribute("style","color:#f4811f;");}
	  k = k.parentNode.parentNode;
    } 
}
ddsmoothmenu.init({
	mainmenuid: "smoothmenu1", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})



function addcss(k){
	document.getElementById("brand_css").href = "nibi/"+k+".css";
}




//以下為下載兌換券變色文字
var colors=new Array();
	colors[0] = 0;
	colors[1] = "#FF4500";
	colors[2] = "#FF9900";
	colors[3] = "#FFD700";
	colors[4] = "#7FFF00";
	colors[5] = "#1E90FF";
	colors[6] = "#DB7093";
	colors[7] = "#6A5ACD";
	
function colorFont() {
	if(document.getElementById('colorfont')){
	if (++colors[0]==colors.length) colors[0]=1;
		document.getElementById('colorfont').style.color = colors[colors[0]];
		window.tm=setTimeout('colorFont()',500)}}


//品牌更換時底色更換
//function bgcolor(newcolor){
//if (newcolor==null) {//表示沒有需求回到基本色  
//	document.getElementsByTagName("body")[0].style.backgroundColor = "#CCCCCC";
//	document.getElementById("container").style.backgroundColor = "#000000";
//	document.getElementById("header").style.backgroundColor = "#CCCCCC";
//	document.getElementById("logo").src = "nibi/images/logo_nibi.gif";
//	document.getElementById("leftbar").innerHTML = "";
//	}
//else{	
//	switch (newcolor){//表示有底色更換需求
//		case "black":
//			document.getElementsByTagName("body")[0].style.backgroundColor = "#000000";
//			document.getElementById("container").style.backgroundColor = "#000000";
//			document.getElementById("header").style.backgroundColor = "#000000";
//			document.getElementById("logo").src = "nibi/images/logo_nibi_black.gif";
//			document.getElementById("leftbar").innerHTML = "<img src='nibi/images/bar_black.jpg' width='15' height='500' border='0' />";
//			break;
//		case "green":
//            document.getElementsByTagName("body")[0].style.backgroundColor = "#1A4939";
//	        document.getElementById("container").style.backgroundColor = "#000000";
//	        document.getElementById("header").style.backgroundColor = "#1A4939";
//	        document.getElementById("logo").src = "nibi/images/logo_nibi_green.gif";
//	        document.getElementById("leftbar").innerHTML = "";
//			break;
//		case "darkgray":
//			document.getElementsByTagName("body")[0].style.backgroundColor = "#575757";
//	        document.getElementById("container").style.backgroundColor = "#000000";
//	        document.getElementById("header").style.backgroundColor = "#575757";
//	        document.getElementById("logo").src = "nibi/images/logo_nibi_darkgray.gif";
//	        document.getElementById("leftbar").innerHTML = "";
//	        break;
//	    case "white":
//			document.getElementsByTagName("body")[0].style.backgroundColor = "#ffffff";
//	        document.getElementById("container").style.backgroundColor = "#ffffff";
//	        document.getElementById("header").style.backgroundColor = "#ffffff";
//	        document.getElementById("logo").src = "nibi/images/logo_nibi.gif";
//	        document.getElementById("leftbar").innerHTML = "";
//	        break;
//		}
//	}
//}
  
//要更換的圖片必須先進行proload否則於切換時會無法與主機斷線
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


