//----------------------- FIX MOZILLA INNERTEXT
if (typeof Element != 'undefined' && Element.prototype && 
document.createRange) {
   Element.prototype.__defineGetter__(
     'innerText',
     function () {
       var range = document.createRange();
       range.selectNodeContents(this);
       return range.toString();
     }
   );
   Element.prototype.__defineSetter__(
     'innerText',
     function (text) {
       var range = document.createRange();
       range.selectNodeContents(this);
       range.deleteContents();
       this.appendChild(document.createTextNode(text));
     }
   );
}

//----------------------------------------------------------------
function iiCheckboxFix() {
	//alert('fix');
	cbox = MM_findObj('iicb1');
	cbox.checked=false;
	cbox = MM_findObj('iicb2');
	cbox.checked=false;
	cbox = MM_findObj('iicb3');
	cbox.checked=false;
	cbox = MM_findObj('iicb4');
	cbox.checked=false;
}

function iiFixJH() {
	cbox = MM_findObj('iicbJH');
	cbox.checked=false;
}

function tickAllImport() {
	check = document.forms['importList'].tickall.checked;
	for (i=0;i<document.forms['importList'].elements.length;i++) {
		//if typeof(document.forms['importList'].elements[i])=
		document.forms['importList'].elements[i].checked=check;
	}
}

//-------------------------- PAGE DATE & TIME

// CLOCK
function showMilitaryTime() {
return true
}

function showTheHours(theHour) {
if (showMilitaryTime() || (theHour > 0 && theHour < 13)) {
return (theHour)
}
if (theHour == 0) {
return (12)
}
return (theHour-12)
}

function showZeroFilled(inValue) {
if (inValue > 9) {
return ":" + inValue
}
return ":0" + inValue
}

function showAmPm() {
if (showMilitaryTime()) {
return ("")
}
if (now.getHours() < 12) {
return (" am")
}
return (" pm")
}

function showTheTime() {
now = new Date
document.getElementById('sitetime').innerText = showTheHours(now.getHours()) + showZeroFilled(now.getMinutes()) + showZeroFilled(now.getSeconds()) + showAmPm()
setTimeout("showTheTime()",1000)
}

function dispDate(dateVal) {
DaystoAdd=dateVal
TodaysDate = new Date();
TodaysDay = new Array('Sunday', 'Monday', 'Tuesday','Wednesday', 'Thursday', 'Friday', 'Saturday');
TodaysMonth = new Array('January', 'February', 'March','April', 'May','June', 'July', 'August', 'September','October', 'November', 'December');
DaysinMonth = new Array('31', '28', '31', '30', '31', '30', '31', '31', '30', '31', '30', '31');
function LeapYearTest (Year) {
if (((Year % 400)==0) || (((Year % 100)!=0) && (Year % 4)==0)) {
return true;
}
else {
return false;
}
}
CurrentYear = TodaysDate.getYear();
if (CurrentYear < 2000) 
CurrentYear = CurrentYear + 1900;
currentMonth = TodaysDate.getMonth();
DayOffset = TodaysDate.getDay();
currentDay = TodaysDate.getDate();
month = TodaysMonth[currentMonth];
if (month == 'February') {
if (((CurrentYear % 4)==0) && ((CurrentYear % 100)!=0) || ((CurrentYear % 400)==0)) {
DaysinMonth[1] = 29;
}
else {
DaysinMonth[1] = 28;
}
}
days = DaysinMonth[currentMonth];
currentDay += DaystoAdd;
if (currentDay > days) {
if (currentMonth == 11) {
currentMonth = 0;
month = TodaysMonth[currentMonth];
CurrentYear = CurrentYear + 1
}
else {
month =
TodaysMonth[currentMonth+1];
}
currentDay = currentDay - days;
}
DayOffset += DaystoAdd;
function offsettheDate (offsetCurrentDay) {
if (offsetCurrentDay > 6) {
offsetCurrentDay -= 6;
DayOffset = TodaysDay[offsetCurrentDay-1];
offsettheDate(offsetCurrentDay-1);
}
else {
DayOffset = TodaysDay[offsetCurrentDay];
return true;
}
}
offsettheDate(DayOffset);TheDate  = DayOffset + ', ';
TheDate += month + ' ';
TheDate += currentDay + ', '; 
if (CurrentYear<100) CurrentYear="19" + CurrentYear;
TheDate += CurrentYear;
document.write(' '+TheDate);
}

function lyfPop(URL) {
	$popWin = pb_popUp(URL,'LinkYourFriends','N','N','N','N','N','Y',420,520);
}
function xlPop(URL) {
	$popWin = pb_popUp(URL,'LinkYourFriends','N','N','N','N','N','Y',600,520);
}
