function decision(message, url){
if(confirm(message)) location.href = url;
}

<!--
/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: ScriptBreaker :: http://www.scriptbreaker.com/ */

var height = 20; // height of the menu headers
var iheight = 20; // height of the menu_items

var bgc = "black" // background color of the item
var tc = "white" // text color of the item

var over_bgc = "#F90000";
var over_tc = "white";

var speed = 0;
var timerID = "";
var N = (document.all) ? 0 : 1;
var width = 202;
var self_menu = new Array();

function write_menu() {
  smc = 0; // count the position of the self_menu
  document.write("<div style='position:absolute'>");
  mn = 0;
  mni = 1;
  start = -1;

  for(i=0;i<Link.length;i++) {
   la = Link[i].split("|");
   if (la[0] == "0") {
    if(start == 0) {
      document.write("</div>");
      h =  csmc * iheight;
      tmn = mn; //-h
      self_menu[smc] = new Array(tmn,h,0,-2);
      smc++;
      mn--;
     }
     csmc = 0;
    document.write("<div class='menu' style='top:"+mn+";height:"+height+"' id='down"+smc+"' onclick='");
	if(la.length > 2){
	   document.write("window.location=\"" + la[2] + "\";");
	}else{
	   document.write("pull_down("+smc+","+mni+");");
	}
	document.write("'>&nbsp;"+ la[1] + "</div>");
    self_menu[smc] = new Array(mn,height,0,mni);
    smc++;
    mni++;
    mn+=height;
    start = 1;

   } else {
    if(start == 1) {
      if(N)mn+=2;
       document.write("<div class='item_panel' id='down"+smc+"' style='top:"+mn+"'>");
       start = 0;
     }

    document.write("<a href='"+la[2]+"'");
    if (la[3] != "") document.write(" target='" + la[3] + "' ");
    document.write("><div class='item' id='d"+i+"' style='height:"+iheight);
    if (N) document.write(";width:200px");
    document.write("' onmouseover='color(this.id)' onmouseout='uncolor(this.id)'><table cellspacing='0' cellpadding='0' width='100%'><tr onclick=\"window.location='" + la[2] + "'\"><td width='25' align='right'><img src='images/whitesidearrow.gif'></td><td>&nbsp;&nbsp;"+ la[1] + "</td></tr></table></div></a>");
    csmc++;
   }
  }
  if (start == 0) {
     document.write("</div>");
     h =  csmc * iheight;
     tmn = mn + 5; //-h
     self_menu[smc] = new Array(tmn,h,0);
     name = "down" + (self_menu.length-1);
     obj = document.getElementById(name);
     /*obj.style.borderBottomColor = "white";
     obj.style.borderBottomWidth = 0;
     obj.style.borderBottomStyle = "solid";
	 */
   }
  document.write("</div>");
  
}

function color(obj) {
 document.getElementById(obj).style.backgroundColor = over_bgc;
 document.getElementById(obj).style.color = over_tc
}

function uncolor(obj) {
 document.getElementById(obj).style.backgroundColor = bgc;
 document.getElementById(obj).style.color = tc
}

function pull_down(nr,c) {
 if (timerID == "") {
 to = self_menu[nr+1][1]
 begin = nr + 2;
 if (timerID != "") clearTimeout(timerID);
 if (self_menu[nr+1][2] == 0) {
  self_menu[nr+1][2] = 1;
  if(nr == self_menu.length-2) {to++;}
  epull_down(begin,to,0);
  document.getElementById("down"+nr).className = 'menutopdown';
 } else {
  document.getElementById("down"+nr).className = 'menutopup';
  to = 0;
  self_menu[nr+1][2] = 0;
  name = "down"+(nr+2);
  open_item = 0;
  for(i=0;i<nr;i++) {
   if(self_menu[i][2] == 1)
    {open_item += self_menu[i][1];
    }
  }
  if (N == false) {open_item-= (c*1)};
  if (nr== self_menu.length-2) {val = self_menu[self_menu.length-1][1];to=-1;}
  else  val = parseInt(document.getElementById(name).style.top) -(open_item)-(c*height);
  epull_up(begin,to,val);
  }
  }
}

function epull_down(nr,to,nowv) {
 name = "down" + (nr-1);
 obj = document.getElementById(name).style.clip = "rect(0,"+width+","+(nowv+1)+",0)";
 for (i=nr;i<self_menu.length;i++) {
  name = "down" + i;
  obj = document.getElementById(name);
  obj.style.top = parseInt(obj.style.top)+1;
 }
 nowv++;
 if(nowv < to) timerID = setTimeout("epull_down("+nr+","+to+","+nowv+")",speed);
 else timerID = ""; 
}

function epull_up(nr,to,nowv) {
 name = "down" + (nr-1);
 obj = document.getElementById(name).style.clip = "rect(0,"+width+","+nowv+",0)";
 for (i=nr;i<self_menu.length;i++) {
  name = "down" + i;
  obj = document.getElementById(name);
  obj.style.top = parseInt(obj.style.top)-1;
 }
 nowv--;
 if(nowv > to) timerID = setTimeout("epull_up("+nr+","+to+","+nowv+")",speed);
 else timerID = "";
}

function startup(nr) {
 write_menu();
 if (nr != 0) {
 for(i=0;i<self_menu.length;i++)
 {
  if(self_menu[i][3] == nr) pull_down(i,nr)
  i==self_menu.length;
 }
 }
}
//-->


/* Javascript related to the database editor
    <!--
        /**
        * Gets left coord of given element
        */
        function GetLeft(element)
        {
            var curNode = element;
            var left    = 0;
    
            do {
                left += curNode.offsetLeft;
                curNode = curNode.offsetParent;
    
            } while(curNode.tagName.toLowerCase() != 'body');
    
            return left;
        }
        
        
        /**
        * Gets top coord of given element
        */
        function GetTop(element)
        {
            var curNode = element;
            var top    = 0;
    
            do {
                top += curNode.offsetTop;
                curNode = curNode.offsetParent;
    
            } while(curNode.tagName.toLowerCase() != 'body');
    
            return top;
        }


        /**
        * Onload event handler
        */
        function onload_handler()
        {
            if (document.getElementById('csvDownloadLayer') && document.getElementById('actionCSV')) {
                positionCSVLayer();
                document.getElementById('csvDownloadLayer').style.visibility = 'hidden';
                
                document.onclick = function ()
                {
                    Fade(document.getElementById('csvDownloadLayer'), false);
                }
            }
        }
        
        
        /**
        * Creates the CSV download layer
        */
        function positionCSVLayer()
        {
            /**
            * Positions the CSV download layer
            */
            var csvDiv        = document.getElementById('csvDownloadLayer');
            csvDiv.style.left = GetLeft(document.getElementById('actionCSV')) + 'px';
            csvDiv.style.top  = GetTop(document.getElementById('actionCSV')) + 1 + document.getElementById('actionCSV').offsetHeight + 'px';
        }


        /**
        * Returns ids of rows which are highlighted
        */
        function getSelectedRows()
        {
            var checkboxes = document.getElementsByTagName('input');
            var selected   = new Array();

            for (var i=0; i<checkboxes.length; ++i) {
                if (   checkboxes[i].getAttribute('type') == 'checkbox'
                    && checkboxes[i].getAttribute('id') == 'rowSelector'
                    && checkboxes[i].checked) {

                   selected[selected.length] = checkboxes[i].value;
                }
            }
            
            return selected;
        }


        /**
        * Initiates a CSV download
        */
        function csv_download()
        {
            var selectObj  = document.getElementById('csvdownload_what');
            var incHeaders = document.getElementById('include_headers').checked ? '1' : '0';
            
            switch (selectObj.options[selectObj.selectedIndex].value) {
            
                // Download selected rows as CSV
                case 'selected':
                    var selectedRows = getSelectedRows();
                    
                    if (selectedRows.length == 0) {
                        alert('Please select some rows to download!');
                        return;
                    }
                    
                    for (var i=0; i<selectedRows.length; ++i) {
                        selectedRows[i] = 'rows[]=' + selectedRows[i];
                    }
                    
                    var rows = selectedRows.join('&');
                    
                    location.href = location.href + (location.search.length ? '&' : '?') + 'csvdownload=1&type=selected&headers=' + incHeaders + '&' + rows;
                    break;


                // Download current page as CSV
                case 'page':
                    var checkboxes = document.getElementsByTagName('input');
                    var rows       = new Array();
        
                    for (var i=0; i<checkboxes.length; ++i) {
                        if (   checkboxes[i].getAttribute('type') == 'checkbox'
                            && checkboxes[i].getAttribute('id') == 'rowSelector') {
        
                            rows[rows.length] = 'rows[]=' + checkboxes[i].value;
                        }
                    }
                    
                    rows = rows.join('&');
                    location.href = location.href + (location.search.length ? '&' : '?') + 'csvdownload=1&type=selected&headers=' + incHeaders + '&' + rows; // type as selected is correct
                    break;


                // Download entire table as csv
                case 'table':
                    location.href = location.href + (location.search.length ? '&' : '?') + 'csvdownload=1&type=table&headers=' + incHeaders;
                    break;

                default:
                    alert('Please select which rows to download!');
                    break;
            }
            
            Fade(document.getElementById('csvDownloadLayer'), false);
        }


        /**
        * Handles row highlighting
        */
        // FIXME: Broken in FF
        /*
        function deleteCheckboxClicked(checkbox) {
              el = checkbox.parentNode;
              while (el && el.nodeName != "TR") {
                el = el.parentNode;
              }
              if (el && el.nodeName == "TR") {
                if (checkbox.checked) {
                  el.oldClassName = el.className;
                  el.className = "delete";
                } else {
                  el.className = el.oldClassName;
                  el.oldClassName = "";
                }
              }
            }
        */
        function row_highlight(event, trObj, checkboxObj, origClass)
        {
            var srcElement = event.srcElement || event.target;

            if (srcElement.tagName.toLowerCase() == 'td' || srcElement.tagName.toLowerCase() == 'tr') {
                checkboxObj.checked = !checkboxObj.checked;
            
            } else if (srcElement.tagName.toLowerCase() == 'input') {
                event.cancelBubble = true;
            }

            if (trObj.className == 'highlightedRow') {
                trObj.className = origClass;
            } else {
                trObj.className = 'highlightedRow';
            }
        }


        /**
        * Handles redirecting for viewing a row
        */
        function row_view()
        {
            var selectedRows = getSelectedRows();
            var view         = '';

            if (selectedRows.length == 0) {
                alert('You must select a row to view!');
                return;
            }

            if (selectedRows.length > 1) {
                alert('You can only select one row at a time to view');
                return;

            } else {
                view = 'view=' + encodeURIComponent(selectedRows[0]);
            }

            location.href = location.href + (location.search.length ? '&' : '?') + view;
        }


        /**
        * Handles redirecting for deleting rows
        */
        function row_delete()
        {
            var selectedRows = getSelectedRows();
            var deletes      = new Array();
            
            if (selectedRows.length == 0) {
                alert('You must select one or more rows to delete!');
                return;
            }

            for (var i=0; i<selectedRows.length; ++i) {
                deletes[deletes.length] = 'delete[]=' + encodeURIComponent(selectedRows[i]);
            }

            if (confirm('Are you sure you wish to delete the selected row(s)? ' + (deletes.length > 1 ? '\nWARNING: Multiple rows selected!' : ''))) {
                location.href = location.href + (location.search.length ? '&' : '?') + deletes.join('&');
            }
        }

        function row_barcode()
        {
            var selectedRows = getSelectedRows();
            var barcodes      = new Array();
            
            if (selectedRows.length == 0) {
                alert('You must select one or more rows to print!');
                return;
            }

            for (var i=0; i<selectedRows.length; ++i) {
                barcodes[barcodes.length] = 'products[]=' + encodeURIComponent(selectedRows[i]);
            }
                window.open('index.php?table=print_barcodes&action=prodbarcode&' + barcodes.join('&'));
        }
        /**
        * Handles redirecting for editing rows
        */
        function row_edit()
        {
            var selectedRows = getSelectedRows();
            var edit         = '';

            if (selectedRows.length == 0) {
                alert('You must select a row to edit!');
                return;
            }

            if (selectedRows.length > 1) {
                alert('You can only select one row at a time to edit');
                return;

            } else {
                edit = 'edit=' + encodeURIComponent(selectedRows[0]);
            }

            location.href = location.href + (location.search.length ? '&' : '?') + edit;
        }


        /**
        * Handles redirecting for copying a row
        */
        function row_copy()
        {
            var selectedRows = getSelectedRows();
            var copy         = '';

            if (selectedRows.length == 0) {
                alert('You must select a row to copy!');
                return;
            }

            if (selectedRows.length > 1) {
                alert('You can only select one row at a time to copy');
                return;

            } else {
                copy = 'copy=' + encodeURIComponent(selectedRows[0]);
            }

            location.href = location.href + (location.search.length ? '&amp;' : '?') + copy;
        }


        /**
        * Handles redirecting for adding a row
        */
        function row_add()
        {
            location.href = location.href + (location.search.length ? '&' : '?') + 'add=1';
        }


        /**
        * Handles the search button
        */
        function search()
        {
            var searchStr = document.getElementById('searchInput').value;

            location.href = location.href + (location.search.length ? '&' : '?') + 'search=' + encodeURIComponent(searchStr);
        }


        /**
        * Handles ordering links
        */
        function orderBy(field)
        {
            location.href = location.href + (location.search.length ? '&' : '?') + 'orderby=' + encodeURIComponent(field);
        }


        /**
        * Enables the apply button on the edit form
        */
        function enableApply()
        {
            document.forms[0].elements['action'][2].disabled = false;
        }


        /**
        * Returns the current date and time in ISO8660 format (YYYY-MM-DD HH:MM:SS)
        */
        function currentDateTime()
        {
            return currentDate() + ' ' + currentTime();
        }


        /**
        * Returns the current date in ISO8660 format
        */
        function currentDate()
        {
            var d = new Date();

            var date  = d.getDate() > 9 ? d.getDate() : '0' + String(d.getDate());
            var month = (d.getMonth() + 1) > 9 ? (d.getMonth() + 1) : '0' + (d.getMonth() + 1);
            var year  = d.getFullYear();

            return year + '-' + month + '-' + date;
        }


        /**
        * Returns the current time in ISO8660 format
        */
        function currentTime()
        {
            var d = new Date();

            var hours   = d.getHours() > 9 ? d.getHours() : '0' + d.getHours();
            var minutes = d.getMinutes() > 9 ? d.getMinutes() : '0' + d.getMinutes();
            var seconds = d.getSeconds() > 9 ? d.getSeconds() : '0' + d.getSeconds();

            return hours + ':' + minutes + ':' + seconds;
        }
        
