
    function hideID( nID )
    {
        if (document.getElementById( nID ))
        {
            document.getElementById( nID ).style.display = 'none';
        }
        else
        {
            alert( nID + ' not found!' );
        }
    }

    function showID( nID )
    {
        if (document.getElementById( nID ))
        {
            document.getElementById( nID ).style.display = 'inline';
        }
        else
        {
            alert( nID + ' not found!' );
        }
    }
    
    function disableID( nID )
    {
        document.getElementById( nID ).disabled = true;
    }
    
    function enableID( nID )
    {
        document.getElementById( nID ).disabled = false;
    }

    function toggleID( nID ) {
     
        if (document.getElementById( nID ).style.display == 'none') 
        {		    
	        document.getElementById( nID ).style.display = '';	    
	    }
        else 
        {   
	        document.getElementById( nID ).style.display = 'none';
        }
    }
    
    function setFocus( id )
    {
        if ( document.getElementById( id ) )
        {
            if ( document.getElementById( id ).style.display != 'none' )
            {
                document.getElementById( id ).focus();
            }        
        }
        else
        {
            if ( document.getElementByName( id ) )
            {
            
                if ( document.getElementByName( id ).style.display != 'none' )
                {
                    document.getElementByName( id ).focus();
                }   
            
            }
        }    
    }    
    
    function get( id )
    {
        if ( document.getElementById( id ) ) 
            return document.getElementById( id );
        
        if ( document.getElementsByName( id ) ) 
            return document.getElementsByName( id )[0];
    }
    
    function clearValue( id )
    {
        if ( document.getElementById( id ) ){
        
            document.getElementById( id ).value = '';
        
        }    
    }
    
    function setValue( id , value )
    {
        if ( document.getElementById( id ) ){
        
            document.getElementById( id ).value = value;
        
        }    
    }  
    
    function setHTML( id , value )
    {
        if ( document.getElementById( id ) ){
        
            document.getElementById( id ).innerHTML = value;
        
        }    
    }     
    
    function getValue( id )
    {
        if ( document.getElementById( id ) ){
        
            return document.getElementById( id ).value;
        
        }    
    }       
    
    function newWindow(mypage,myname,w,h,scroll){

        var win= null;
        var winl = (screen.width-w)/2;
        var wint = (screen.height-h)/2;
        var settings ='height='+h+',';
        settings +='width='+w+',';
        settings +='top='+wint+',';
        settings +='left='+winl+',';
        settings +='scrollbars='+scroll+',';
        settings +='resizable=yes';
        win=window.open(mypage,myname,settings);
        if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
      
    }       
    
    function imageAdapt( src , id )
    {
        var myImage = new Image();
        myImage.name = id;
        
        myImage.onload = imageAdaptExecute;
        
        myImage.src = src;        
    }
    
    function imageAdaptExecute()
    {        
        get( this.name ).style.width = this.width;
        get( this.name ).style.height = this.height;
    }