/***********************************************
* Destiny Patrol Main Scripts File 
* (include on every non-admin page) 
***********************************************/


window.onload = activate;



//activate function
//initializes other functions on window load. 
function activate() {
	blurLinks();
}


	
//blurLinks function 
//removes the annoying dotted line that appears around clicked links.
function blurLinks() {
	var links = document.getElementsByTagName('a');
	for (var i = 0; i < links.length; i++) { 
		currentLink = links[i];
		currentLink.onfocus = function() { this.blur(); };
	}
}



//slideOutMenu function
//opens a nav menu pane to show it's submenu.
function slideOutMenu(menuId) {
	
	//get the button and change the class so it stays lit when we hover over the submenu:
	var theButton = document.getElementById(menuId+'but');
	theButton.className = 'navbut_on';

	//activate the openIt function on slide.js (open the submenu):
	openIt(menuId);

}



//slideInMenu function
//closes a nav pane submenu.
function slideInMenu(menuId) {
	
	//get the button and change the class back:
	var theButton = document.getElementById(menuId+'but');
	theButton.className = 'navbut';
		
	//activate the closeIt function on slide.js (close the submenu):
	closeIt(menuId);

}



//popUp function 
//pops up a new window with no toolbars etc. 
//(function from the original destinypatrol site).
function popUp(URL, optionalScrollbars) {
	
	//set the default for the optionalScrollbars var:
	if (optionalScrollbars != 1) { 
		optionalScrollbars = 0;
	}
	
	//generate a unique id for the window:
	var day = new Date();
	var id = day.getTime();

	//open the window:
	window.open(URL, id, 'toolbar=0,scrollbars='+optionalScrollbars+',location=0,statusbar=0,menubar=0,resizable=0,width=790,height=569,left=0,top=0');
	
}



