Electrical and optical characteristics of polymer foils and rigid glasses with special reference to the electret state