function createPopUp( url, windowName, width, height, scrollbars, toolbar, menubar, resizable )
{

    if ( !windowName )
        windowName = 'defaultName';
    
    if ( !width ) 
        width = "650";
    
    if ( !height )
        height = "450";
    
    if ( !scrollbars )
        scrollbars = "yes";
    
    if ( !resizable )
        resizable = "yes";
        
    if ( !toolbar )
        toolbar = "yes";
        
    if ( !menubar )
        menubar = "yes";        
    
    var winHandle;
    var left    = ( window.screen.availWidth / 2 ) - ( width / 2 );
    var top     = ( window.screen.availHeight / 2 ) - ( height / 2 );
	
    winHandle = window.open( url, windowName, "status=Phase, width=" + width + ",resizable=" + resizable + ",scrollbars=" + scrollbars + ",toolbar=" + toolbar + ",menubar=" + menubar + ",height=" + height + ",left=" + left + ",top=" + top );
    // winHandle.focus();
}

function manualReset( myForm )
{     
    for( var j = 0; j < myForm.elements.length; j++ ) 
    {
        switch( myForm.elements[j].type )
        {
            case 'text' :
                myForm.elements[j].value = '';
                break;
            case 'select-multiple' :
                // Assumes -99 is not a valid ID
                myForm.elements[j].options.selectedIndex = -99;
                break;
            case 'hidden' :
                break;
            default :
                break;
        }                
    }
   
    return;
}

function defaultOpenWin( url, winName )
{

    createPopUp( url, winName, 720, 460, 'yes', 'yes', 'yes', 'yes' );
    
    return;
}

function Toggle(node)
{
	// Unfold the branch if it isn't visible
	if (node.nextSibling.style.display == 'none')
	{
		// Change the image (if there is an image)
		if (node.childNodes.length > 0)
		{
			if (node.childNodes.item(0).nodeName == "IMG")
			{
				node.childNodes.item(0).src = "minus.gif";
			}
		}

		node.nextSibling.style.display = 'block';
	}
	// Collapse the branch if it IS visible
	else
	{
		// Change the image (if there is an image)
		if (node.childNodes.length > 0)
		{
			if (node.childNodes.item(0).nodeName == "IMG")
			{
				node.childNodes.item(0).src = "plus.gif";
			}
		}

		node.nextSibling.style.display = 'none';
	}

}

