// Open new window with event-specified parameters
function newWindow(filePath,winName,winProperties)
{
    var newWin=window.open(filePath,winName,winProperties);
    newWin.focus();
}

// Open standard window with predefined parameters
function newWinStandard(filePath)
{
	newWindow(filePath,'Help','width=400,height=515, status=yes, toolbar=0, location=0, directories=0, menubar=0, scrollbars=1, status=0, resizable=1, screenX=1, screenY=1, top=1, left=1');
}

// Open confirmation window with predefined parameters
function openConfirmationWindow(page)
{
    newWindow(page,'DeleteConfirmation','status=yes,toolbar=0,location=0,directories=0,menubar=0, width=300, height=150, scrollbars=0,status=0,resizable=0,screenX=1,screenY=1,top=1,left=1')
}

// Close Popup and refresh main window
function closeWindow(page)
{
    window.opener.location=page;self.close()
}

// Removes a class from the class attribute of the element identified by the elId argument
function removeClass(elId)
{
    if(document.getElementById)
    {
        if(document.getElementById(elId))
        {
            document.getElementById(elId).className=''
        }
    }
}

function pageScroll() 
{
	window.scrollBy(0,500); // horizontal and vertical scroll increments
}

function trim(str)
{
	return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
