function closeList( pId ) {
	if ( document.getElementById(pId) != null ) {
		document.getElementById(pId).style.display = 'none';
	}
}

function showHiddenList( pId, pIdToClose1, pIdToClose2 ) {
	closeList( pIdToClose1 );
	closeList( pIdToClose2 );
	if ( document.getElementById(pId) != null ) {
		document.getElementById(pId).style.display = 'inline';
	}
}

function openDisclaimer(pLangID) {
	var myWindow="";

	if (pLangID == "1") {
		myWindow=window.open("/[CGI]/[CGI_LANG_PORTAL]/tendering/AbstractDisclaimerEng.html", "engDisclaimer", "width=500, height=200, fullscreen=no, resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, copyhistory=no");
	} else {
		myWindow=window.open("/[CGI]/[CGI_LANG_PORTAL]/tendering/AbstractDisclaimerFre.html", "freDisclaimer", "width=500, height=200, fullscreen=no, resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, copyhistory=no");
	}
	myWindow.focus();
}

function findObject( pElementId ) {
    if ( document.getElementById ) {
        return document.getElementById( pElementId );
    } else if ( document.all ) {
        return document.all[ pElementId ];
    } else {
        return { style: {} };
    }
}

function selectSearchBoxIfSearchWasDone() {
  url = new String( location.href );
  if ( url.indexOf( 'main.search' ) >= 0 ) {
    findObject( 'search1' ).select();
  }
}

var poppedWindow = null;
function popupWindow( pURL, pWindowName, pWindowFeatures ){
    closePoppedWindow();
    poppedWindow = window.open( "", pWindowName, pWindowFeatures  );
    poppedWindow.location.href = pURL;
    poppedWindow.focus();
}

function closePoppedWindow() {
    if ( navigator.appName != "Microsoft Internet Explorer" || parseInt( navigator.appVersion ) >= 4 ) {
        if( poppedWindow != null ) {
            if( !poppedWindow.closed ) {
                poppedWindow.close();
            }
        }
    }
}