$(function(){
	$("a.fancybox").fancybox();
	$("a.tbox").fancybox();
});

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function Blank(href)
{
	window.open(href,'_blank');
	return false;
}

function setDivHeight()
{
	$(document).ready(function () {
		
		if ($("#tresc").height()>$("#menu").height())
		{
			$("#menu").height($("#tresc").height());
		} else {
			$("#tresc").height($("#menu").height());
		}
	});
}

function parseId(mixedId,key)
{
    var arrId = mixedId.split('_');
    if(arrId.length<(key+1)) {
    	return 0;
    }
    return parseInt(arrId[key],10);
}

function FormatCurr(val)
{
	return val.replace('.',',');
}

function RoundTo(num,dec) 
{
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}
