var newWindow;

function layerVisibility(id, status) {
	document.getElementById(id).style.visibility = status;
}

function layerDisplay(id, status) {
	document.getElementById(id).style.display = status;
}

function changeImg(obj) {
	obj.src = eval(obj.id + '_a.src');
}

function changeImgBack(obj) {
	obj.src = eval(obj.id + '_n.src');
}

function changeClass(obj, className) {
	obj.oldClassName = obj.className;
	obj.className = className;
}

function changeClassBack(obj) {
	obj.className = obj.oldClassName;
}

function popUpWindow(url, name, width) {
	var winX;
	var winY;
	var winLeftPos;
	var winTopPos;
	if (!width) {
		if (browser == "msie") {
			winX = screen.availwidth - 20;
			winY = screen.availheight - 50;
		} else {
			winX = window.innerWidth - 20;
			winY = window.innerHeight - 50;
		}
		winLeftPos = 0;
		winTopPos = 0;
	} else {
		winX = width;
		winY = (window.screen.height /3) *2;
		winLeftPos = (window.screen.width - winX)/2;
		winTopPos = (window.screen.height - winY)/2;
	}
	newWindow = eval("window.open(url, name, 'top=" + winTopPos + ", left=" + winLeftPos + ", width=" + winX + ", height=" + winY + ", resizable=yes, status=yes, scrollbars=yes')");
	newWindow.focus();
}


/**
 * Simply utility to check if the mouse button click that generated the event was the left one.
 * @return boolean
 * @See http://www.quirksmode.org/js/events_properties.html#button
*/
function isLeftClick(objEvent) {
    if(typeof objEvent.button == "number") {
        //-- W3C standard
        if(objEvent.button == 0)
            return true;

        //-- Most browsers
        if(objEvent.button == 1)
            return true;

    } else {
    //-- Old browsers
        if(objEvent.which == 1)
            return true;
    }
    return false;
};