public function qualifyLayout($layout, $type = 'com')
    {
        $layout = (string) $layout;

        //Handle partial layout paths
        if(!parse_url($layout, PHP_URL_SCHEME))
        {
            $package = $this->getIdentifier()->package;
            $domain  = $this->getIdentifier()->domain;
            $format  = $this->getFormat();

            $path = $this->getIdentifier()->getPath();
            array_shift($path); //remove 'view'
            $path[] = basename($layout);

            $path = implode('/', $path);

            if($domain) {
                $layout = $type.'://'.$domain .'/' . $package . '/' .$path;
            } else {
                $layout = $type.':' . $package . '/' .$path;
            }

            $layout = $layout.'.'.$format;
        }

        return $layout;
    }