// New Window
function openNewWindow(window) {
open (window,"NewWindow","left=500, top=180, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=168, height=118");
}

function isVerOk() {
	ns3up = (browserName == "Netscape" && browserVer >= 3);
	ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);
	if(ns3up||ie4up){return true;}
	else{return false;}
}

// Form alerts
function checkform(form) {

  if (form.name.value == "") {
    alert("'Full name' section is required.");
    form.name.focus();
    form.name.select();
    return false;
  }else if (form.mail.value == "") {
    alert("'Email address' section is required.");
    form.mail.focus();
    form.mail.select();
    return false;
  }

  if(form.mail.value != "")
  {
    if((form.mail.value.indexOf("@") < 0) || (form.mail.value.indexOf(".") < 0))
    {
      alert("That is not a valid email address");
      form.mail.focus();
      form.mail.select();
      return false;
    }
  }
  
  return true;
}

// Date function
// Author: Calvin Hansung Lee
// Date: Feb 10th 2004

function GetDay(intDay){
	var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", 
			 "Thursday", "Friday", "Saturday")
	return DayArray[intDay];
}

function MakeArray(n)  {
     this.length = n;
     return this;
}
monthNames = new MakeArray(12);
monthNames[1] = "January";
monthNames[2] = "Febuary";
monthNames[3] = "March";
monthNames[4] = "April";
monthNames[5] = "May";
monthNames[6] = "June";
monthNames[7] = "July";
monthNames[8] = "August";
monthNames[9] = "September";
monthNames[10] = "October";
monthNames[11] = "November";
monthNames[12] = "December";

function customDateString(oneDate)  {
     var theMonth = monthNames[oneDate.getMonth() + 1];
     if(oneDate.getDate() == 1||oneDate.getDate() == 21||oneDate.getDate() == 31)
     	return "<font color=black>"+ GetDay(oneDate.getDay())+ ", " + theMonth + " " + oneDate.getDate() + "st" + "</font>";
     else if(oneDate.getDate() == 2||oneDate.getDate() == 22)
     	return "<font color=black>"+ GetDay(oneDate.getDay())+ ", "  + theMonth + " " + oneDate.getDate() + "nd" + "</font>";
     else if(oneDate.getDate() == 3||oneDate.getDate() == 23)
     	return "<font color=black>"+ GetDay(oneDate.getDay())+ ", "  + theMonth + " " + oneDate.getDate() + "rd" + "</font>";
     else
     	return "<font color=black>"+ GetDay(oneDate.getDay())+ ", " + theMonth + " " + oneDate.getDate() + "th" + "</font>";
}

//New window 2
var win1Open = null

function displayImage(picName, windowName, windowWidth, windowHeight){
return window.open(picName,windowName,"toolbar=no,scrollbars=no,resizable=no,width=" + (parseInt(windowWidth)+20) + ",height=" + (parseInt(windowHeight)+15)) 
}

function winClose(){
if(win1Open != null) win1Open.close() 
}

function doNothing(){}

function displayImage(picName, windowName, windowWidth, windowHeight){
var winHandle = window.open("" ,windowName,"toolbar=no,scrollbars=no,resizable=no,width=" + windowWidth + ",height=" + windowHeight)
if(winHandle != null){
	var htmlString = "<html><head><title>Picture</title></head>" 
	htmlString += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"
	htmlString += "<a href=javascript:window.close()><img src=" + picName + " border=0 alt=Close this window></a>"
	htmlString += "</body></html>"
	winHandle.document.open()
	winHandle.document.write(htmlString)
	winHandle.document.close()
} 
if(winHandle != null) winHandle.focus()
	return winHandle
}


function wopen(url, t, w, h) {
var sw;
var sh;

sw = (screen.Width - w) / 2;
sh = (screen.Height - h) / 2;

window.open(url, t, 'Width='+w+'px, Height='+h+'px, Left='+sw+', Top='+sh);
}

//Roll-over
function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  }
}

function na_preload_img()
{
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null)
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  }
}

function na_change_img_src(name, nsdoc, rpath, preload)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  }
}
