/* 
 * flashEvents.js
 *
 * Javascript for Webtrends event tracking for Flash and HTML events.
 * 
 */

//function for fact actions
function flashEvent(eventName) 
{
    //console.log('flashEvent: ' + eventName);
    //alert(eventName);

    var cVar = "u1=" + eventName + ";" ;


//    writeFloodlightTag("887836", "2010g701", "hpcom728", cVar);   //src=887836;type=garda938;cat=hpvho118;u1=[Facts];ord=1;
//    writeFloodlightTag("1595705", "garda223", "hpcom094", cVar);  //src=1595705;type=garda035;cat=hpvho658;u1=[Facts];ord=1;
//    Spotlight tag for facts and gardasil separated
    if (cVar.indexOf("HPV_Fact")> 1) {
       writeFloodlightTag("887836", "2010g701", "hpcom728", cVar);   //src=887836;type=garda938;cat=hpvho118;u1=[Facts];ord=1;
       writeFloodlightTag("1595705", "garda223", "hpcom094", cVar);  //src=1595705;type=garda035;cat=hpvho658;u1=[Facts];ord=1;
    }
    else {
       writeFloodlightTag("887836", "2010g701", "hpvco728", cVar);   //src=887836;type=garda938;cat=hpvho118;u1=[Facts];ord=1;
       writeFloodlightTag("1595705", "garda223", "hpvco036", cVar);  //src=1595705;type=garda035;cat=hpvho658;u1=[Facts];ord=1;
    }
 
    	if (cVar.indexOf("HPV_click_to_gardasil") >0) {
var ifrm = document.createElement("iframe");
ifrm.setAttribute("name", "actiontag");
ifrm.setAttribute("id", "a1");
ifrm.setAttribute("src", "http://view.atdmt.com/iaction/cbnhpv_ClicktoGardasil_1");
ifrm.style.width = "1px";
ifrm.style.height = "1px";
ifrm.style.border = "0";
document.body.appendChild(ifrm);
    } else {
   
   var tagId = eventName.substring(9,11);
   var tagURL = "http://view.atdmt.com/iaction/cbnhpv_HPVHomepageFactsclick" + tagId + "_1";
   var ifrm = document.createElement("iframe");
ifrm.setAttribute("name", "actiontag");
ifrm.setAttribute("id", tagId);
ifrm.setAttribute("src", tagURL);
ifrm.style.width = "1px";
ifrm.style.height = "1px";
ifrm.style.border = "0";
document.body.appendChild(ifrm);
//      alert(tagURL);
}
	tagFlashEvent(eventName);
}

function htmlEvent(eventName) 
{
    //console.log('htmlEvent: ' + eventName);
    //alert(eventName);

    var cVar = "u1=" + eventName + ";" ;

    writeFloodlightTag("887836", "2010g701", "hpvco202", cVar);   //src=887836;type=garda938;cat=hpvho118;u1=[Facts];ord=1;
    writeFloodlightTag("1595705", "garda223", "hpvco631", cVar);  //src=1595705;type=garda035;cat=hpvho658;u1=[Facts];ord=1;
    tagEvent(eventName);
  }
