


function home()
{
	document.location.href = '/';
}


function pointOfView(obj)
{
	var currentUrl = document.location.href;
	var sectorId = obj.options[obj.selectedIndex].value;
	if(currentUrl.indexOf('?') == -1)
	{
		document.location.href = currentUrl + '?s=' + sectorId;
	}
	else
	{
		if(currentUrl.indexOf('s=') == -1)
		{
			document.location.href = currentUrl + '&s=' + sectorId;
		}
		else
		{
			document.location.href = currentUrl.replace(/s=[0-9]+/,'s='+sectorId);
		}
	}
}

var menuPreviousClass;
function menuOver(id,action)
{
	var menuObj = fetchobj('menu'+id);
	//alert(menuObj.className);
	if(action == 1)
	{
		menuPreviousClass = menuObj.className;
		if(menuPreviousClass.indexOf('mselected') == -1)
		{
			menuObj.className = menuObj.className + ' mselected';
		}
	}
	else
	{
		menuObj.className = menuPreviousClass;
		menuPreviousClass = '';
	}
	//menuObj.backgroundImage = '/img/layout/mainnavbgsel.png';
	//alert(menuObj.background);
	/* background-image:url(/img/layout/mainnavbgsel.png); */
}

function fetchobj(objname)
{
	if(document.getElementById) {
		obj = document.getElementById(objname);
	} else if(document.all) {
		obj = document.all[objname];
	} else {
		obj = null;
	}
	return obj;
}


function addCommas( sValue )
{
    var sRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');

    while(sRegExp.test(sValue)) {
    sValue = sValue.replace(sRegExp, '$1,$2');
    }
    return sValue;
}
