function validateSearch(form){
	var keywordValue = trim(form.keyword.value);
  if(keywordValue==''){
    alert("Please enter a keyword.");
  }else if(keywordValue=='Enter keywords'){
    alert("Please enter a keyword.");
	form.keyword.value='';
	form.keyword.focus();
  }else{
    return true;
  }
  return false;
}

function trim(s) {
	return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
}

function gotoPage(myurl, myselection){
	var address = myurl + myselection;
	this.location.href=address;
}
function updateFormHour(formElementFinish,formElementStart){
	formElementStart.selectedIndex = formElementFinish.selectedIndex;
}
function updateFormMinute(formElementFinish,formElementStart){
	formElementStart.selectedIndex = formElementFinish.selectedIndex;
}
function popup (url)  {
		if (document.all) {
			var xMax = screen.width, yMax = screen.height;
   		} else {
			if (document.layers) {
      			var xMax = window.outerWidth, yMax = window.outerHeight;
			} else {
         		var xMax = 640, yMax=480;
			}
		}
  		var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;	
		window.open(url,'op_window','copyhistory=1,resizable=0,status=1,menubar=0,scrollbars=1,toolbar=0,location=0,width=500,height=460,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');

		/*
		op_window = window.open(url,'op_window','copyhistory=1,resizable=1,status=1,menubar=0,scrollbars=1,toolbar=0,location=0,width=420,height=460');
		*/
}

function popup2 (url, width, height, x, y)  {
	var str = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+width+",height="+height+",screenX="+x+",screenY="+y+",left="+x+",top="+y;
	win = window.open(url,"win",str);
	if (win.opener == null) {
		win.opener = self;
	}
	win.focus();	
	return false;
}

// load 'file' into parent window then close current (child) window
function loadclose(file,target) {
   	if (target != '')
       	target.window.location.href = file;
    else
   	    window.location.href = file;
	window.close();
}

function cascadeStartUpdate(formElement)
{//Used to xfer starting time into finishing time of next entry
	separator="_";
   arrayOfStrings = formElement.name.split(separator);
	arrayOfStrings[2]="finishTime";
	nextElementFinish=arrayOfStrings.join(separator);

	if(typeof(formElement.form[nextElementFinish]) == "object" && formElement.selectedIndex>0 && formElement.form[nextElementFinish].selectedIndex==0 ) {
		formElement.form[nextElementFinish].selectedIndex=formElement.selectedIndex;
	}
}
function cascadeFinishUpdate(formElement)
{//Used to xfer finishing time into starting time of next entry
	separator="_";
   arrayOfStrings = formElement.name.split(separator);
	arrayOfStrings[1]++;
	arrayOfStrings[2]="startTime";
	nextElementStart=arrayOfStrings.join(separator);
	arrayOfStrings[2]="finishTime";
	nextElementFinish=arrayOfStrings.join(separator);

	if(typeof(formElement.form[nextElementStart]) == "object" && formElement.selectedIndex>0 /*&& (formElement.form[nextElementStart].selectedIndex==0 || formElement.form[nextElementFinish].selectedIndex==0)*/ ) {
		formElement.form[nextElementStart].selectedIndex=formElement.selectedIndex;
	}
}

function confirmation(page)
{
	var msg = "Do you really want to delete this?";
	if (confirm(msg))
	{
		this.location=page;
	} 
}

function incrementAccessCounter(page)
{
	this.location=page; 
}

function goToURL() {
  var i, args=goToURL.arguments; document.returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function imgOn(imgFileName, imgName)
{		
	if(arguments.length==1)
		imgName=imgFileName;

	if (document.images)
	{
		document[imgName].src = "images/" + imgFileName + "_on.gif";
	}

	return(true);
}

function imgOff(imgFileName, imgName)
{		
	if(arguments.length==1)
		imgName=imgFileName;

	if (document.images) 
	{
		document[imgName].src = "images/" + imgFileName + "_off.gif";
	}	

	return(true);
}

	function OpenCertDetails()
	{
		thewindow =window.open('https://www.thawte.com/cgi/server/certdetails.exe?code=AUGOVE24-1', 'anew',config='height=498,width=521,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes');
	}

      var fontSize = 12;
      var fontFamily = "Helvetica, Arial, sans-serif";
      function changeFontSize(v)
      {
              var increment = 2;
              var maxFontSize = 18;
              var minFontSize = 8;

              fontSize += v * increment;
              if (fontSize > maxFontSize) {
                      fontSize = maxFontSize;
              } else if (fontSize < minFontSize) {
                      fontSize = minFontSize;
              }

              //var elements = document.getElementById("p");
              //elements.style["font"] = fontSize + "px " + fontFamily;
              //alert("hi?");

              var elements = document.getElementsByTagName("p");
              for(i=0;i<elements.length;i++) {
                    elements[i].style.fontSize = fontSize+"px";
              }
              elements = document.getElementsByTagName("td");
              for(i=0;i<elements.length;i++) {
                    elements[i].style.fontSize = fontSize+"px";
              }
              elements = document.getElementsByTagName("span");
              for(i=0;i<elements.length;i++) {
                    elements[i].style.fontSize = fontSize+"px";
              }
              elements = document.getElementsByTagName("a");
              for(i=0;i<elements.length;i++) {
                    elements[i].style.fontSize = fontSize+"px";
              }

      }
