 $urlprefix = "http://";
 function HandleAction(action,bookId)
  {
    if ( action == "Mainframe" ) {
      url = $urlprefix +'mainframe.php';
      window.location = url;
    }

    if ( action == "Other" ) {
      url = $urlprefix + 'other.php';
      window.location = url;
    }  	
    if ( action == "Reserve" ) {
      url = $urlprefix + 'general.php';
      window.location = url;
    }
	
	
    if ( action == "ViewCalendar" ) {
      url = $urlprefix + 'inusecal.php';
      window.location = url;
    }

    if ( action == "ViewfullCalendar" ) {
      url = $urlprefix + 'fullcal.php';
      window.location = url;
    }

    if ( action == "ViewDetails" ) {
      url = $urlprefix + 'booking.php?recno=' + bookId;
      
      window.location = url;
    }
    if ( action == "Modify" ) {
      url = $urlprefix + 'admin/special_maint.php?recno=' + bookId;
      window.location = url;
    }
	 if ( action == "Edit" ) {
      url = $urlprefix + 'editreq.php?recno=' + bookId;
      window.location = url;
    }
    if ( action == "Cancel" ) {
      check = confirm("This reservation starts at a future date.\nCancel reservation #" + bookId + "?");

      if(check == true) {
        url = $urlprefix + 'booking_release.php?recno=' + bookId;
        window.location = url;
    }
    }
    if ( action == "Release" ) {
      check = confirm("This reservation is in progress.\nRelease reservation #" + bookId + " early?");

      if(check == true) {
        url = $urlprefix + 'booking_release.php?recno=' + bookId;
        window.location = url;
    }
  }
  if ( action == "delgrp" ) {
      check = confirm("Are you sure you want to delete this group?");

      if(check == true) {
        url = $urlprefix + 'admin/usrgrpdel.php?grpid=' + bookId;
        window.location = url;
    }
  }
  
    if ( action == "delfav" ) {
      check = confirm("Are you sure you want to delete this favorite?");

      if(check == true) {
        url = $urlprefix + 'delfav.php?favid=' + bookId;
        window.location = url;
    }
  }
  
  if ( action == "viewgrp" ) {
   
        url = $urlprefix + 'admin/usrgrpview.php?grpid=' + bookId;
        window.location = url;
  
  }
  
  
  if ( action == "eqdelgrp" ) {
      check = confirm("Are you sure you want to delete this equipment group?");

      if(check == true) {
        url = $urlprefix + 'admin/eqgrpdel.php?eqgrpid=' + bookId;
        window.location = url;
    }
  }
  
  if ( action == "eqviewgrp" ) {
   
        url = $urlprefix + 'admin/eqgrpview.php?eqgrpid=' + bookId;
        window.location = url;
  
  }
  
   if ( action == "deltic" ) {
      check = confirm("Are you sure you want to delete this alert?");

      if(check == true) {
        url = $urlprefix + 'admin/tickrdel.php?tickid=' + bookId;
        window.location = url;
    }
  }
  
   if ( action == "delres" ) {
      check = confirm("Are you sure you want to delete this reason?");

      if(check == true) {
        url = $urlprefix + 'admin/resdel.php?resid=' + bookId;
        window.location = url;
    }
  }
  
    if ( action == "soldelgrp" ) {
      check = confirm("Are you sure you want to delete this solution?");

      if(check == true) {
        url = $urlprefix + 'admin/solgrpdel.php?solgrpid=' + bookId;
        window.location = url;
    }
  }
  
   if ( action == "solview" ) {
   
        url = $urlprefix + 'admin/solview.php?solgrpid=' + bookId;
        window.location = url;
  
  }
  
   if ( action == "addusr2eqgrp" ) {
   
        url = $urlprefix + 'admin/addusr2eqgrp.php?eqgrpid=' + bookId;
        window.location = url;
  
  }

  
  
    if ( action == "Refresh"  ) {  
      window.location.reload();
    }
    return;
  }
  
  function labpref()
{
	url = 'labset.php';
	window.open(url, 'attach', 'scrollbars=1, toolbar=0, location=0, directories=0, menuBar=0, resizable=1, width=500, height=200');
		
}

  function validateLookup()
  {
    error_count = 0;
    error_count = error_count + valIsNumber(document.lookup.recno,"Reservation ID");
    if ( error_count == 0 ) {
      document.lookup.submit();
      return true;
    } else {
      return false;
    }
  }