var subnavtarget = [

['/notes/','subnav-blog'],
['http://www.myspace.com/havennyc','subnav-myspace'],
['http://flickr.com/photos/thehaven/','subnav-flickr'],
['http://havenpresents.com/','subnav-havenpresents'],
['http://www.priorityassociates.org/nyc/', 'subnav-priorityassociates'],

['/about/index.php','subnav-abouthome'],
['/about/involved.php','subnav-getinvolved'],
['/about/directions.php','subnav-directions'],

['/calendar/index.php','subnav-calendarhome'],
['/calendar/add.php','subnav-addyourevent'],

['/mboard/index.php','subnav-messageboardshome'],
['/mboard/profile.php?mode=register','subnav-messageboardregister'],
['/mboard/login.php','subnav-messageboardlogin'],

['/creative/index.php','subnav-creativehome'],
['/creative/video.php','subnav-videos'],
['/creative/dancers.php','subnav-videos'],
['/creative/firstvideo.php','subnav-videos'],
['/creative/messageboards.php','subnav-videos'],
['/creative/messageboards2.php','subnav-videos'],
['/podcast/', 'subnav-podcast'],

['http://havenpresents.com/mercy.php','subnav-mercyplayshome'],
['http://havenpresents.com/auditions.php','subnav-auditions'],
['http://havenpresents.com/fundraiser.php','subnav-fundraiser'],
['http://havenpresents.com/plays.php','subnav-theplays'],

['/resources/index.php','subnav-resourceshome'],
['/resources/church.php','subnav-churchguide'],
['/resources/church_losangeles.php','subnav-churchguide'],
['/resources/church_chicago.php','subnav-churchguide'],
['/resources/church_washington.php','subnav-churchguide'],
['/resources/church_london.php','subnav-churchguide'],
['/resources/church_elsewhere.php','subnav-churchguide'],
['/directory/','subnav-directory'],

['/contact/index.php','subnav-contacthome'],
['/contact/subscribe.php','subnav-newsletter']

];

// Retrieve the current URL and use it as a reference for sub-navigation rules
var currenturl = parent.location.href;
for (var i=0; i < subnavtarget.length; i++) {
	var pattern = subnavtarget[i][0];
	if (currenturl.match(pattern)) {
		document.getElementById(subnavtarget[i][1]).className = "active";
	 }       
}