/* Javascript functions */
function generateDate() {
	// Get today's current date.
	var now = new Date();
	// Array list of days.
	var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
	// Array list of months.
	var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
	// Calculate the number of the current day in the week.
	var date = ((now.getDate()<10) ? "0" : "") + now.getDate();
	// Calculate four digit year.
	function fourdigits(number) {
		return (number < 1000) ? number + 1900 : number;
	}
	// Join it all together
	// today =  days[now.getDay()] + ", " + months[now.getMonth()] + " " + date + ", " + (fourdigits(now.getYear())) ;
	var today =  months[now.getMonth()] + "&nbsp;" + date + ",&nbsp;" + (fourdigits(now.getYear())) ;
	// Close the document (be nice)
	document.writeln(today);
	document.close();
}
function usejscode(url)
{
	document.write("<script language='javascript' src='" + url + "' type='text/javascript'><!-- Placeholder to ensure that the CMS will include an ending script element --></script>");
}
function popUpWindow(linkURL, windowName, windowTitle, windowWidth, windowHeight) {
	// The following code snippet provides the pop-up window functionality for external links.  The basic idea is that the function opens a smaller window (without address bar) and then turns the focus onto it.  By default it's meant for opening up pop-ups of images, but if you set windowTitle to "noImage", then it will open up the pop-up using the linkURL.  IF you want the <a> link to disply in the href attribute, make sure to use the onClick function to call this function and then call "return false;" (that will prevent the href link from working in javascript-enabled browsers).
	// The general format to call this function in an HTML page is: <a href="URL" onclick="popUpWindow(this, 'windowName', 'windowTitle', 'windowWidth', 'windowHeight'); return false;">TEXT-OR-IMAGE</a>
	
	var popUpWin = window.open(unescape(linkURL), windowName, "menubar,resizable,scrollbars,width=" + windowWidth + ",height=" + windowHeight);
	popUpWin.focus();
	return false; 
}
function onBrowseByChange(value) {
	if(value != "") {
		//alert(value);
		parent.location = value;
	}
}
var detect = navigator.userAgent.toLowerCase();
var OS,browser,total,thestring;
var version = 0;
if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";
if (!version) version = detect.charAt(place + thestring.length);
if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}
if(navigator.userAgent.indexOf("Mac") != -1) {
	if(navigator.appName.indexOf("Microsoft Internet Explorer") != -1) {
		document.write("<script language='javascript' src='/cms/renderfile/ONC/content/css/browse-detect-ie-mac.js' type='text/javascript'><!-- Placeholder to ensure that the CMS will include an ending script element --></script>");
		document.write("<script language='javascript' src='/css/browse-detect-ie-mac.js' type='text/javascript'><!-- Placeholder to ensure that the CMS will include an ending script element --></script>");
	}
	else {
		document.write("<script language='javascript' src='/cms/renderfile/ONC/content/css/browse-detect.js' type='text/javascript'><!-- Placeholder to ensure that the CMS will include an ending script element --></script>");
		document.write("<script language='javascript' src='/css/browse-detect.js' type='text/javascript'><!-- Placeholder to ensure that the CMS will include an ending script element --></script>");
		
	}
}
else {
	document.write("<script language='javascript' src='/cms/renderfile/ONC/content/css/browse-detect.js' type='text/javascript'><!-- Placeholder to ensure that the CMS will include an ending script element --></script>");
		document.write("<script language='javascript' src='/css/browse-detect.js' type='text/javascript'><!-- Placeholder to ensure that the CMS will include an ending script element --></script>");
		
}
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}