/*function openWin(theURL,winName,features,opener) { //v2.0
	popUp=window.open(theURL,winName,features);
	popUp.opener=opener;
}
	*/
function preload_image() {
	if ( document.images ){
		var preload = new Array()
		
		preload[0] = "images/menu13_o.jpg";
		preload[1] = "images/menu21_o.jpg";
				
		for ( var i in preload ){
			var I = new Image();
			I.src = preload[i];
			preload[i] = I
		}

	}
}
/*
function simg(obj,url)
{
	if (document.images){
		eval("document.images." + obj + ".src = " + url+ ";")
	}
}

*/
function overMenu(obj)
{
	
        if (document.images){
        	var s_topic =  obj;
			eval("document.images.menu" + s_topic + ".src = 'images/menu" + s_topic + "_o.jpg';")
        }
}

function outMenu(obj)
{	
        if (document.images){
        	var s_topic =  obj;
			eval("document.images.menu" + s_topic + ".src = 'images/menu" + s_topic + ".jpg';")
        }
}

function overSub(obj)
{	
        if (document.images){
        	var s_topic =  obj;
			eval("document.images.sub" + s_topic + ".src = 'images/sub" + s_topic + "_o.jpg';")
        }
}

function outSub(obj)
{	
        if (document.images){
        	var s_topic =  obj;
			eval("document.images.sub" + s_topic + ".src = 'images/sub" + s_topic + ".jpg';")
        }
}
function outLeftMenu(i_topic)
{
	//if (i_topic != intTopicID) {
        if (document.images){
        	var s_topic =  i_topic;
			eval("document.images.menu" + s_topic + ".src = 'images/menu" + s_topic + ".jpg';")
        }
   // }
    show_hide_DIV(i_topic,false);
}

function overLeftMenu(i_topic)
{
	//if (i_topic != intTopicID) {
        if (document.images){
        	var s_topic = i_topic;
			eval("document.images.menu" + s_topic + ".src = 'images/menu" + s_topic + "_o.jpg';")
      //  }
    }
    show_hide_DIV(i_topic,true);
}

function show_hide_DIV(i_layer, b_show) {
  var s_show, obj=MM_find_Obj("topic" + i_layer);
  if (obj) {
  	if (obj.style) { obj=obj.style; s_show = b_show ? "visible" : "hidden";}
	else { s_show = b_show ? "show" : "hide"; }
    obj.visibility = s_show;
  }
}

function MM_find_Obj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_findObj(n, d) { //v3.0
  	var p,i,x;  
	if(!d) d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
    	d=parent.frames[n.substring(p+1)].document; 
		n=n.substring(0,p);
	}
  	if(!(x=d[n])&&d.all) x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) 
		x=d.forms[i][n];
  		for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
			x=MM_findObj(n,d.layers[i].document); 
			return x;
}

function PopWin(url,page,x,y)
{
	eval("nw = window.open(url, page,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,pageXOffset=300,pageYOffset=500,top=80,left=150,width=" + x + ",height=" + y + "')");
	
	        if ( nw.focus != null)
			{
	        	nw.focus();
			}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function isNumber( str ){
 	if( str.length == 0 ) return false;
 	for( var loc=0; loc<str.length; loc++ )
 		if( (str.charAt(loc) < '0') || (str.charAt(loc) > '9') ) return false;
 	return true;	
}
 	
function trim(strText){ 
  while (strText.substring(0,1) == ' ') 
    strText = strText.substring(1, strText.length);
  while (strText.substring(strText.length-1,strText.length) == ' ')
    strText = strText.substring(0, strText.length-1);
  return strText;
} 

function minLength(inputString,inputLength)
{
  return (inputString.length >= inputLength) ? true : false;
}  

function fullScreen(theURL) {
winvar = window.open(theURL, 'winname', 'fullscreen=yes, scrollbars=auto');
}

<!--
function makeArray(n) {
this.length = n;
}
function stopBanner() {
if (bannerRunning) clearTimeout(timerID);
bannerRunning = false;
}
function startBanner() {
stopBanner();
showBanner();
}
function showBanner() {
var text = ar[currentMessage];
if (offset < text.length) { 
if (text.charAt(offset) == " ") offset++;
var partialMessage = text.substring(0, offset + 1);
window.status = partialMessage;
document.title = "大埔浸信會 - "+partialMessage;
offset++; 
timerID = setTimeout("showBanner()", speed);
bannerRunning = true; 
} else {
offset = 0;
currentMessage++;
if (currentMessage == arlength)
currentMessage = 0; 
timerID = setTimeout("showBanner()", pause);
bannerRunning = true; 
}} 
var speed = 300 
var pause = 2000 
var timerID = null; 
var bannerRunning = false;
var currentMessage = 0;
var offset = 0; 
var arlength = 9; 
var ar = new makeArray(arlength);
ar[0] = "歡迎來到大埔浸信會";
ar[1] = "歡迎歡迎";
ar[2] = "與神同行" ;
ar[3] = "約壹3:18「小子們哪，我們相愛，不要只在言語和舌頭上，總要在行為和誠實上。」";
ar[4] = "腓2:3-4「凡事不可結黨，不可貪圖虛浮的榮耀；只要存心謙卑，各人看別人比自己強。各人不要單顧自己的事，也要顧別人的事。」";
ar[5] = "腓2:5「你們當以基督耶穌的心為心。」";
ar[6] = "林前13:7「凡事包容，凡事相信，凡事盼望，凡事忍耐。」";
ar[7] = "來12:14「你們要追求與眾人和睦，並要追求聖潔；非聖潔沒有人能見主。」";
ar[8] = "林前15:58「所以，我親愛的弟兄們，你們務要堅固，不可搖動，常常竭力多做主工；因為知道，你們的勞苦在主裡面不是徒然的。」";
 --> 