if(document.getElementById){
	document.write('<link rel="stylesheet" type="text/css" href="/css/flashinvisible.css" />');
}//end if

var oldOnLoad = window.onload;
window.onload = function(){
	if(this.oldOnLoad){
		this.oldOnLoad();	
	}//end if
	this.windowOpen();
	this.activateSifr();
	this.activateLoginButtons();
}//end function

var activateLoginButtons = function(){
	
	//hide button
	var hide = document.getElementById("sm-login");
	var hideBtns = hide.getElementsByTagName("a");
	hideBtns[0].href = "#";
	hideBtns[0].onclick = this.hideLogin;
	
	//show button
	var show = document.getElementById("sm-masthead");
	var showBtns = show.getElementsByTagName("a");
	showBtns[0].href = "#";
	showBtns[0].onclick = this.showLogin;
	
}//end function

var hideLogin = function(){
	var login = document.getElementById("sm-login");
	login.style.display = "none";
}//end function
	
var showLogin = function(){
	var login = document.getElementById("sm-login");
	login.style.display = "block";
}//end function

var openWin = function(p, h, w){
	var win = window.open(p,'','scrollbars=no,menubar=no,height=' +h+ ',width=' +w+ ',resizable=no,toolbar=no,location=no,status=no');
}//end function

var windowOpen = function(){
	
	//quick exit if javascript is poorly supported
	if (!document.getElementsByTagName) return;

		var anchors = document.getElementsByTagName("a");
	
		for (var i=0; i<anchors .length; i++) {
			var anchor = anchors[i];
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
			anchor.title = (anchor.title != "") ? anchor.title+" (opens in a new window)" : "opens in a new window";
			anchor.className = (anchor.className != "") ? anchor.className+" external" : "external";
		}//end for
	
	}//end if

}//end function

var activateSifr = function(){

	if(typeof sIFR == "function"){

		// This is the preferred "named argument" syntax
		sIFR.replaceElement(named({sSelector:"h1", sFlashSrc:"../flash/centurygothic.swf", sColor:"#D65121", sLinkColor:"#D65121", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=right&offsetTop=0", sWmode:"transparent"}));
		sIFR.replaceElement(named({sSelector:"h2", sFlashSrc:"../flash/centurygothic.swf", sColor:"#D65121", sLinkColor:"#D65121", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=right&offsetTop=0", sWmode:"transparent"}));

	}//end if
	
}//end function

