HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ns3133907 6.8.0-86-generic #87-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 18:03:36 UTC 2025 x86_64
User: cssnetorguk (1024)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //old_home_backup/gurkhajustice.org.uk/public_html/script/general.js
/* Event observing for cursor positioning and key pressing */
var gMouseX = 0;
var gMouseY = 0;
var gCurKey = 0;

function gGetCords(e){
	gMouseX = Event.pointerX(e);
	gMouseY = Event.pointerY(e);
}

function gGetKey(e){
	gCurKey = e.keyCode;
}

function gEventLoader(){
	Event.observe(document, "mousemove", gGetCords);
	Event.observe(document, "keypress", gGetKey);
}

Event.observe(document, "dom:loaded", gEventLoader, false);

/* Function used to show and hide help */
function gShowHelp(objname){
	var obj = $(objname);
	if(obj){
		obj.toggleClassName('hidden');
	}
	obj.setStyle({ left: (gMouseX - 232) + 'px', top: (gMouseY + 10) + 'px' });
}

function CurrencyFormatted(amount){
	var i = parseFloat(amount);
	if(isNaN(i)) {
		i = 0.00;
	}
	var minus = '';
	if(i < 0) {
		minus = '-';
	}
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) {
		s += '.00';
	}
	if(s.indexOf('.') == (s.length - 2)) {
		s += '0';
	}
	s = minus + s;
	return s;
}