var unlocked=false;
function unlockLinks(returnedEmail) {
   //go through each locked link
   if (!unlocked) {
      unlocked=true;
      $('formIframe').style.display='none';
      $$('.thankyouContent').each(function(e){ e.style.display='block'; });
      $$('.registerNow').each(function(e){ e.style.display='none'; });
      $$('.hiddenLink').each(function(e){
         e.select('a').each(function(e2){
            //insert email into link(s)
            var initialHref=e2.href;
            e2.href=initialHref.replace('[[EMAIL]]',returnedEmail);
         });
         e.style.display='block';
      });
      trackEvent();
   }
}
var popWin;
function onAssetLinkClick(me) {
   var s=s_gi(s_account);
   var thisAssetTree=me.ancestors();
   var thisAssetParent=null;
   while (thisAssetTree.length>0) {
      var testEl=thisAssetTree.shift();
      if (testEl.hasClassName('middle')) {
         thisAssetParent=testEl;
         break;
      }
   }
   var tStr='';
   var assetTitleClasses=['assetTitleForTracking','virtAwareHeadline','bgHeadline']; // 'assetTitleForTracking' is preferred
   for (i=0;i<assetTitleClasses.length;i++) {
      if (thisAssetParent.select('.'+assetTitleClasses[i]).length>0 && tStr=='') {
         tStr=thisAssetParent.select('.'+assetTitleClasses[i])[0].innerHTML;
      }
   }
   if (tStr!='') {
      s.linkTrackVars='prop20,eVar20,prop21,eVar21,prop45,prop39';
      s.prop45=s.pageName;
      s.prop39=tStr.stripTags().stripScripts().truncate(35,'...');
      s.tl(true,'o',window.s.pageName+': Asset: '+tStr.stripTags().stripScripts().truncate(35,'...'));
      s.events="";
   }
   //END TRACKING
   if (me.target=='_blank' || me.target=='_new') {
      popWin=window.open(me.href,'assetWin');
      if (!popWin) { popBlockedAlert(); }
      try { if (popWin.focus) {popWin.focus();} } catch(error) {}
   } else {
      setTimeout(function(){
         window.location=me.href;
      },100);
   }
}
function openWindow() {
   //this isn't needed in this case but left to avoid having to change the form that calls it...
}
function popBlockedAlert() {
   window.alert('It looks like a popup blocker installed in your browser prevented the requested content from appearing. Please add emc.com to your popup blocker\'s "allow" list.');
}

  function trackEvent() {
    try {
      s.linkTrackVars='events,prop19,prop75,eVar19,eVar7,prop66,prop32';
      s.events='event40,event41';
      s.linkTrackEvents='event40,event41';
      s.tl(this,'o', s.events);
      s.events="";
    } catch(err) {}
    try {
      console.log('TRACK EVENT: '+eventName);
    } catch(err) {}
  }

