// JavaScript Document
var xmlHttp
function GetXmlHttp() {
	var xmlhttp = false;
	if (window.XMLHttpRequest) xmlhttp = new XMLHttpRequest()
	else if (window.ActiveXObject) {
		// code for IE
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP")
		} catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
			} catch (E) {
				xmlhttp=false
			}
		}
	}
	return xmlhttp;
}

function showSubmenus(show) {
	$$('#nav > .activechild > ul,#nav >  .active > ul').each(function(s) {
		s.style.display = show?'block':''
	})
}

startList = function() {
	$$('#nav > li').each(function(node) {
		if (node.nodeName=="LI") {
			node.onmouseover=function() {
				this.className+=" over";
				//showSubmenus(false)
			}
			node.onmouseout=function() {
				this.className=this.className.replace(" over", "");
				//showSubmenus(true)
			}
		}
	})
	//showSubmenus(true)
}
Event.observe(window,'load',startList)

Number.prototype.moneyFormat = function() {
	n = this
	s = ''
	toFixedFix = function (n, prec) {
		var k = Math.pow(10, prec);
		return '' + Math.round(n * k) / k;
	}
    // Fix for IE parseFloat(0.55).toFixed(0) = 0;
    s = (2 ? toFixedFix(n, 2) : '' + Math.round(n)).split('.');
    if (s[0].length > 3) {
        s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, ',');
    }
    if ((s[1] || '').length < 2) {
        s[1] = s[1] || '';
        s[1] += new Array(2 - s[1].length + 1).join('0');
    }
    return s.join('.');
}

function rewrite(id) {
	$(id).innerHTML = $(id).innerHTML
}
