function initPage()
{

	var inputs = document.getElementsByTagName("input");
	if (inputs){
		for (var i=0; i<inputs.length; i++)
		{
			if (inputs[i].type == "text" && (inputs[i].name == "search"))
			{
				var form = getAncestor(inputs[i], "form");
				inputs[i].onfocus = function () {
					if ((this.value == "search")){
						this.value = "";
					}
				}
				inputs[i].onblur = function () {
					if (this.value == "" && this.name == "search") this.value = "search";
				}
			}
		}
	}
	var uls = document.getElementsByTagName("ul");
	if (uls){
		for (var i=0; i<uls.length; i++)
		{
			if (uls[i].className == "recently")
			{
				var lis = uls[i].childNodes;
				if (lis){
					for (var k=0; k<lis.length; k++){
						if (lis[k].childNodes.length <= 2){
							lis[k].innerHTML = "&ndash;&nbsp;" + lis[k].innerHTML;
						}
					}
				}
				var inul = uls[i].getElementsByTagName("ul");
				if (inul){
					for (var j=0; j<inul.length; j++){
						inul[j].parentNode.innerHTML = "+&nbsp;" + inul[j].parentNode.innerHTML;
					}
				}
			}
		}
	}
}

function getAncestor(element, tagName)
{
	var node = element;
	while (node.parentNode && (!node.tagName || (node.tagName.toUpperCase() != tagName.toUpperCase())))
		node = node.parentNode;
	return node;
}


if (window.addEventListener){
	window.addEventListener("load", initPage, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", initPage);
}




/*
Live Date Script- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/


var dayarray=new Array("SUN","MON","TUES","WED","THURS","FRI","SAT")
var montharray=new Array("JAN","FEB","MAR","APR","MAY","JUNE","JULY","AUG","SEPT","OCT","NOV","DEC")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here - removed surrounding <small> tag
var cdate="<span style='color:#666;letter-spacing:0;'>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn+"</span>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function displaytime(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}


/* Hide-Show script */

function DoReadMore(tid1,tid2,tid3) {
  document.getElementById(tid1).style.display = "none"; // more
  document.getElementById(tid2).style.display = "block"; // less
  document.getElementById(tid3).className = "show printAlways"; // text
}
function AbandonReadMore(tid1,tid2,tid3) {
  document.getElementById(tid1).style.display = "none"; // less
  document.getElementById(tid2).className = "hide printAlways";
  document.getElementById(tid3).style.display = "block"; // more
}


//prompt-first email link function window.navigator.appVersion.indexOf("MSIE")==-1
function ShowPrompt(email, subject)
{   
//    var result;
//    if (!window.showModalDialog)
//    {
        showPopWin("EmailPrompt.aspx?Email=" + email + "&Subject=" + escape(subject), 475, 500, null)
//        var features = "status=0,help=0,resizable=0,scroll=1,height=475,width=500,screenY=" + ((screen.availHeight-475)/2) + ",screenX=" + ((screen.availWidth-500)/2);
//        alert(features);
//        alert(screen.availHeight);
//        result = window.open("EmailPrompt.aspx?Email=" + email + "&Subject=" + escape(subject), "popup",  features);
//    }
//    else
//    {
//        var win = "status:0;help:0;resizable:0;scroll:1;dialogHeight:475px;dialogWidth:500px;center:yes";
//        result = window.showModalDialog("EmailPrompt.aspx?Email=" + email + "&Subject=" + escape(subject), window, win);
//    }
}


// Use a variable to reference the embedded SWF file.
var flashVideoPlayer;

/* When the HTML page loads (through the onLoad event of the <body> tag), it calls the initialize() function. */
function initialize() {
	/* Check whether the browser is IE. If so, flashVideoPlayer is
		window.videoPlayer. Otherwise, it's document.videoPlayer. The
		videoPlayer is the ID assigned to the <object> and <embed> tags. */
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	flashVideoPlayer = (isIE) ? window['videoPlayer'] : document['videoPlayer'];
}

function callFlashPlayVideo( video ) {
	flashVideoPlayer.playVideoByName("../flv/" + video);
}