window.onload = loadData;

var rootURL="http://www.prayersong.net/";

var myPix = new Array(
"website pix/1.jpg","website pix/2.jpg","website pix/3.jpg","website pix/6.jpg","website pix/7.jpg",
"website pix/8.jpg","website pix/9.gif","website pix/10.jpg","website pix/12.jpg","website pix/12.jpg",
"website pix/13.jpg","website pix/14.jpg","website pix/15.jpg","website pix/16.jpg","website pix/17.jpg","website pix/18.jpg",
"website pix/19.jpg","website pix/20.jpg","website pix/21.jpg","website pix/22.jpg","website pix/23.jpg","website pix/24.jpg",
"website pix/25.jpg","website pix/26.jpg","website pix/27.jpg","website pix/28.jpg","website pix/29.jpg","website pix/30.jpg",
"website pix/31.jpg","website pix/32.jpg","website pix/33.jpg","website pix/34.jpg","website pix/35.jpg","website pix/37.jpg",
"website pix/38.jpg","website pix/39.jpg","website pix/40.jpg","website pix/41.jpg","website pix/42.jpg","website pix/43.jpg"
);

var monthNames = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var dayNames = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
      
var thisPic = 0;
var radioWin = null;
var lyricWindow = null;
var songWindow = null;
var reflectWindow = null;
var beyondWindow = null;
var requestWindow=null;
var IEWindow=null;
var msgWindow=null;
var homeWindow=null;
var infoWindow=null;
var thisPrayer=0;
var thisPsalm1=0;
var thisPsalm2=0;

var timerID = null;
var timerID2 = null;
var timerID3 = null;

var psalmArray = new Array(
"Happy are those whose delight is in the law of the Lord",
"Happy are those who take refuge in God",
"I cry aloud to the Lord, and He answers me from His holy hill",
"You alone, O Lord, make me lie down in safety",
"Let all who take refuge in God rejoice",
"The Lord accepts my prayer",
"I will sing praise to the name of the Lord, the Most high",
"O Lord, how majestic is your name in all the earth",
"I will sing praise to your name, O Most High",
"O Lord, you will do justice for the oppressed",
"The Lord is righteous - the upright shall behold His face",
"You, O Lord, will protect us",
"Consider and answer me, O Lord my God",
"The Lord looks down from heaven on humankind",
"Walk blamelessly, and do what is right, and speak truth from your heart",
"Protect me, O God, for in you I take refuge",
"I call upon you, O God, incline your ear to me, hear my prayer",
"I love you, O Lord, my strength - my rock, my fortress, and my deliverer",
"The heavens are telling the glory of God",
"May God grant you your heart's desire, and fulfill all your plans",
"Be exalted, O Lord - we will sing and praise your power",
"All the ends of the earth shall remember and turn to the Lord",
"The Lord is my shepherd, I shall not want",
"Lift up your heads, O gates - that the King of Glory may come in",
"Be mindful of your mercy, O Lord, and of your steadfast love",
"God's steadfast love is before my eyes, and I walk in faithfulness to Him",
"The Lord is my light and my salvation; whom shall I fear?",
"To you, O Lord, I call; my rock, do not refuse to hear me",
"Ascribe to the Lord the glory of His name; worship the Lord in holy splendor",
"O Lord my God, I cried to you for help, and you have healed me",
"In you, O Lord, I take refuge",
"Let all who are faithful offer prayer to God",
"Sing to God a new song; play skillfully on the strings, with loud shouts",
"O magnify the Lord with me, and let us exalt His name together",
"Great is the Lord, who delights in the welfare of His servant",
"O continue your steadfast love to those who know you - to the upright of heart",
"Be still before the Lord, and wait patiently for Him",
"O my God - make haste to help me, O Lord, my salvation",
"Hear my prayer, O Lord, and give ear to my cry",
"You are my help and my deliverer; do not delay, O my God.",
"Blessed be the Lord, the God of Israel, from everlasting to everlasting",
"As the deer longs for water, so my soul longs for you, O God",
"Hope in God; for I shall again praise Him, my help and my God",
"Rise up, come to our help.  Redeem us for the sake of your steadfast love", 
"Your throne, O God, endures forever and ever",
"God is our refuge and strength, a very present help in trouble",
"Clap your hands, all you peoples; shout to God with loud songs of joy",
"We ponder your steadfast love, O God, in the midst of your temple",
"Hear this, all you peoples - the mediatation of my heart shall be understanding",
"Our God comes and does not keep silence",
"Have mercy on me, O God, according to your steadfast love",
"I trust in the steadfast love of God forever and ever",
"Fools say in their hearts there is no God",
"Hear my prayer, O God, give ear to the words of my mouth",
"Cast your burden on the Lord and He will sustain you",
"O Most High, when I am afraid, I put my trust in you",
"Be merciful to me, O God, for in you my soul takes refuge",
"Surely there is a reward for the righteous",
"O my strength, I will watch for you; for you, O God, are my fortress",
"With God we shall do valiantly",
"Hear my cry, O God, listen to my prayer",
"God alone is my rock and my salvation, my fortess; I shall never be shaken",
"O God, you are my God - my soul thirst for you as in a dry and thirsty land",
"Let the righteous rejoice in the Lord and take refuge in Him",
"O you who answers prayer!  To you all flesh shall come",
"Bless our God, O peoples, let the sound of His praise be heard",
"Let the peoples praise you, O God, let all the peoples praise you",
"Lift up a song to God who rides upon a cloud - His name is the Lord",
"Answer me, O Lord, for your steadfast love is good",
"Be pleased, O God, to deliver me.  O Lord, make haste to help me",
"I will praise you with the harp for your faithfulness, O my God",
"Blessed be the Lord, the God of Israel, who alone does wondrous things.",
"God is the strength of my heart and my portion forever",
"Yet God, my King, is from of old, working salvation in the earth",
"We give thanks to you, O God - people tell of your wondrous deeds",
"Make vows to the Lord your God, and perform them",
"I will call to mind the deeds of the Lord; I will remember your wonders of old",
"God commanded the skies above, He rained down on them manna to eat",
"Help us, O God of our salvation, for the glory of your name",
"Restore us, O God, let your face shine, that we may be saved",
"Sing aloud to God our strength; shout for joy to the God of Jacob",
"Give justice to the weak and the orphan; maintain the right of the lowly and destitute",
"O God, do not keep silence; do not hold your peace or be still, O God",
"How lovely is your dwelling place, O Lord of hosts",
"The Lord will give what is good, and our land will yield its increase",
"Incline your ear, O Lord, and answer me, for I am poor and needy",
"Singers and dancers alike say all my springs are in God.",
"O God, let my prayer come before you; incline your ear to my cry",
"I will sing of your steadfast love, O Lord, forever",
"Let the favor of the Lord our God be upon us",
"My refuge and my fortress; my God in whom I trust",
"It is good to give thanks to the Lord, to sing praises to His name",
"More majestic than thunders of mighty waters, majestic on high is the Lord",
"The Lord has become my stronghold, and my God the rock of my refuge",
"Let us worship and bow down, let us kneel before the Lord, our Maker",
"O sing to the Lord a new song; sing to the Lord all the earth",
"Rejoice in the Lord, O you righteous, and give thanks to His holy name",
"Make a joyful noise to the Lord, all the earth, break forth into joyous song",
"Extol the Lord our God; worship at His footstool.  Holy is He",
"Enter God's gates with thanksgiving, and His courts with praise",
"I will sing of loyalty and of justice; to you, O Lord, I will sing",
"Hear my prayer, O Lord; let my cry come to you",
"Bless the Lord, O my soul, and all that is within me, bless His holy name",
"May the glory of the Lord endure forever; may the Lord rejoice in His works",
"Let the hearts of those who seek the Lord rejoice",
"O give thanks to the Lord, for He is good; His steadfast love endures forever",
"God raises up the needy out of distress, and makes their families like flocks",
"I will give thanks to you, O Lord, among the people",
"Do not be silent, O God of my praise",
"The Lord is at your right hand",
"The fear of the Lord is the beginning of wisdom",
"Happy are those who fear the Lord, who greatly delight in His commandments",
"Blessed be the name of the Lord from this time on and forevermore",
"Tremble, O earth, at the presence of the Lord . . .  who turns the rock in to a pool of water",
"The Lord has been mindful of us; He will bless us",
"I love the Lord, because He has heard my voice and my supplications",
"Praise the Lord, all you nations!  Extol Him, all you peoples",
"O give thanks to the Lord, for He is good",
"I long for your salvation, O Lord, and your Law is my delight",
"In my distress I cry to the Lord, that He may answer me",
"My help comes from the Lord, who made heaven and earth",
"I was glad when they said to me let us go to the house of the Lord.",
"To you I lift up my eyes, O you who are enthroned in the heavens",
"Our help is in the name of the Lord, who made heaven and earth",
"Those who trust in the Lord are like Mount Zion, which cannot be moved",
"The Lord has done great things for us, and we rejoiced",
"Unless the Lord builds the house, those who build it labor in vain",
"Happy is every one who fears the Lord, who walks in His ways",
"The blessing of the Lord be upon you.  We bless you in the name of the Lord",
"Out of the depths I cry to you, O Lord.  Lord, hear my voice",
"Hope in the Lord from this time on and forevermore",
"Let us go to God's dwelling place; let us worship at His footstool",
"In Zion the Lord ordained His blessing, life forevermore",
"The Lord, maker of heaven and earth, bless you from Zion",
"Praise the Lord, for the Lord is good; sing to His name, for He is gracious",
"O give thanks to the God of heaven, for His steadfast love endures forever",
"Let my tongue cling to the roof of my mouth, if I do not remember God",
"I give thanks to you, O Lord, with my whole heart",
"Search me, O God, and know my heart; test me and know my thoughts",
"You are my God; give ear to the voice of my supplications.",
"Let my prayer be counted to you as incense before God",
"I cry to you, O Lord; You are my refuge, my portion in the land of the living.",
"Hear my prayer, O Lord; give ear to my supplications in your faithfulness",
"Blessed be the Lord, my rock; my rock and my fortress, my stronghold and my deliverer",
"The Lord is gracious amd merciful, slow to anger and abounding in steadfast love",
"The Lord lifts up those who are bowed down; the Lord loves the righteous",
"How good it is to sing praises to our God; for He is gracious",
"Praise the Lord from the heavens; praise Him, all His host",
"Sing to the Lord a new song, His praise in the assembly of the faithful",
"Let everything that has breath praise the Lord!  PRAISE THE LORD!"
);

function loadData() {
	//getPageTitle();
	loadPrayers(prayerNew, "newp");
	choosePic();
	loadPsalms();
}

function getPageTitle() {
	document.getElementById("getPageName").innerHTML = document.title;
}

function writeContent(message) {
	var thisMSG=message;
	
	var contentWin=document.getElementByID("content").contentWindow.document;
	contentWin.body.innerHTML=thisMSG;
	return false;
}

function customDateString(oneDate) {
    var theDay = dayNames[oneDate.getDay()];
    var theMonth = monthNames[oneDate.getMonth()];
    var theYear = oneDate.getFullYear();
    return theDay + ", " + theMonth + " " + oneDate.getDate() + 
       ", " + theYear;
}

function dayPart(oneDate) {
   var theHour = oneDate.getHours();
   if (theHour < 6 )
      return "tonight";
   if (theHour < 12)
      return "this morning";
   if (theHour < 18)
      return "this afternoon";
   return "this evening";
}

function choosePic() {
	thisPic = Math.floor((Math.random() * myPix.length));
	document.getElementById("myPicture").src = myPix[thisPic];
	
	rotatePictures();
}

function rotatePictures() {
	thisPic++;
	if(thisPic==myPix.length) {
		thisPic = 0;
	}
	document.getElementById("myPicture").src = myPix[thisPic];
	
	setTimeout("rotatePictures()", 10*1000);
}

function loadPrayers(thisList) {
	prayerList=thisList;
	clearTimeout(timerID);
	thisPrayer= Math.floor((Math.random() * prayerList.length));
	
	rotatePrayers();
}

function pausePrayers() {
	clearInterval(timerID);
}

function rotatePrayers() {
	thisPrayer++;
	if(thisPrayer==prayerList.length) {
		thisPrayer = 0;
	}
	document.getElementById("prayers").innerHTML=prayerList[thisPrayer];

	timerID=setTimeout("rotatePrayers()", 12*1000);
}

function nextPrayer() {
	thisPrayer++;
	if(thisPrayer==prayerList.length) {
		thisPrayer = 0;
	}
	document.getElementById("prayers").innerHTML=prayerList[thisPrayer];
	clearTimeout(timerID);
	timerID=setTimeout("rotatePrayers()", 12*1000);
}

function prevPrayer() {
	thisPrayer--;
	if(thisPrayer<0) {
		thisPrayer = prayerList.length-1;
	}
	document.getElementById("prayers").innerHTML=prayerList[thisPrayer];
	clearTimeout(timerID);
	timerID=setTimeout("rotatePrayers()", 12*1000);
}

function closeWin(thisWindow){
	if (thisWindow!= null){
		if(!thisWindow.closed)
			thisWindow.close();
	}
}

function goHome(url,width,height) {
	closeWin(homeWindow);
	var settings="";
	settings="toolbar=yes,location=yes,directories=yes,"+
	"status=yes,menubar=yes,scrollbars=yes,"+
	"resizable=yes left=50,top=100,width="+width+",height="+height;
	
	homeWindow = window.open(url, 'homeWin', settings);
}

function openInfo(url,width,height) {
	closeWin(infoWindow);
	var settings="";
	settings="toolbar=yes,location=yes,directories=yes,"+
	"status=yes,menubar=yes,scrollbars=yes,"+
	"resizable=yes left=50,top=100,width="+width+",height="+height;
	
	infoWindow = window.open(url, 'infoWin', settings);
}

function prayersongRadio(url,width,height) {
	closeWin(radioWin);
	var settings="";
	settings="toolbar=no,location=no,directories=no,"+
	"status=no,menubar=no,scrollbars=no,"+
	"resizable=yes,left=50,top=100,width="+width+",height="+height;
	
	radioWin = window.open(url, 'radioWin', settings);
}

function openLyrics(url, width, height){
	
	closeWin(lyricWindow);
	
	var settings="";
	settings="toolbar=no,location=no,directories=no,"+
	"status=no,menubar=no,scrollbars=no,"+
	"resizable=yes,left=50,top=100,width="+width+",height="+height;
	
	lyricWindow = window.open(url, 'lyricWin', settings);
	lyricWindow.focus();
	
}

function openReflections(url, width, height){
	closeWin(reflectWindow);
	
	var settings="";
	settings="toolbar=no,location=yes,directories=no,"+
	"status=no,menubar=no,scrollbars=yes,"+
	"resizable=yes,left=50,top=100,width="+width+",height="+height;
	
	reflectWindow=window.open(url, 'reflectWin', settings);
	reflectWindow.focus();
}

function openBeyond(url, width, height){
	closeWin(beyondWindow);
	
	var settings="";
	settings="toolbar=no,location=yes,directories=no,"+
	"status=no,menubar=no,scrollbars=yes,"+
	"resizable=yes,left=50,top=100,width="+width+",height="+height;
	
	beyondWindow=window.open(url, 'beyondWin', settings);
	beyondWindow.focus();
}

function openPrayerRequest(url, width, height){
	
	closeWin(requestWindow);
	var settings="";
	
	var settings="";
	settings="toolbar=no,location=no,directories=no,"+
	"status=no,menubar=no,scrollbars=yes,"+
	"resizable=yes,left=377,top=150,width="+width+",height="+height;
	
	requestWindow= window.open(url, 'reflectWin', settings);
	requestWindow.focus();
	
}

function openMsgWindow(url, width, height){
	
	closeWin(msgWindow);
	var settings="";
	
	var settings="";
	settings="toolbar=no,location=no,directories=no,"+
	"status=no,menubar=no,scrollbars=yes,"+
	"resizable=yes,left=377,top=150,width="+width+",height="+height;
	
	msgWindow= window.open(url, 'msgWin', settings);
	msgWindow.focus();
	
}

function openForumWindow(url, width, height){
	
	closeWin(msgWindow);
	var settings="";
	
	var settings="";
	settings="toolbar=yes,location=yes,directories=no,"+
	"status=no,menubar=no,scrollbars=yes,"+
	"resizable=yes,left=250,top=150,width=900,height=700";
	
	msgWindow= window.open(url, 'msgWin', settings);
	msgWindow.focus();
	
}

function alertWindow(message) {
	alert(+message);
}

function checkForIE(url, width, height){
	var settings="";
	
	var settings="toolbar=no,location=no,directories=no,"+
	"status=no,menubar=no,scrollbars=yes,"+
	"resizable=no,left=400,top=150,width="+width+",height="+height;
	
	var msie = msieversion();
	if(msie> 0) {
		alert("Please use 'Email Prayer Request' - Internet Explorer does not support 'Prayer Request Form' - IE version #" +msie);
		
		closeWin(IEWindow);
		openIEWindow("http://www.prayersong.net/emailPrayer.htm",250,350);
		return true;
	}
	return false;
}

function openIEWindow(url,width,height) {
	closeWin(IEWindow);
	
	var settings="";
	settings="toolbar=no,location=no,directories=no,"+
	"status=no,menubar=no,scrollbars=yes,"+
	"resizable=yes,left=500,top=300,width="+width+",height="+height;
	
	IEWindow= window.open(url, 'IEWindow', settings);
	IEWindow.focus();
}

function msieversion() {
      var ua = window.navigator.userAgent
      var msie = ua.indexOf ( "MSIE " )

      if ( msie > 0 )      // If Internet Explorer, return version number
         return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
      else                 // If another browser, return 0
         return 0
}

function openSong(url, width, height){
	
	closeWin(songWindow);
	
	var settings="";
	settings="toolbar=no,location=no,directories=no,"+
	"status=no,menubar=no,scrollbars=yes,"+
	"resizable=yes,left=50,top=100,width="+width+",height="+height;
	
	songWindow= window.open(url, 'songWin', settings);
	songWindow.focus();
	
}


function loadPsalms() {
	thisPsalm1= Math.floor((Math.random() * psalmArray.length));
	
	var thisPsalm = thisPsalm1 +1;
	var result = psalmArray[thisPsalm1] + "<br> - Psalm " + thisPsalm;
	document.getElementById("psalmList1").innerHTML=result;

	timerID2=setTimeout("loadPsalms()", 8*1000);
}

//Contents for menu 1
var forum=new Array()
	forum[0]='<a href="http://www.prayersong.net/Forum/forumIndex.php?personalPage=display">Your Profile</a>'
	forum[1]='<a href="http://www.prayersong.net/musicCenterLogin/fkb_index.php?LogMeIn=Login">PrayerSong Login</a>'
	forum[2]='<a href="http://www.prayersong.net/musicCenterLogin/fkb_index.php?LogMeOut=Logout">PrayerSong Logout</a>'
	/*
	forum[1]='<a href="http://www.prayersong.net/Forum/forumIndex.php?message=center">Message Center</a>'	
	forum[2]='<a href="http://www.prayersong.net/forumMembers.php">PrayerSong Members</a>'	
	forum[3]='<a href="http://www.clergyforum.net">Clergy Forum</a>'
	*/
	
var resources=new Array()
	resources[0]='<a href="http://www.prayersong.net/resources.php">Overview</a>'	
	resources[1]='<a href="http://www.prayersong.net/albums.php">Albums</a>'
	resources[2]='<a href="http://www.prayersong.net/waterVideos.php">Videos</a>'
	resources[3]='<a href="http://www.prayersong.net/song books.php">Songbooks</a>'	
	resources[4]='<a href="http://www.prayersong.net/orchestrations.php">Orchestrations</a>'
	resources[5]='<a href="http://www.prayersong.net/workshops.php">Workshops</a>'

var listen=new Array()
	listen[0]='<a href="http://www.prayersong.net/songmovies.php">Song Movies</a>'
	listen[1]='<a href="http://www.prayersong.net/waterVideos.php">Videos</a>'
	listen[2]='<a href="http://www.prayersong.net/calltoprayer.php">Call to Prayer</a>'
	listen[3]='<a href="http://www.prayersong.net/onthemount.php">On the Mount</a>'
	listen[4]='<a href="http://www.prayersong.net/singingiam.php">Singing I AM</a>'
	listen[5]='<a href="http://www.prayersong.net/throughthecross.php">Through the Cross</a>'
	listen[6]='<a href="http://www.prayersong.net/weston.php">Flute Meditations</a>'
	
var prayer=new Array()
	prayer[0]='<a href="http://www.prayersong.net/prayercenter.php">Prayer Center</a>'
	prayer[1]='<a href="http://www.prayersong.net/prayersongScriptures.php">Prayer Scriptures</a>'
	prayer[2]='<a href="http://www.prayersong.net/prayForPeace.php">Pray For Peace</a>'
	prayer[3]='<a href="http://www.prayersong.net/liturgies.php">Liturgies</a>'
	prayer[4]='<a href="http://www.prayersong.net/sundaybulletin.php">Worship Bulletin</a>'
	prayer[5]='<a href="http://www.prayersong.net/prayercircle.php">Prayer Circle</a>'
	prayer[6]='<a href="http://www.prayersong.net/special message.php">Special Message</a>'
	prayer[7]='<a href="http://www.prayersong.net/tedMemorial.php">In Memory of Ted</a>'
	prayer[8]='<a href="http://www.prayersong.net/TonyMemorial.php">In Memory of Tony</a>'


var prayCenter=new Array()
	prayCenter[0]='<a href="http://www.prayersong.net/prayercenter.php">Prayer Center</a>'
	prayCenter[1]='<a href="http://www.prayersong.net/prayForPeace.php">Pray For Peace</a>'
	prayCenter[2]='<a href="http://www.prayersong.net/special message.php">Special Message</a>'
	
var action=new Array()
	action[0]='<a href="http://www.prayersong.net/links.php">Faith In Action</a>'
	action[1]='<a href="http://www.prayersong.net/nodcc.php">Help A Child</a>'	
	action[2]='<a href="http://www.prayersong.net/freegifts.php">Free Gifts</a>'
	action[3]='<a href="http://www.prayersong.net/churches.php">Find A Church</a>'
	action[4]='<a href="http://www.oldfirstumc.org">Old First-New Life UMC</a>'
	
var about=new Array()
	about[0]='<a href="http://www.prayersong.net/prayersong.php">About PrayerSong</a>'
	about[1]='<a href="http://www.prayersong.net/about.php">About Frederick</a>'
	about[2]='<a href="http://www.prayersong.net">Home</a>'
	
var store=new Array()
	store[0]='<a href="http://www.prayersong.net/resources.php">Overview</a>'	
	store[1]='<a href="http://www.prayersong.net/albums.php">PrayerSong</a>'
	store[2]='<a href="http://www.prayersong.net/weston.php">Flute Meditations</a>'
	store[3]='<a href="http://www.prayersong.net/waterVideos.php">Videos</a>'
	store[4]='<a href="http://www.prayersong.net/song books.php">Songbooks</a>'	
	store[5]='<a href="http://www.prayersong.net/orchestrations.php">Orchestrations</a>'
	store[6]='<a href="http://www.prayersong.net/workshops.php">Workshops</a>'

var music=new Array()
	music[0]='<a href="http://www.prayersong.net/musicCenterLogin/mediaFiles/pastorfkb/pastorfkbMusic.php">PrayerSong</a>'
	music[1]='<a href="http://www.prayersong.net/musicCenter.php">Music Center</a>'	
	/*music[2]='<a href="http://www.prayersong.net/musicCenterLogin/mediaFiles/ptyson/ptyson.php">Pat Tyson</a>'
	music[3]='<a href="http://www.prayersong.net/musicCenterLogin/mediaFiles/sisterkandi/kandi.php">Kandi Kernan</a>'	
	music[4]='<a href="http://www.prayersong.net/musicCenterLogin/mediaFiles/poostosh/poostosh.php">Poostosh</a>'
	music[5]='<a href="http://www.prayersong.net/musicCenterLogin/mediaFiles/cphristophersly/christophersly.php">Christopher Sly</a>'
	music[6]='<a href="http://www.prayersong.net/musicCenterLogin/mediaFiles/beyondourgalaxy/beyond.php">Beyond Our Galaxy</a>'
	music[7]='<a href="http://www.prayersong.net/musicCenterLogin/mediaFiles/livingwater2005/livingwater.php">Living Water</a>'
	music[8]='<a href="http://www.prayersong.net/musicCenterLogin/mediaFiles/crown-of-roses/crown.php">Crown of Roses</a>'
	music[9]='<a href="http://www.prayersong.net/musicCenterLogin/mediaFiles/electro-acoustic/e-acoustic.php">Electro-acoustic Music</a>'
	*/
var menuwidth='160px' //default menu width
var menubgcolor='CCCCFF'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

