      function AddPostcard(id, single) {
        snipp_base_url = "somagrand.com";
        if (parent) {
          site_href = parent.window.location.href;
          if (site_href.indexOf(snipp_base_url)>=0) {
            snipp_base_url = "";
          } else {
            snipp_base_url = "http://"+snipp_base_url;            
          }
        }
        date_time = new Date();
        frame_id = Math.round(Math.random()*1000); 
        frame_id = 'postcard_iframe_'+date_time.getFullYear()+date_time.getMonth()+date_time.getDate()+date_time.getHours()+date_time.getMinutes()+date_time.getSeconds()+date_time.getMilliseconds()+frame_id;
        document.write('<iframe width="100%" name="'+frame_id+'" id="'+frame_id+'" src="'+snipp_base_url+'/postcard.php?postcard_id='+id+'&single='+(single?'1':'0')+'" frameborder="0" hspace="0" wspace="0" scrolling="no"></iframe>');
      }

      function SizePostcards() {
        if (!window.location.hash || window.location.hash=="#") return;
        var hashVal = window.location.hash.substr(1); 
        hashVal = hashVal.split("|");
        for (i=0;i<hashVal.length;i+=2) {
          SizePostcard(hashVal[i], hashVal[i+1]);
        }
        window.location.hash = "";
      }

      function SizePostcard(id, height) {
        frame = document.getElementById(id);
        if (frame) {
          frame.height = height;
        }
      }
      window.setInterval(SizePostcards, 100);
