// JavaScript Document
function SetActiveNavigation(mymenuid,myactiveclass) {
   var menuID = mymenuid; // The ID of your menu
   var activeClass = myactiveclass; // The class to add

   var menu = document.getElementById(menuID);
   var items = menu.getElementsByTagName('a');
   for( var i = 0; i < items.length; i++ ) {
	   //alert(items[i]);
	   
	   var str = location.href.replace(/https?:\/\/.*?\//i , '');
	   var linkelement = items[i].href.replace(/https?:\/\/.*?\//i , '');
	   linkelement = linkelement.replace('.php' , '');
	   
	   if(str == "" && linkelement == "index") {
		items[0].parentNode.className = activeClass;
		break;
	   }
	   //alert("this is location: " + str);
	   //alert("this is link: " + linkelement);
	   if( str.match( linkelement ) ) {
		 items[i].parentNode.className = activeClass;
		 break;		   
	   }
	  		
/*	  if( items[i].href.replace(/https?:\/\/.*?\//i , '/') ==
		 location.href.replace(/https?:\/\/.*?\//i , '/') ) {
		 items[i].parentNode.className = activeClass;
		 break;
	  }*/
   }	   
}
   

window.onload = function() {
	SetActiveNavigation('navigation','activebg');	//sets primary nav
	SetActiveNavigation('subnavfeaturefilm','activeSide');		//sets secondary nav	
};


//returns year
function CopyrightYear() {
	var d=new Date();
	document.write(d.getFullYear());
}


