browser = navigator.appName;
ie = "Microsoft Internet Explorer";
netscape = "Netscape";
function fixStore(store) {
  store = store.toLowerCase();
  if(store.substr(0,7) == "http://") store = store.substr(7);
  if(store.substr(0,4) == "www.") store = store.substr(4);
  if(store.substr(store.length-4,4) == ".com") store = store.substr(0,store.length-4);
  p = store.indexOf(".");
  store = store.substr(p+1)+"/"+store.substr(0, p);
  return store;
  }
function singleTopLink(pid,store) {
  store = fixStore(store);
  url = "http://www.vstore.com/cgi-bin/pagegen/"+store+"/jump.html?file=/link/singleprod_toppix.spl&prodid="+pid;
  writeLayer(url, 150, 215);
  }
 function partnerIDSingleTopLink(pid,store,repid) {
  store = fixStore(store);
  url = "http://staging.vstore.com/cgi-bin/pagegen/"+store+"/jump.html?file=/link/partner_singleprod_toppix.spl&prodid="+pid+"&repid="+repid;
  writeLayer(url, 125, 215);
  }    
function singleLeftLink(pid, store) {
  store = fixStore(store);
  url = "http://www.vstore.com/cgi-bin/pagegen/"+store+"/jump.html?file=/link/singleprod_leftpix.spl&prodid="+pid;
  writeLayer(url, 430, 150);
  }
function singleRightLink(pid, store) {
  store = fixStore(store);
  url = "http://www.vstore.com/cgi-bin/pagegen/"+store+"/jump.html?file=/link/singleprod_rightpix.spl&prodid="+pid;
  writeLayer(url, 430, 150);
  }
function threeStackedLink(pid1, pid2, pid3, store) {
  store = fixStore(store);
  url = "http://www.vstore.com/cgi-bin/pagegen/"+store+"/jump.html?file=/link/three_stacked.spl&prodid1="+pid1+"&prodid2="+pid2+"&prodid3="+pid3;
  writeLayer(url, 170, 450);
  }
function threeSideLink(pid1, pid2, pid3, store) {
  store = fixStore(store);
  url = "http://www.vstore.com/cgi-bin/pagegen/"+store+"/jump.html?file=/link/threeproduct_sidebyside.spl&prodid1="+pid1+"&prodid2="+pid2+"&prodid3="+pid3;
  writeLayer(url, 430, 170);
  }
function writeLayer(url, width, height) {
  if(browser == netscape) {
    document.write("<ILAYER width="+width+" height="+height+" src='"+url+"'></ILAYER>");
    }
  else if(browser == ie) {
    document.write("<IFRAME FRAMEBORDER=0 BORDER=0 SCROLLING=NO width="+width+" height="+height+" SRC='"+url+"'></IFRAME>");
    }
  }
