  function GetMonth(intMonth){
    var MonthArray = new Array("January", "February", "March",
                               "April", "May", "June",
                               "July", "August", "September",
                               "October", "November", "December") 
    return MonthArray[intMonth] 	  	 
  }

  function getDateStr(){
    var today = new Date()
    var year = today.getYear()
    if(year<1000) year+=1900
    var todayStr = GetMonth(today.getMonth()) + " " + today.getDate()
    todayStr += ", " + year
    return todayStr
  }

  function ToTop() {
	if (divscroll.scrollTop) {
	  	divscroll.scrollTop = 0;
  	} else {
		window.scroll(0,0);
	}
  }

  function SubmitForm(Form) {
  	var FieldList;
  	var OK;
  	var i;
  	var Msg;
  	var ErrorCount;

  	Form.FormName.value = Form.name;
  	
  	OK = true;
  	FieldList = Form.RequiredFields.value.split(',');
  	Msg = '';
  	ErrorCount = 0;
  	for (i=0; i<FieldList.length; i++) {
  		if (Form.elements[FieldList[i]].value == '') {
  			OK = false;
  			Msg += FieldList[i]+ '\n';
  			ErrorCount++;
  		}
  	}

		if (!OK) {
			if (ErrorCount == 1) {
				Msg = 'The following field is required:\n\n' + Msg;
			} else {
				Msg = 'The following fields are required:\n\n' + Msg;
			}
			alert(Msg);
		}

  	return OK;
  }

  function menuhover() {
	if (event.srcElement.className != "menu1selected") { 
		event.srcElement.className = "menu1hover";
	}
  }	

  function menuleave() {
	if (event.srcElement.className != "menu1selected") {
		event.srcElement.className = "menu1";
	}
  }

 
 function popUpImage(sImgPath, iImgW, iImgH) {
	var sHeader = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<html>\n<head>\n<title>The sample of personalised jigsaw puzzle</title>\n</head>\n<body>\n\n";
	var sFooter = "</body>\n</html>";
	var oWin = window.open("Sample", null, "width=" + (iImgW+20) + ",height=" + (iImgH+75) + ",left=50,top=50,directories=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0");
	oWin.document.open();
	oWin.document.write(sHeader);
	oWin.document.write("<div align=center><IMG SRC=\"" + sImgPath + "\" width=" + iImgW + " height=" + iImgH + ">\n");
	oWin.document.write("<P>");
	oWin.document.write("<a href=\"javascript:window.close();\" style=\"font-size:8pt;font-weight:normal;font-family:arial;color:blue\">close window</a></div>");
	oWin.document.write(sFooter);
	oWin.document.close();
 }
