<!--

//<![CDATA[

if(typeof sIFR == "function"){
	sIFR.replaceElement(named({sSelector:"h2", sFlashSrc:"/js/myriad_semiboldsemicondensed.swf", sColor:"#1175aa", sLinkColor:"#1175aa", sBgColor:"#ffffff", sHoverColor:"#ffffff", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0", sWmode:"transparent"}));
	sIFR.replaceElement(named({sSelector:"h1", sFlashSrc:"/js/book_antiqua.swf", sColor:"#1e467a", sLinkColor:"#1e467a", sBgColor:"#ffffff", sHoverColor:"#ffffff", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=center&offsetTop=0", sWmode:"transparent"}));
};

//]]>

var divDelay = 10000;
var divs = ['main_section_1', 'main_section_2', 'main_section_3'];

function hideDivs() {
	for (var i=0; i<divs.length; i++) {
		if (document.getElementById) { 
			document.getElementById(divs[i]).style.visibility = 'hidden';
			document.getElementById(divs[i]).style.display = 'none';
		}
	}
}

function showDiv() {
	hideDivs(); //hide them all before we show the next one.

	var randomDiv = divs[Math.floor(Math.random()*divs.length)];
	document.getElementById(randomDiv).style.visibility = 'visible';
	document.getElementById(randomDiv).style.display = 'block';

	setTimeout(showDiv,divDelay);
}

function PopupWin(url,w,h){
	var how_wide = screen.availWidth;
	var how_high = screen.availHeight;
	w -= 0;
	h -= 0;
	var top_pos = (how_high/2) - (h/2);
	var left_pos = (how_wide/2) -  (w/2);

	window.open(url, "external", "titlebar=no,width=" + w +",height=" + h + ",menubar=false,personalbar=no,resizeable=no,scrollbars=no,status=no,toolbar=no,left="+left_pos+",top="+top_pos);
}

function playvideo() {
	srchStr = location.search;
	obj = document.getElementById("medObj");
	media = srchStr.split("f=")[1];
	document.getElementById('video').innerHTML='<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"'+'type="application/x-oleobject" width="240" height="240">'+'<param name="fileName" value="'+media+'">'+'<embed type="application/x-mplayer2" width="320" height="285"'+'showcontrols="false" autostart="1" src="'+media+'"><\/embed><\/object>';
}

function stripnumber(text){
	var stripped = text.value.replace(/[^0-9.]/g, '');
	return stripped;
}

// var extendSession = 0;
// var endSession = 0;

function SessionEnd() {
	// Redirect
	alert("Your session has timed out due to inactivity.\nPlease login again to complete your user session.");
	window.location="/login.php?logout";		   
}

function SessionWarn() {
	// Warn user session is about to timeout
	alert("Your session will timeout in 10 minutes due to inactivity.  Please complete your process.");
}

/*function SessionExtend() {

	if (extendSession > 0 )
		window.clearTimeout(extendSession);
	
	if (confirm('Your session will timeout in 10 minutes. Click \'OK\' to extend your session.') ==  true) {
		if (endSession > 0 )
			window.clearTimeout(endSession);
		
		
		initTimer();
		extendSession = window.setTimeout('SessionExtend()',4800000,'javascript');
		endSession = window.setTimeout('SessionEnd()',5400000,'javascript');
		
		
	} else {
		return false;
	}
}

function initTimer(){
	if (extendSession > 0 )
		window.clearTimeout(extendSession);
	if (endSession > 0)
		window.clearTimeout(endSession);
}
*/
function SessionTimer() {
	
	//In milliseconds ... 60k = 1 minute 
	// initTimer();
		
	window.setTimeout('SessionWarn()',4800000,'javascript'); 
	window.setTimeout('SessionEnd()',5400000,'javascript'); 
	return false ;
	
	}


function NewCenteredWindow(mypage, myname, w, h, scrollbarchoice) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scrollbarchoice+',resizable=no,menubar=no,toolbar=yes,status=no,directories=no,location=no' 
	win = window.open(mypage, myname, winprops)
}
//-->
