function ShowDate(showYear) {
  var DayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  var MonthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
  var curDate = new Date();
  document.write(DayNames[curDate.getDay()] + ", <b>" + MonthNames[curDate.getMonth()] + " " + curDate.getDate());
  if (showYear == 1) {
    var curYear = curDate.getYear();
    if (curYear < 1000) {
      curYear += 1900
    }
    document.write(", " + curYear);
  }
  document.write("</b>");
}

var win = null;
function PopupWindow(url, name, w, h){
	var l = (screen.width - w) / 2;
	var t = (screen.height - h) / 2;
	win = window.open(url, name, 'height='+h+',width='+w+',top='+t+',left='+l+',scrollbars=yes,resizable=yes');
	if (parseInt(navigator.appVersion) >= 4) { 
		win.window.focus();
	}
}

var win = null;
function PopupWindowFull(url, name){

	w = screen.width;
	h = screen.height;

	var l = (screen.width - w) / 2;
	var t = (screen.height - h) / 2;
	win = window.open(url, name, 'height='+h+',width='+w+',top='+t+',left='+l+',scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes,status=yes');
	if (parseInt(navigator.appVersion) >= 4) { 
		win.window.focus();
	}
}

function menuClick(id) {

	var e = document.getElementById(id);
	var d = 'block'

	if (e.style.display=='block') {
		var d = 'none';
		createCookie(id,'c',1);

	}
	else {
		createCookie(id,'e',1);
	}

	e.style.display=d;
	return false;
}

function hideStatus() {
	window.status=''
	return true
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function trim(str) {
   return str.replace(/^\s*|\s*$/g,"");
}