var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus_horizontal(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul");
    for (var t=0; t<ultags.length; t++){
		if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
			ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
		}
		else{ //else if this is a sub level menu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    	ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
		}
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.visibility="visible"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)

function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        //GEvent.addListener(map, "moveend", function() {
        //  var center = map.getCenter();
        //  document.getElementById("message").innerHTML = center.toString();
        //});
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(51.40006242865381, -0.771489143371582), 15);
		var point = new GLatLng(51.40006242865381, -0.771489143371582);
  		map.addOverlay(new GMarker(point));
		map.setMapType(G_HYBRID_MAP); 
      }
    }

/***********************************************

* JavaScript Image Clock- by JavaScript Kit (www.javascriptkit.com)
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more

***********************************************/

var imageclock=new Object()
	//Enter path to clock digit images here, in order of 0-9, then "am/pm", then colon image:
	imageclock.digits=["_images/_clock/c0.gif", "_images/_clock/c1.gif", "_images/_clock/c2.gif", "_images/_clock/c3.gif", "_images/_clock/c4.gif", "_images/_clock/c5.gif", "_images/_clock/c6.gif", "_images/_clock/c7.gif", "_images/_clock/c8.gif", "_images/_clock/c9.gif", "_images/_clock/cam.gif", "_images/_clock/cpm.gif", "_images/_clock/colon.gif"]
	imageclock.instances=0
	var preloadimages=[]
	for (var i=0; i<imageclock.digits.length; i++){ //preload images
		preloadimages[i]=new Image()
		preloadimages[i].src=imageclock.digits[i]
	}

	imageclock.imageHTML=function(timestring){ //return timestring (ie: 1:56:38) into string of images instead
		var sections=timestring.split(":")
		if (sections[0]=="0") //If hour field is 0 (aka 12 AM)
			sections[0]="12"
		else if (sections[0]>=13)
			sections[0]=sections[0]-12+""
		for (var i=0; i<sections.length; i++){
			if (sections[i].length==1)
				sections[i]='<img src="'+imageclock.digits[0]+'" />'+'<img src="'+imageclock.digits[parseInt(sections[i])]+'" />'
			else
				sections[i]='<img src="'+imageclock.digits[parseInt(sections[i].charAt(0))]+'" />'+'<img src="'+imageclock.digits[parseInt(sections[i].charAt(1))]+'" />'
		}
		return sections[0]+'<img src="'+imageclock.digits[12]+'" />'+sections[1]+'<img src="'+imageclock.digits[12]+'" />'+sections[2]
	}

	imageclock.display=function(){
		var clockinstance=this
		this.spanid="clockspan"+(imageclock.instances++)
		document.write('<span id="'+this.spanid+'"></span>')
		this.update()
		setInterval(function(){clockinstance.update()}, 1000)
	}

	imageclock.display.prototype.update=function(){
		var dateobj=new Date()
		var currenttime=dateobj.getHours()+":"+dateobj.getMinutes()+":"+dateobj.getSeconds() //create time string
		var currenttimeHTML=imageclock.imageHTML(currenttime)+'<img src="'+((dateobj.getHours()>=12)? imageclock.digits[11] : imageclock.digits[10])+'" />'
		document.getElementById(this.spanid).innerHTML=currenttimeHTML

	}
	
function clock() {
var curdate = new Date()
var year = curdate.getYear()
var month = curdate.getMonth()
var day = curdate.getDate()
var hour = curdate.getHours()
var minute = curdate.getMinutes()
var second = curdate.getSeconds()
var months = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")

var monthname = months[month]

if (hour > 12) {
hour = hour - 12
}

if (minute < 10) {
minute = "0" + minute
}

if (second < 10) {
second = "0" + second
}

document.title = "Great Hollands Free Church - " + monthname + " " + day + ", " + year + " - " + hour + ":" + minute + ":" + second

setTimeout("clock()", 1000)

}

function toggle(obj) {
	var el = document.getElementById(obj);
	if ( el.className == 'mphide') {
		el.className = 'mpshow';
	}
	else {
		el.className = 'mphide';
	}
}

function play(media) {
	var mp=document.getElementById('mp1');
	mp.innerHTML='<object id="MediaPlayer1" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows® Media Player components..." type="application/x-oleobject" width="100%" height="70"><param name="fileName" value="'+media+'"><param name="animationatStart" value="true"><param name="PlayCount" value="1"><param name="enableContextMenu" value="false"><param name="transparentatStart" value="true"><param name="autoStart" value="true"><PARAM name="uiMode" value="mini"><param name="ShowStatusBar" value="True"><param name="Volume" value="-450"></object>'
}


