// +------------------------------------------------------------+
// | Created 05/24/2002              Last Modified 05/24/2002   |
// | Web Site:                 http://www.AmericanCatholic.org  |
// +------------------------------------------------------------+
// | Contains all the scripts for the Saint of the Day feature; |
// | Less clutter on page				        |
// |                                                            |
// | 								|
// +------------------------------------------------------------+


// "SODAudioPrefs" Script begins
<!--
var objSODAudioPrefs;
var sodapUrl;
var sodapWinWidth;
var sodapWinHeight;
var sodapOptions;

function openSODAudioPrefs(sodapUrl) {
sodapWinWidth = 430;
sodapWinHeight = 430;
sodapOptions = "width=" + sodapWinWidth + ",height=" + sodapWinHeight + ",scrollbars=no,resizable=yes,menubar=no,status=no,toolbar=no,location=no,directories=no";
 if (sodapUrl) {  
  if (!objSODAudioPrefs || objSODAudioPrefs.closed){
    objSODAudioPrefs = window.open(sodapUrl,'SODAudioPrefswin', sodapOptions);  // Open a new window and show the specified page
    objSODAudioPrefs.focus();
	objSODAudioPrefs.moveTo(10,40);   
   									  }
  else{
    objSODAudioPrefs.close();
	objSODAudioPrefs = window.open(sodapUrl,'SODAudioPrefswin', sodapOptions);  // Open a new window and show the specified page
    objSODAudioPrefs.focus();
	objSODAudioPrefs.moveTo(10,40);
  	  }
 	    }
}

// "SODAudioPrefs"  Script Ends -->
// +------------------------------------------------------------+

// "Calendar" Script begins
<!--
var objCalendar;
var calURL;
var calWinWidth;
var calWinHeight;
var calOptions;


function openCalendar(calURL) {
calWinWidth = 200;
calWinHeight = 460;
var calOptions = "width=" + calWinWidth + ",height=" + calWinHeight + ",scrollbars=no,resizable=yes,menubar=no,status=no,toolbar=no,location=no,directories=no";
 if (calURL) {  
  if (!objCalendar || objCalendar.closed){
    objCalendar = window.open(calURL,'Calendarwin', calOptions);  // Open a new window and show the specified page
    objCalendar.focus();
	objCalendar.moveTo(506,40);   
   									  }
  else{
    objCalendar.close();
	objCalendar = window.open(calURL,'Calendarwin', calOptions);  // Open a new window and show the specified page
    objCalendar.focus();
	objCalendar.moveTo(506,40);
  	  }
 	    }
}

// Script Ends -->
// +------------------------------------------------------------+
// "blurred and focused" Script begins
<!--
var timer = '';
function blurred() {
    timer = setTimeout('self.close()',7000);
}

function focused() {
    if (timer != '')
        clearTimeout(timer);
}
//-->

// Script Ends -->
// +------------------------------------------------------------+
// "updateClose" Script begins
<!--
var timerOnLoad = '';
var agent = navigator.userAgent;

function updateClose() {
		if (agent.indexOf("Netscape6")!= -1) {
			window.opener.document.location.reload()
		}
		else if (agent.indexOf("MSIE")!= -1) {
			window.opener.navigate(window.opener.document.location.href);
		}
		else if (agent.indexOf("Mozilla/4")!= -1) {
			
			window.opener.document.location.reload()
		}
		else { 
			window.opener.document.location.reload()
		}
    timerOnLoad = setTimeout('self.close()',3000);
    
}
//-->

// Script Ends -->
// +------------------------------------------------------------+
// "refreshParent" Script begins
<!--

function refreshParent() {
//  window.opener.navigate(window.opener.document.location.href);
//  self.close()
  window.opener.location.href = window.opener.location.href;
  if (window.opener.progressWindow) 
    window.opener.progressWindow.close();
  window.close();
}
//-->

// Script Ends -->
// +------------------------------------------------------------+
// "radio_browserCheck" Script begins
//  Function:		radio_browserCheck
//
//  Description:
//	A browser object used to detect browser name and version, as well
//	as platform.
//
// Arguments: none
//
//  Return value: none
//
//  Side Effects:
//  Uses the object to assign a browser name and version to
//  serve up specific content.
//

function radio_browserCheck() 
{
	var browser_type = navigator.appName
	if (browser_type == "Netscape") this.browser_type = "ns"
	else if (browser_type == "Microsoft Internet Explorer") this.browser_type = "ie"
	else this.browser_type = browser_type
	
	this.version = parseInt(navigator.appVersion)
	this.platform = navigator.appVersion
	
	this.w = this.platform.indexOf("Win")
	this.m = this.platform.indexOf("Mac")
	
	/* Netscape tests */
	this.ns = (this.browser_type == "ns" && this.version >= 4)
	this.nswin = (this.browser_type == "ns" && this.w != -1 && this.version >= 4)
	this.nsmac = (this.browser_type == "ns" && this.m != -1 && this.version >= 4)
	this.ns4win = (this.browser_type=="ns" && this.w != -1 && this.version == 4)
	this.ns4mac = (this.browser_type == "ns" && this.m != -1 && this.version == 4)
	this.ns5win = (this.browser_type == "ns" && this.w != -1 && this.version == 5)
	this.ns5mac = (this.browser_type == "ns" && this.m != -1 && this.version == 5)
	
	/* Internet Explorer  tests */
	this.ie = (this.browser_type == "ie" && this.version >= 4)
	this.iewin = (this.browser_type == "ie" && this.w != -1 && this.version >= 4)
	this.iemac = (this.browser_type == "ie" && this.m != -1 && this.version >= 4)
	this.ie4win = (navigator.userAgent.indexOf('MSIE 4') > 0 && this.w != -1)
	this.ie4mac = (navigator.userAgent.indexOf('MSIE 4') > 0 && this.m != -1)
	this.ie5win = (navigator.userAgent.indexOf('MSIE 5') > 0 && this.m != -1)
	this.ie5mac = (navigator.userAgent.indexOf('MSIE 5') > 0 && this.m != -1)
	if (this.ie5) this.version = 5
	this.min = (this.ns||this.ie)
}

webBrowser = new radio_browserCheck()

// Script Ends -->
// +------------------------------------------------------------+
// Script Ends -->
// +------------------------------------------------------------+
// "radio_browserCheck" Script begins
//  Function:		radio_browserCheck
//
//  Description:
//	A browser object used to detect browser name and version, as well
//	as platform.
//
//  Arguments: none
//
//  Return value: none
//
//  Side Effects:
//  Uses the object to assign a browser name and version to
//  serve up specific content.
//

<!--//
function openWindow(url,winname,toolbar,location,directories,status,border,menubar,scrollbars,resizable,ns6width,ns6height,iewidth,ieheight,ns4width,ns4height,width,height,top,left) {
agent = navigator.userAgent;
self.name = "parentwindow"; // names current window as "parentwindow"
windowName = "PopUpWindow";
// set blank attributes
if (toolbar=='') {toolbar=0}; 
if (location=='') {location=0};
if (directories=='') {directories=0};
if (status=='') {status=0};
if (border=='') {border=0};
if (menubar=='') {menubar=0};
if (scrollbars=='') {scrollbars=0};
if (resizable=='') {resizable=0};
if (ns6width=='') {ns6width=0};
if (ns6height=='') {ns6height=0};
if (iewidth=='') {iewidth=0};
if (ieheight=='') {ieheight=0};
if (ns4width=='') {ns4width=0};
if (ns4height=='') {ns4height=0};
if (width=='') {width=0};
if (height=='') {height=0};
if (top=='') {top=0};
if (left=='') {left=0};

params = ""; 
params += "toolbar="+toolbar+",";
params += "location="+location+",";
params += "directories="+directories+",";
params += "status="+status+",";
params += "border="+border+",";
params += "menubar="+menubar+",";
params += "scrollbars="+scrollbars+",";
params += "resizable="+resizable+",";
if (agent.indexOf("Netscape6")!= -1) {
 params += "screenX="+left+",";
 params += "screenY="+top+",";
 params += "width="+ns6width+",";
 params += "height="+ns6height;
}
else if (agent.indexOf("MSIE")!= -1) {
 params += "left="+left+",";
 params += "top="+top+",";
 params += "width="+iewidth+",";
 params += "height="+ieheight;
}
else if (agent.indexOf("Mozilla/4")!= -1) {
 params += "screenX="+left+",";
 params += "screenY="+top+",";
 params += "width="+ns4width+",";
 params += "height="+ns4height;
}
else { 
 params += "left="+left+",";
 params += "top="+top+",";
 params += "width="+width+",";
 params += "height="+height;
}
LNwin = window.open(url, winname , params);
 if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
 LNwin = window.open(url, winname , params);
}
if (!LNwin.opener) { LNwin.opener = window; } 
else {LNwin.focus();} 
} 
// -->
// Script Ends -->
// +------------------------------------------------------------+
