// Removes leading whitespaces
function LTrim( value ) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}

// Removes ending whitespaces
function RTrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}

// Removes leading and ending whitespaces
function trim( value ) {
	return LTrim(RTrim(value));
}

function go()
{
	box = document.forms[0].navi;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}

function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}

function checkThis() {
   var textbox = trim(document.closing_case_now.status_close_case_text.value);
   if (textbox=="") {
      alert ('If you wish to close the Case, you need to enter the reason for doing so!')
      document.closing_case_now.status_close_case_text.focus()
      return false
   } 
   if (document.closing_case_now.status_close_case_title.value=="") {
      alert ('If you wish to close the Case, you need to change the Status!')
      document.closing_case_now.status_close_case_title.focus()
      return false
   } 
return true 
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=1024,height=768,left = 100,top = 184');");
}

function printPage() {
if (window.print) {
agree = confirm('Do you want to print this page?');
if (agree) window.print(); 
   }
}