var suppress = [ false , false , false, false , false , false ];

function PatientHomeFlashEvent(p1,p2) {
	strAsset=	"Patient Home Page Flash";
	strEvent=	p1==1?"Load":
				p1==2?"Message":
				p1==3?"Click":
				"";
	strNumber=	p1==1?"1":
				p1==2?"2":
				p1==3?"3":
				"";
	strMessage=	p2==1?"Discover Increlex":
				p2==2?"Get answers to your questions about short stature and IGFD":
				p2==3?"Learn more about IGF-1 and growth hormone":
				p2==4?"Discover what you should know about IGFD":
				p2==5?"Learn more about the growth success of patients on Increlex":
				p2==6?"Learn More about PACE":
				"";

	switch(strEvent) {
	case "Load":
		OmnitureAsset_Start(strAsset,strNumber,strEvent);
		break;
	case "Message":
		if ( !suppress[p2-1] ) {
			OmnitureAsset_Interaction(strAsset,strNumber,strEvent+": "+strMessage);
			suppress[p2-1] = true;
		}
		break;
	case "Click":
		OmnitureAsset_Complete(strAsset,strNumber,strEvent+": "+strMessage);
		break;
	}
}

function OmnitureAsset_Start( strAssetName , intInteractionNumber, strInteraction ) {
	var s=s_gi(s_account);
	s.linkTrackVars="eVar3,eVar4,prop5,events";
	s.linkTrackEvents="event2,event4";
	s.eVar3=strAssetName;
	s.eVar4=strAssetName + ": " + intInteractionNumber + ": " + strInteraction;
	s.prop5=strAssetName;
	s.events="event2,event4";
	strEvent = strAssetName + ": " + intInteractionNumber + ": " + strInteraction;
	s.tl( true , "o" , strEvent );
}

function OmnitureAsset_Interaction( strAssetName , intInteractionNumber, strInteraction ) {
	var s=s_gi(s_account);
	s.linkTrackVars="eVar4,prop5,events";
	s.linkTrackEvents="event4";
	s.eVar4=strAssetName + ": " + intInteractionNumber + ": " + strInteraction;
	s.prop5=strAssetName;
	s.events="event4";
	strEvent = strAssetName + ": " + intInteractionNumber + ": " + strInteraction;
	s.tl( true , "o" , strEvent );
}

function OmnitureAsset_Complete( strAssetName , intInteractionNumber, strInteraction ) {
	var s=s_gi(s_account);
	s.linkTrackVars="eVar3,eVar4,prop5,events";
	s.linkTrackEvents="event3,event4";
	s.eVar3=strAssetName;
	s.eVar4=strAssetName + ": " + intInteractionNumber + ": " + strInteraction;
	s.prop5=strAssetName;
	s.events="event3,event4";
	strEvent = strAssetName + ": " + intInteractionNumber + ": " + strInteraction;
	s.tl( true , "o" , strEvent );
}

function OmnitureDownload( strEvent ) {
	var s=s_gi(s_account);
	s.linkTrackVars="eVar5,prop6,events";
	s.linkTrackEvents="event5";
	s.eVar5=strEvent;
	s.prop6=strEvent;
	s.events="event5";
	s.tl( true , "d" , strEvent );
	s.events="";
	s.eVar5="";
	s.prop6="";
}

function OmnitureSiteExit( strEvent ) {
	var s=s_gi(s_account);
	s.linkTrackVars="eVar5,prop6,events";
	s.linkTrackEvents="event5";
	s.eVar5=strEvent;
	s.prop6=strEvent;
	s.events="event5";
	s.tl( true , "e" , strEvent );
	s.events="";
	s.eVar5="";
	s.prop6="";
}

function OmnitureCustom( strEvent ) {
	var s=s_gi(s_account);
	s.linkTrackVars="eVar5,prop6,events";
	s.linkTrackEvents="event5";
	s.eVar5=strEvent;
	s.prop6=strEvent;
	s.events="event5";
	s.tl( true , "o" , strEvent );
	s.events="";
	s.eVar5="";
	s.prop6="";
}

$(document).ready(function(){
	$("a[href*='.pdf']").click(function(e){
		OmnitureDownload($(this).attr("href"));
	});
});
