// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::			     Mega Popup Window Script       	  :::
// :::::			   Created by Justin Stephenson   		  :::
// :::::			 6/29/01; last revised 06/29/01 		  :::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

var megaPopupWin = null;
lastName = null;

function megaPopup(URL,flexType,windowType,width,height,screenHorizPosition,screenVertPosition,stackOrder,temporaryName) {
	if	(screenHorizPosition == 'center')	{ leftPosition = (screen.width) ? (screen.width - width)/2:100; }
		else { leftPosition = screenHorizPosition; }
	if	(screenVertPosition == 'center')	{ topPosition = (screen.height) ? (screen.height - height)/2:100; }
		else { topPosition = screenVertPosition; }
	if (windowType == 'full') { styleAttributes = "toolbar=yes,location=yes,directories=yes,menubar=yes,status=yes"; } else if (windowType == 'basic') { styleAttributes = "toolbar=yes,location=no,directories=no,menubar=no,status=no"; } else if (windowType == 'bare') { styleAttributes = "toolbar=no,location=no,directories=no,menubar=no,status=no"; } else { styleAttributes = "toolbar=yes,location=yes,directories=yes,menubar=yes,status=yes"; }
	if (flexType == 'frozen') { flexAttributes = "scrollbars=no,resizable=no"; } else if (flexType == 'rigid') { flexAttributes = "scrollbars=yes,resizable=no"; } else if (flexType == 'loose') { flexAttributes = "scrollbars=yes,resizable=yes"; } else { flexAttributes = "scrollbars=yes,resizable=yes"; }
	if (width == 'total') { width = screen.width; }
	if (height == 'total') { height = screen.height; }
	// *** consider a browser sniff to serve screenX and screenY to Navigator 4 ***
	windowAttributes = 'width=' + width + ',height=' + height + ',top=' + topPosition + ',left=' + leftPosition + ',' + styleAttributes + ',' + flexAttributes;
	// if the temporary and last names match, the popup is repopulating an existing window; the existing window must be closed to allow its replacement to use new and different style, flexibility, and position attributes
	if (temporaryName == lastName) { if (megaPopupWin != null && !megaPopupWin.closed) { oldWin = megaPopupWin; oldWin.name = "oldWin"; oldWin.close(); } }
	lastName = temporaryName;
	megaPopupWin = window.open(URL,temporaryName,windowAttributes);
	if (stackOrder == 'top') { megaPopupWin.focus(); megaPopupWin.location = URL; }
		else if (stackOrder == 'bottom') { megaPopupWin.blur(); megaPopupWin.location = URL; megaPopupWin.blur(); self.focus(); }
}


// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::				  Closewindow Script		          :::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function closeWin()
	{
		this.close();
		PrintWindow = null;
	}
	
	
//rss embed

function readRSS(URI, number) {
	var hrSwitch = true, authorSwitch = true, dateSwitch = true, doubleSpace = true, showBody = false, showTime12 = false, showTime24 = false, showTitle = true, altform = false, datefirst = false;


	if (arguments.length > 2)
		for (i=2; i<arguments.length; i++) {
			if (arguments[i] == "NOHR")
				hrSwitch = false;
			if (arguments[i] == "NOAUTHOR")
				authorSwitch = false;
			if (arguments[i] == "NODATE")
				dateSwitch = false;
			if (arguments[i] == "NODOUBLESPACE")
				doubleSpace = false;
			if (arguments[i] == "NOTITLE")
				showTitle = false;
			if (arguments[i] == "SHOWBODY")
				showBody = true;
			if (arguments[i] == "SHOWTIME12")
				showTime12 = true;
			if (arguments[i] == "SHOWTIME24")
				showTime24 = true;
			if (arguments[i] == "ALTDATEAUTH")
				altform = true;
			if (arguments[i] == "DATEFIRST")
				datefirst = true;
		}




	if(window.ActiveXObject) {
		var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async=false;
		while(xmlDoc.readyState!=4) document.write('Loading...');
	}
	else if(document.implementation&&document.implementation.createDocument)
		xmlDoc=document.implementation.createDocument("","doc",null);
	xmlDoc.load(arguments[0]);
	items=xmlDoc;

	function verify() {if(xmlDoc.readyState!=4) return false;}

	function formatRSS(number) {
		var items_count;
		if ((number == 0) || (number > items.getElementsByTagName('item').length))
			items_count=items.getElementsByTagName('item').length;
		else
			items_count=number;
		var date=new Array(), time=new Array(), link=new Array(), title=new Array(), description=new Array(), guid=new Array(), body=new Array(), temp, temp2;

		for(var i=0; i<items_count; i++) {
			if(items.getElementsByTagName('item')[i].getElementsByTagName('dc:date').length==1)
				date[i]=items.getElementsByTagName('item')[i].getElementsByTagName('dc:date')[0];
			if(items.getElementsByTagName('item')[i].getElementsByTagName('link').length==1)
				link[i]=items.getElementsByTagName('item')[i].getElementsByTagName('link')[0];
			if(items.getElementsByTagName('item')[i].getElementsByTagName('guid').length==1)
				guid[i]=items.getElementsByTagName('item')[i].getElementsByTagName('guid')[0];
			if(items.getElementsByTagName('item')[i].getElementsByTagName('title').length==1)
				title[i]=items.getElementsByTagName('item')[i].getElementsByTagName('title')[0];
			if(items.getElementsByTagName('item')[i].getElementsByTagName('dc:creator').length==1)
				description[i]=items.getElementsByTagName('item')[i].getElementsByTagName('dc:creator')[0];
			if(items.getElementsByTagName('item')[i].getElementsByTagName('content:encoded').length==1)
				body[i]=items.getElementsByTagName('item')[i].getElementsByTagName('content:encoded')[0];

			temp = date[i].firstChild.nodeValue;
			date[i] = temp.substring(0,temp.indexOf("T"));


			if (showTime24)
				time[i] = temp.substring(temp.indexOf("T")+1,temp.indexOf("Z"));

			else if (showTime12) {
				temp2 = temp.substring(temp.indexOf("T")+1,temp.indexOf("T")+3);
				if (temp2 > 12)
					time[i] = temp2 - 12;
				else	
					time[i] = temp2;
				time[i] = time[i] + temp.substring(temp.indexOf("T")+3,temp.indexOf("Z"));

			}

		}

		if((description.length==0)&&(title.length==0)) return false;

		var ws=/\S/;

		for(var i=0; i<items_count; i++) {
			var title_w, link_w;
			if(document.all)
				title_w=(title.length>0)?title[i].text:"<i>Untitled</i>";
			else
				title_w=(title.length>0)?title[i].firstChild.nodeValue:"<i>Untitled</i>";

			link_w=(link.length>0)?link[i].firstChild.nodeValue:"";
			if (datefirst && !altform) {
				document.write('<a class="rssdate">' + date[i]);
				if (showTime12 || showTime24) document.write(' - ' + time[i]);
				document.write(':</a><BR>');
			}
			if(link.length==0) link_w=(guid.length>0)?guid[i].firstChild.nodeValue:"";
			if(title.length>0) title_w=(!ws.test(title_w))?"<i>Untitled</i>":title_w;
			if (showTitle) document.write('<div STYLE="word-wrap: break-word"><a href="'+link_w+'" class="rsslink" target="_parent">'+title_w+'</a></div>');
			if(showBody) document.write(body[i].firstChild.nodeValue + '<BR>');
			if (dateSwitch & !altform & !datefirst) {
				document.write('<a class="rssdate">(' + date[i]);
				if (showTime12 || showTime24) document.write(' - ' + time[i]);
				document.write(')</a><BR>');
			}
			if (authorSwitch && description.length>0 &!altform)
				document.write('<a class="rssauthor"> by: '+description[i].firstChild.nodeValue+'</a><BR>');
			if (altform) {
				if (description[i].firstChild)
					document.write('- <a class="rssauthor">' +description[i].firstChild.nodeValue+ '</a> :: <a class="rssdate">(' +date[i]+ ')</a><BR>');
				else
					document.write('- <a class="rssauthor">No Name In Profile</a> :: <a class="rssdate">(' +date[i]+ ')</a><BR>');
			}
			if (hrSwitch) document.write('<HR>'); if (doubleSpace) document.write('<BR>');
		}

	}

	if(typeof(xmlDoc)!="undefined") {
		if(window.ActiveXObject) formatRSS(arguments[1]);
		else xmlDoc.onload=formatRSS;
	}
}
<!--

/*

StreamAudio Player Launch

*/

if(navigator.appVersion.indexOf("AOL") > -1)
 {

 //AOL

 var opt1 = 'width=472,height=257';

 var opt2 = 'width=472,height=257';

 } else if(navigator.platform.indexOf("Win") > -1)

 {

 //IE and NS Windows

 var opt1 = 'width=472,height=257,top=420,left=520,screenY=420,screenX=520';

 var opt2 = 'width=472,height=257,top=250,left=300,screenY=250,screenX=300';

 } else if(navigator.platform.indexOf("Mac") > -1)

 {

 //IE and NS Mac

 if(navigator.appName.indexOf("Microsoft") > -1)


 {
 var opt1 = 'width=455,height=240,top=420,left=520,screenY=420,screenX=520';
 var opt2 = 'width=455,height=240,top=250,left=300,screenY=250,screenX=300';
 var resizable='yes';
 } else if(navigator.appName.indexOf("Netscape") > -1)
 {
var opt1 = 'width=472,height=257,top=420,left=520,screenY=420,screenX=520';
 var opt2 = 'width=472,height=257,top=250,left=300,screenY=250,screenX=300';
 }
 }
 function openPlayer(URL)
    {
    if(screen.width >= 1000)
 {
 window.open(URL,'Streamaudio_Player',opt1);
 }
    if(screen.width <= 800)
 {window.open(URL,'Streamaudio_Player',opt2);
 }
}  //-->




//-vertical
 
var mySlide = new Fx.Slide('test');
 
$('slidein').addEvent('click', function(e){
	e = new Event(e);
	mySlide.slideIn();
	e.stop();
});
 
$('slideout').addEvent('click', function(e){
	e = new Event(e);
	mySlide.slideOut();
	e.stop();
});
 
$('toggle').addEvent('click', function(e){
	e = new Event(e);
	mySlide.toggle();
	e.stop();
});
 
$('hide').addEvent('click', function(e){
	e = new Event(e);
	mySlide.hide();
	e.stop();
});
 
 
//--horizontal
 
var mySlide2 = new Fx.Slide('test2', {mode: 'horizontal'});
 
$('slidein2').addEvent('click', function(e){
	e = new Event(e);
	mySlide2.slideIn();
	e.stop();
});
 
$('slideout2').addEvent('click', function(e){
	e = new Event(e);
	mySlide2.slideOut();
	e.stop();
});
 
$('toggle2').addEvent('click', function(e){
	e = new Event(e);
	mySlide2.toggle();
	e.stop();
});
 
$('hide2').addEvent('click', function(e){
	e = new Event(e);
	mySlide2.hide();
	e.stop();
});

