

/* ************************ */
/* Image Rotator
/* ************************ */

window.addEventListener?window.addEventListener('load',initFader,false):window.attachEvent('onload',initFader);

var d=document, imgs = new Array(), zInterval = null, current=0, pause=false;
 clkIndex = null;

function initFader()
{
	if(!d.getElementById || !d.createElement)return;

	imgs = d.getElementById('rotator').getElementsByTagName('img');
	for(i=1;i<imgs.length;i++) imgs[i].xOpacity = 0;
	imgs[0].style.display = 'block';
	imgs[0].xOpacity = .99;
	
	links = d.getElementById('rotator_select').getElementsByTagName('a');
	
	links[0].style.fontWeight = 'bold';

	tt = setTimeout(xfade,interval);
}

function xfade()
{	
	nIndex = imgs[current+1]?current+1:0;
	if(clkIndex != null) nIndex = clkIndex;
	
	for(i=0;i<links.length;i++) links[i].style.fontWeight = 'normal';
	links[nIndex].style.fontWeight = 'bold';

	
	cOpacity = imgs[current].xOpacity;
	nOpacity = imgs[nIndex].xOpacity;
	
	cOpacity-=.05;
	nOpacity+=.05;

	imgs[nIndex].style.display = 'block';
	imgs[current].xOpacity = cOpacity;
	imgs[nIndex].xOpacity = nOpacity;

	setOpacity(imgs[current]);
	setOpacity(imgs[nIndex]);
	
	if(cOpacity<=0)
	{
		imgs[current].style.display = 'none';
		current = nIndex;
		clkIndex = null;
		tt = setTimeout(xfade,interval);
		
	}
	else
	{
		tt = setTimeout(xfade,50);
	}

	function setOpacity(obj)
	{
		if(obj.xOpacity>.99)
		{
			obj.xOpacity = .99;
			return;
		}

		obj.style.opacity = obj.xOpacity;
		obj.style.MozOpacity = obj.xOpacity;
		obj.style.filter = 'alpha(opacity=' + (obj.xOpacity*100) + ')';
	}

}

function change_img(passedIndex) {
	if (imgs[current].xOpacity >.90){
		if(passedIndex != current){
			clearTimeout(tt);	
			clkIndex=passedIndex;
			xfade();
			isclk = true;
		}
	}

}
 
 
/* ******************************* */
/* Menu IE Fix / Mouseoff Delay
/* ******************************* */

var closetimer	= 0;
var ddmenuitem	= 0;

function mopen(id)
{	
	mcancelclosetime();

	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
	
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}
document.onclick = mclose; 


/* ******************* */
/* News Scroller
/* ******************* */

var pauseit=0 
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(ffHeight*(-1)+25))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+1+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("feedOutput")
cross_marquee.style.top=0
marqueeheight=document.getElementById("headline_scroller").offsetHeight
cross_marquee.height = marqueeheight;
actualheight=cross_marquee.offsetHeight
	if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
		cross_marquee.style.height=marqueeheight+"px"
		cross_marquee.style.overflow="scroll"
		return
	}
setTimeout('lefttime=setInterval("scrollmarquee()",85)', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


/* ******************* */
/* Rss Reader
/* ******************* */

var showDesc = false; //Show Description?
var ffHeight = 0;

function readRSS(feedURL)
{
var request;
/* Create XMLHttpRequest Object */
try {
request = new XMLHttpRequest();
} catch (e) { request = new ActiveXObject("Msxml2.XMLHTTP"); }
try {
// Needed for Mozilla if local file tries to access an http URL
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
} catch (e) { /* ignore */ }

//request.open("GET","copyfeed.php",false); 
//request.send(null);

request.open("GET",feedURL,false);
request.send(null);
var feed=request.responseXML;
var itemList = feed.getElementsByTagName('item');
if (numTitles == 0 )
var numItems=itemList.length;
else numItems = numTitles;
/* create HTML for the list of items */
var newULTag = document.createElement('ul');
for (var q=0; q< 10; q++) {
for (var i=0; i< numItems; i++)
{
ffHeight = ffHeight + 58;
/* create a new list item */
var newLITag = document.createElement('li');
/* get the Title of the item and its' text */
var itemTitle = itemList[i].getElementsByTagName('title');
var newItemTitleTxt =
document.createTextNode(itemTitle[0].firstChild.nodeValue);
/* build a link to the item */
var itemURL = itemList[i].getElementsByTagName('link');
var newATag = document.createElement('a');
newATag.href = itemURL[0].firstChild.nodeValue;
newATag.appendChild(newItemTitleTxt);
/* get the item's Description */
if (showDesc) {
	var itemDescription =
	itemList[i].getElementsByTagName('description');
	var descriptionTxt =
	document.createTextNode(itemDescription[0].firstChild.nodeValue);
	var newPTag = document.createElement('p');
	newPTag.appendChild(descriptionTxt);
	
	/* build and append HTML */
	newLITag.appendChild(newPTag);
}
newLITag.appendChild(newATag);
newULTag.appendChild(newLITag);
}
}
/* output the final HTML of the RSS feed to the page */
document.getElementById('feedOutput').appendChild(newULTag);
}

/* ******************* */
/* Viewbook Popup
/* ******************* */
function popUpCatalog(){
  var w = 835, h = 640;
  var popW = 835, popH = 640;
				
  var printWindow=window.open("http://www.sebts.edu/prospective_students/become_student/SeminaryVB/flash.html","catalogWindow","menubar=no,toolbar=no,resizabled=no,scrollbars=yes,status=no,width="+popW+",height="+popH);
}
function SendAlertToBack() {

  document.getElementById("AlertLayer").style.zIndex = "-1";

  document.getElementById("BlockLayer").style.zIndex = "-1";

}

