/* Extras that I would like globally loaded */

if (typeof console == "undefined") {
    window.console = {
        log: function (f) {
        	window.outputlog += "\n"+f;
        }
    };
}

document.observe('dom:loaded',function(){
	if($$('.accordion')[0]){
		$$('.accordion').each(function(e,i){window['accordion_'+i]=new Accordion(e);e.writeAttribute('acc_num',i);window['accordion_'+i].toggleOthers=true});
	}
	if($('body_content')){
		window.notification = new Notification($('body_content').down('div'),'18');
	}
});

function popup(url,name,h,w){
	window.newwindow=window.open(url,name,"height="+h+",width="+w+",resizable=0,scrollbars=0,toolbar=0,menubar=0,location=0,status=0,directories=0");
	if (window.focus) {window.newwindow.focus()}
}

function handleKeyPress(e){
	if(window.disableTab){
		if(e.keyCode==9){
			e.preventDefault();
			e.stopPropagation();
			return false;
		}
	}
}

function isNumberKey(evt){
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
}


function onlyNumbers(evt)
{
	var e = event || evt; // for trans-browser compatibility
	var charCode = e.which || e.keyCode;

	if (charCode > 31 && (charCode < 48 || charCode > 57))
		return false;

	return true;

}
