
//date function
RightNow=new Date();
var themonth;
var month=RightNow.getMonth()+1;
if (month==1) themonth = "January";
if (month==2) themonth = "February";
if (month==3) themonth = "March";
if (month==4) themonth = "April";
if (month==5) themonth = "May";
if (month==6) themonth = "June";
if (month==7) themonth = "July";
if (month==8) themonth = "August";
if (month==9) themonth = "Sep";
if (month==10) themonth = "October";
if (month==11) themonth = "Nov";
if (month==12) themonth = "Dec";

var date=RightNow.getDate();
var year=RightNow.getYear();
var day=RightNow.getDay();
if (year==100){year="2000";}
if (year==101){year="2001";}
if (year==102){year="2002";}
if (year==103){year="2003";}
if (year==104){year="2004";}
if (year==105){year="2005";}


//preload nav rollovers
for(q=0;q<11;q++)
{
eval("n"+q+"On = new Image()")
eval("n"+q+"On.src = '/image/Manualbar/nav"+q+"_On.gif'")
eval("n"+q+"Off = new Image()")
eval("n"+q+"Off.src = '/image/Manualbar/nav"+q+".gif'")
}



//rollover function

function roll(sec,num,state,layer)
{
if (layer=="") eval("document.images['"+ sec + num + "'].src =" + sec + num + state + ".src;");
else 
 {
  if (document.all) {
  	eval("document.images['"+ sec + num + "'].src =" + sec + num + state + ".src;");
  }	
  if (document.layers){
  	  eval("document.layers."+layer+".document.images['" + sec + num + "'].src = " + sec + num + state + ".src;");
  }	  
  if (!document.all && document.getElementById) {
  	eval("document.getElementById('" + sec + num + "').src = " + sec + num + state + ".src;");
  }	
 }
}



//set up layer call
var isIE, isNS, isNS6, isDOM, lR, sR, vis, invis, myTimeOut, goName;
	if (document.all) {isIE= true;lR="document.all.";sR=".style";vis="visible";invis="hidden";}
	if (document.layers){isNS = true;lR="document.layers.";sR="";vis="show";invis="hide";}
	if (document.getElementById &&!isIE) {isDOM=true;lR = "document.getElementById('";sR = "').style";invis ="hidden";vis = "visible"}
	if (isDOM == true && navigator.appName =="Netscape") isNS6 = true;
	
var oldwhich = 1;
var x=0;
var layerTimer;
	
//turn on layer and rollover
	function layOver(which)
	{
	x=0;
	l = eval(lR + "l" + which + sR);
	eval("roll('n',"+which+",'On','lN')")
	if (oldwhich != which)
	{
		ol = eval(lR + "l" + oldwhich + sR);
		eval("roll('n',"+oldwhich+",'Off','lN')")
		ol.visibility = invis;
	}
	l.visibility = vis;
	oldwhich = which;
	clearTimeout(layerTimer);
	return;
	}

//turn off layer and rollover if user is completely off nav 

	function stopOver()
	{
		//add by jami start 
		//加個flg判斷，若x>5的話就不再下跑，以免造成無窮迴圈
		//可是，若x>5就不執行的話，會產生什麼現象呢？
		var  tmpGoOrNot='go'
		//add by jami end
		//為什麼這裡要用5呢？←add by jami

		if (x<5) x++;
		else
		{
		ol = eval(lR + "l" + oldwhich + sR);
		ol.visibility = invis;
		eval("roll('n',"+oldwhich+",'Off','lN')")
		x=0;
		tmpGoOrNot='no'
		return 
		}

	if (tmpGoOrNot=='go')
		{
	   	 layerTimer = setTimeout("stopOver()",150)
		}
	}

//reset the timer
	function startOver()
	{
	x=0
	clearTimeout(layerTimer);
	}

//change subnav background color (ie5+ ns6+)
	function changebg(item, color)
{
	if (document.getElementById)
	{
	theone = eval("document.getElementById('"+item+"')")
	theone.style.background = color
	}	
}


//netscape resize bug fix
function NSresize() {
  if (document.FIX.NSfix.initWindowWidth != window.innerWidth || document.FIX.NSfix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function NSCheck() {
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.FIX == 'undefined'){
      document.FIX = new Object;
    }
    if (typeof document.FIX.FIX_scaleFont == 'undefined') {
      document.FIX.NSfix = new Object;
      document.FIX.NSfix.initWindowWidth = window.innerWidth;
      document.FIX.NSfix.initWindowHeight = window.innerHeight;
    }
    window.onresize = NSresize;
  }
}

NSCheck()


var goTimer = 0;
var goNum = 1;
var animLayerCount =3;
var Pausecount = 100;


function setUp()
	{
		for (i=1; i < animLayerCount; i++){
		layer = eval(lR + "z" + i + sR);
		if (isIE) layer.pixelLeft = -320;
		else layer.left = -320;
		layer.visibility = vis;
		}
	}