
var timerID = null;
var timerRunning = false;
var MP = null;
var MPstyle = null;
var savewhat;
var savefromwhere;
var TableMenu;

function showmap() {
document.getElementById('map').style.visibility='visible';
}
function hidemap() {
document.getElementById('map').style.visibility='hidden';
}



function Highlight(mn){
myObj = document.getElementById('Menu_'+mn);
myObj.style.backgroundColor  = "#0000FF"; 
myObj.style.color = "#FFFF00"; 
ot = myObj.offsetTop;
if (ot>400) {
  document.getElementById('rm').scrollTop = ot-330;
  }
}



function handleError(msg, url, ln) {
   // Do you custom code here
    return true;
}
function showform() {
document.getElementById('FormDiv').style.visibility='visible';
}
function hideform() {
document.getElementById('FormDiv').style.visibility='hidden';
}

function validate(){
//check name  field (to make sure it's not blank)
if(document.form1.Name.value == '') {
alert('Please enter your name.');
document.form1.Name.focus();
return false;}
//check email field (to make sure it's not blank)
if(document.form1.Email.value == '') {
alert('You must enter in your email.');
document.form1.Email.focus();
return false;
} else {
//Now check if email is valid
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.form1.Email.value))) {
alert("The email you entered is not a valid email address.");
document.form1.Email.focus();
return false;
}
}
}



function stopclock(){
   if(timerRunning)
      clearTimeout(timerID);
   timerRunning = false;
}

function showIt(what,fromwhere) {
   if (savewhat != null) gone(savewhat);
   myObj = document.getElementById(what);
   savewhat = myObj;
   stopclock();
   MP = fromwhere;
   myObj.style.display='block';

}

function hideIt(what) {
   myObj = document.getElementById(what);
   timerID = setTimeout('gone(myObj)',1000);
   timerRunning = true;
}

function gone(hidewhat) {
   hidewhat.style.display='none';
 //  MP.style.background = 'transparent';
}

function keepme(keepwho) {
   clearTimeout(timerID);
   keepwho.style.display='block';
}





function checkit(xobj,direc) {
if (xobj == TableMenu) {
   if (direc == "In") {document.getElementById(TableMenu).style.color = "white"; 
} else {document.getElementById(TableMenu).style.color = "black";}
}
}

function createRequestObject() {
  
  FORM_DATA = new Object();
    // The Object ("Array") where our data will be stored.
  
  separator = ',';
    // The token used to separate data from multi-select inputs
  
  query = '' + this.location;
    
  
    // Get the current URL so we can parse out the data.
    // Adding a null-string '' forces an implicit type cast
    // from property to string, for NS2 compatibility.
    
  query = query.substring((query.indexOf('?')) + 1);
    // Keep everything after the question mark '?'.
    
    
  
  if (query.length < 1) { return false; }  // Perhaps we got some bad data?
  
  keypairs = new Object();
  numKP = 1;
    // Local vars used to store and keep track of name/value pairs
    // as we parse them back into a usable form.
    
  while (query.indexOf('&') > -1) {
    keypairs[numKP] = query.substring(0,query.indexOf('&'));
    query = query.substring((query.indexOf('&')) + 1);
    numKP++;
      // Split the query string at each '&', storing the left-hand side
      // of the split in a new keypairs[] holder, and chopping the query
      // so that it gets the value of the right-hand string.
  }

  keypairs[numKP] = query;
    // Store what's left in the query string as the final keypairs[] data.
  
  for (i in keypairs) {
    keyName = keypairs[i].substring(0,keypairs[i].indexOf('='));
      // Left of '=' is name.
    keyValue = keypairs[i].substring((keypairs[i].indexOf('=')) + 1);
      // Right of '=' is value.
    while (keyValue.indexOf('+') > -1) {
      keyValue = keyValue.substring(0,keyValue.indexOf('+')) + ' ' + keyValue.substring(keyValue.indexOf('+') + 1);
        // Replace each '+' in data string with a space.
    }
    
    keyValue = unescape(keyValue);
      // Unescape non-alphanumerics
      
     
      
      
    if (FORM_DATA[keyName]) {
      FORM_DATA[keyName] = FORM_DATA[keyName] + separator + keyValue;
        // Object already exists, it is probably a multi-select input,
        // and we need to generate a separator-delimited string
        // by appending to what we already have stored.
    } else {
      FORM_DATA[keyName] = keyValue;
        // Normal case: name gets value.
    }
  }

  return FORM_DATA;
}



