function unparse_url( $parsed_url , $ommit = array( ) )
{
    //From Open Web Analytics owa_lib.php
    
    $url           = '';
    
    $p             = array();
    
    $p['scheme']   = isset( $parsed_url['scheme'] ) ? $parsed_url['scheme'] . '://' : ''; 
    
    $p['host']     = isset( $parsed_url['host'] ) ? $parsed_url['host'] : ''; 
    
    $p['port']     = isset( $parsed_url['port'] ) ? ':' . $parsed_url['port'] : ''; 
    
    $p['user']     = isset( $parsed_url['user'] ) ? $parsed_url['user'] : ''; 
    
    $p['pass']     = isset( $parsed_url['pass'] ) ? ':' . $parsed_url['pass']  : ''; 
    
    $p['pass']     = ( $p['user'] || $p['pass'] ) ? $p['pass']."@" : ''; 
    
    $p['path']     = isset( $parsed_url['path'] ) ? $parsed_url['path'] : ''; 
    
    $p['query']    = isset( $parsed_url['query'] ) ? '?' . $parsed_url['query'] : ''; 
    
    $p['fragment'] = isset( $parsed_url['fragment'] ) ? '#' . $parsed_url['fragment'] : '';
    
    if ( $ommit )
    {
        foreach ( $ommit as $key )
        {
            if ( isset( $p[ $key ] ) )
            {
                $p[ $key ] = '';	
            }
        }
    }
      
    return $p['scheme'].$p['user'].$p['pass'].$p['host'].$p['port'].$p['path'].$p['query'].$p['fragment']; 
}