function openNewWindow(fileName,windowName,theWidth,theHeight,theScrollBar,resizable,location,status,menubar,toolbar) {
    if (windowName == "newMessageWindow")  {
      //generate random window ID
      windowName = new String(Math.round(Math.random() * 100000));
    }
    if (theScrollBar != 1) theScrollBar = 0;
    if (resizable != 1) resizable = 0;
    if (location != 1) location = 0;
    if (status != 1) status = 0;
    if (menubar != 1) menubar = 0;
    if (toolbar != 1) toolbar = 0;
    window.open(fileName,windowName,"toolbar="+toolbar+",location="+location+",directories=0,status="+status+",menubar="+menubar+",scrollbars="+theScrollBar+",resizable="+resizable+",width="+theWidth+",height="+theHeight)
}

function popupMessage(cMessage) {
    alert(cMessage);
}

function empty(eVal) {
    // tests for empty
    var cTestStr, cChar;
    cTestStr="";
    for (var n=0; n<eVal.length; n++) {
    	cChar=eVal.charAt(n);
	if (cChar != " ")
    	   cTestStr+=cChar
    }
    return (cTestStr) ? false : true
}

function displayDate(dDate) {
	var Year = dDate.getFullYear();
	var Day = dDate.getDate();
	switch (dDate.getDay()) {
		case 0:
			Weekday = 'Sunday';
			break;
		case 1:
			Weekday = 'Monday';
			break;
		case 2:
			Weekday = 'Tuesday';
			break;
		case 3:
			Weekday = 'Wednesday';
			break;
		case 4:
			Weekday = 'Thursday';
			break;
		case 5:
			Weekday = 'Friday';
			break;
		default:
			Weekday = 'Saturday';
			break;
	}
		switch (dDate.getMonth()) {
		case 0:
			Month = 'January';
			break;
		case 1:
			Month = 'February';
			break;
		case 2:
			Month = 'March';
			break;
		case 3:
			Month = 'April';
			break;
		case 4:
			Month = 'May';
			break;
		case 5:
			Month = 'June';
			break;
		case 6:
			Month = 'July';
			break;
		case 7:
			Month = 'August';
			break;
		case 8:
			Month = 'September';
			break;
		case 9:
			Month = 'October';
			break;
		case 10:
			Month = 'November';
			break;
		default:
			Month = 'December';
			break;
	}	

	return Weekday + ', ' + Month + ' ' + Day;
}


function get_random()
{
    var ranNum= Math.round(Math.random()*1);
    return ranNum;
}

		var SearchTimer = 0;

	function GoToPage(page,Incr) {
		var CurPage = Number(page.value);
		if (Incr && CurPage+Incr <= nMaxPages && CurPage+Incr > 0) {
			page.value=CurPage+Incr;
		}

		if (page.value != CurPage) {
			window.clearTimeout(SearchTimer);
			SearchTimer = window.setTimeout('document.Search.submit()', 350)
		}
	}