function showRowColor (rowNum) {
	if (rowNum % 2 == 0) {
	   document.write('<tr class="row_odd">');
	} else {
	   document.write('<tr class="row_even">');
	}
}

function startImageRow (imageNum) {
	if (imageNum % 3 == 0) {
	   document.write('</tr>');
	   document.write('<tr class="row_odd">');
	}
}

function showPopup(popupURL, popupName, popupWidth, popupHeight, popupTop, popupLeft) {
	var popupArgs  = 'toolbar=0';
		popupArgs += 'location=0,';
		popupArgs += 'directories=0,';
		popupArgs += 'status=0,';
		popupArgs += 'menubar=0,';
		popupArgs += 'scrollbars=yes,';
		popupArgs += 'resizable=yes,';
		popupArgs += 'width=' + popupWidth + ','; 
		popupArgs += 'height=' + popupHeight + ',';
		
		if (popupTop == 'center' && popupLeft == 'center')
		{
			popupArgs += 'top=' + String((screen.availHeight / 2) - (popupHeight / 2 )) + ',';
			popupArgs += 'left=' + String((screen.availWidth / 2) - (popupWidth / 2 ));
		} 
		else
		{
			popupArgs += 'top=' + popupTop + ','; 
			popupArgs += 'left=' + popupLeft;
		}
					
	var popupWin = window.open(popupURL,popupName,popupArgs);
	popupWin.focus();
}

// number formatting function
// copyright Stephen Chapman 24th March 2006, 10th February 2007
// permission to use this function is granted provided
// that this copyright notice is retained intact

function formatNumber(num,dec,thou,pnt,curr1,curr2,n1,n2) {

/*
	num = number to be formatted
	dec = number of decimal places
	thou = thousands separator
	pnt = decimal point (period or comma)
	curr1 = currency symbol before
	curr2 = currency symbol after
	n1 = negative symbol before
	n2 = negative symbol after
*/
	var x = Math.round(num * Math.pow(10, dec));
	if (x >= 0) {
		n1 = '';
		n2 = '';
	}
	
	var y = ('' + Math.abs(x)).split('');
	var z = y.length - dec;
	if (z < 0) z--;
	
	for(var i = z; i < 0; i++) { 
		y.unshift('0');
	}
	y.splice(z, 0, pnt);
	
	while (z > 3) {
		z-=3;
		y.splice(z, 0, thou);
	}
	
	var r = curr1 + n1 + y.join('') + n2 + curr2;
	return r;
}
