function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {  // if window.onload has already happened
		window.onload = func;
	} else { // if it's our FIRST function (window not yet loaded)
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

<!--
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////// 	 JUMP MENU SCRIPT     //////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
//-->

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}


// Check Edit Button
// this function is called by the drop-down select on 'admin_catalogue_all.php'
// it ensures you cannot submit items to be updated until ready
function checkeditbut() {
	//alert('checkeditbut()');
	//alert('select value = '+ document.getElementById('status').value);
	var status = document.getElementById('status');
	if(status){
		if(status.value != ""){
			//alert('enable');
			enablebut();
		}else{
			//alert('disable');
			disablebut();
		}
	}
}

function enablebut(){
	var button = document.getElementById('update');
	button.className = "visible";
	button.disabled = false;
	//alert('enabled');
}

function disablebut(){	
	var button = document.getElementById('update');
	button.className = "hidden";
	button.disabled = true;
	//alert('disabled');
}

//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// TICK-UNTICK ALL BOXES 
function arr_id_fill(itemcount) {
	// store the checkboxes in an array
	var checkboxes = document.getElementsByName("arr_id[]");

	// loop through the checkboxes sequentially using semicolon to separate declarations	
	for(var i = 0; i < checkboxes.length; i++)	{
		checkboxes[i].checked = document.view_all.tickbox_all.checked;
	}
	arr_id_checkselected();
}

//////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////// SHOW OR HIDE EXTRA BUTTONS 
function arr_id_checkselected() {
	// store the checkboxes in an array
	var checkboxes = document.getElementsByName("arr_id[]");

	// loop through the checkboxes sequentially using semicolon to separate declarations
	var tmpcount = 0;	
	for(var i = 0; i < checkboxes.length; i++)	{
		if(checkboxes[i].checked){
			tmpcount++;
		}
	}
	
	if(tmpcount>=1){
		var tr_extrabuts = document.getElementById('extrabuts');
		tr_extrabuts.className = "visible";
	}else{
		var tr_extrabuts = document.getElementById('extrabuts');
		tr_extrabuts.className = "hidden";
	}
	
}

addLoadEvent(checkeditbut);