IE = (document.all) ? true:false;
MAC = (navigator.userAgent.indexOf("Mac") != -1); 



function rollOver(imgName,imgType) {
        	if (document.images) {
        	    document[imgName].src = eval(imgName + imgType + ".src");
        	}
		}






/*
function openMenu(day,mon,year,dayweek) {
		openWin("menu.php?d="+day+"&m="+mon+"&y="+year+"&dw="+dayweek);
	}

function openCatering(id) {
		openWin("cateringmenu.php?id="+id);
	}

function openWin(url) {
		var winWidth = 600;
		var winHeight = 400;
		
		winLeft = (screen.width - winWidth) / 2
	   	winTop = (screen.height - winHeight) / 2
	   	
		newWin = window.open(url,"menu","toolbar=no,resizable=yes,scrollbars=yes,left="+winLeft+",top="+winTop+",screenX=0,screenY=0,width="+winWidth+",height="+winHeight);
		
		delayModal();
	}

function delayModal() {
		if (IE)	window.setTimeout("checkModal()", 20);
		else checkModal()
	}
	
function checkModal() {
		
		if (newWin && !newWin.closed) {
			newWin.focus()	
		}
	}
	
*/	
	
	
function slideDiv(id) {
	if($(id).style.display == 'none')
		Effect.SlideDown(id);
	else 
		Effect.SlideUp(id);
}
	
	
var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;


function printPage(dialog) {

  if (pr && !MAC) // NS4, IE5
    window.print()
  else if (da && !MAC) // IE4 (Windows)
    vbPrintPage()
  else if (MAC && !IE)
    window.print()
  else if (MAC && IE)// other browsers
    alert("Sorry, Macintosh browsers cannot use this feature.\n\n - Select the Print option from the File menu.");
	else
	alert("Sorry, Macintosh browsers cannot use this feature.");
  return;
}

if (da && !pr && !MAC) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln('  OLECMDID_PRINT = 6');
  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}











function numbersonly(myfield, e, dec, neg) {
	var key;
	var keychar;

	if (window.event)
	   key = window.event.keyCode;
	else if (e)
   		key = e.which;
	else
	   return true;
	
	keychar = String.fromCharCode(key);

	// control keys
	if ((key==null) || (key==0) || (key==8) || 
		(key==9) || (key==13) || (key==27) )
	   return true;

	// numbers
	else if ((("0123456789").indexOf(keychar) > -1))
	   return true;
	
	// decimal point jump
	else if (dec && (keychar == "."))
	   {
	   //myfield.form.elements[dec].focus();
	   return true;
	   }
	else if (neg && (keychar == "-"))
	   {
	   //myfield.form.elements[dec].focus();
	   return true;
	   }
	else
	   return false;
}



function switchVisability(element, state) {
	document.getElementById(element).style.visibility = state;
}


function openReport(report, date) {
	window.open (report+".php");
}

