$(document).ready(function(){
var event = "onload";
OmnitureTagging(event);

$('#findabranch').click(function() {
            FindABranch();
			OmnitureTagging("event11");
        });

// Dart, Omniture and CS tagging for this is done in the getAccountType js function
// found in the /apply-now/index.php file.
/*$('#apply-now-next, #apply-now-next2').click(function() {
			ApplyNowNext();
			OmnitureTagging("event12");	
		});*/
		
$('#sideCall01, #clicktocall').click(function() {
			ClickToCall();
			OmnitureTagging("event13");
		});
		
$('#enter').click(function() {
			RequestAppointment();
			OmnitureTagging("event14");
		});

$('#overdraft').click(function() {
			Overdraft();
		});
		
$('.learnmore').click(function() {
			ApplyNowNext();
			OmnitureTagging("event15");
		});

$('#whywebbanking').click(function() {
			WhyWebBanking();
			OmnitureTagging("event16");
		});
		
$('#whybusinessbanking').click(function() {
			WhyBusinessBanking();
			OmnitureTagging("event17");
		});
});




//DART tag functions


function FindABranch() {
/*
<!--
Start of DoubleClick Spotlight Tag: Please do not remove
Activity name of this tag: Find_A_Branch
URL of the webpage where the tag is expected to be placed: http://checking.mtb.com/ 
This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
Creation Date: 07/19/2010
-->
*/

var image = new Image();
var axel = Math.random() + "";
var a = axel * 10000000000000;
image.src = 'https://ad.doubleclick.net/activity;src=2810449;type=sumchkca;cat=check366;ord=1;num=' + a + '?';

//<!-- End of DoubleClick Spotlight Tag: Please do not remove -->

/*<!--
Start of ClearSaleing Tag: Please do not remove
-->*/
	csOrderType = 'Find A Branch';
	csOrderNum = 'FAB-' + phpsession;
	csCustomCategory = 'SC - ' + csOrderType;
	csExecuteShoppingCart();
	csExecuteTracker();
};


function ApplyNowNext() {
/*
<!--
Start of DoubleClick Spotlight Tag: Please do not remove
Activity name of this tag: Apply_Now
URL of the webpage where the tag is expected to be placed: http://checking.mtb.com/apply-now/
This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
Creation Date: 07/16/2010
-->
*/
var image = new Image();
var axel = Math.random() + "";
var a = axel * 10000000000000;
image.src = 'https://ad.doubleclick.net/activity;src=2810449;type=sumchkca;cat=apply811;ord=1;num=' + a + '?';

//<!-- End of DoubleClick Spotlight Tag: Please do not remove -->

/*<!--
Start of ClearSaleing Tag: Please do not remove
-->*/
	csOrderType = 'Apply Now';
	// The following will break the tagging on the .learnmore touts
	//csPostalCode = applynowzip;
	csOrderNum = 'AN-' + phpsession;
	csCustomCategory = 'SC - ' + csOrderType;
	csExecuteShoppingCart();
	csExecuteTracker();
}

function ClickToCall() {
/*
<!--
Start of DoubleClick Spotlight Tag: Please do not remove
Activity name of this tag: Apply_Now
URL of the webpage where the tag is expected to be placed: http://checking.mtb.com/apply-now/
This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
Creation Date: 07/16/2010
-->
*/
var image = new Image();
var axel = Math.random() + "";
var a = axel * 10000000000000;
image.src = 'https://ad.doubleclick.net/activity;src=2810449;type=sumchkca;cat=apply811;ord=1;num=' + a + '?';

//<!-- End of DoubleClick Spotlight Tag: Please do not remove -->

/*<!--
Start of ClearSaleing Tag: Please do not remove
-->*/
	csOrderType = 'Bonus Click To Call';
	csOrderNum = 'BCTC-' + phpsession;
	csCustomCategory = 'SC - ' + csOrderType;
	csExecuteShoppingCart();
	csExecuteTracker();
}

function RequestAppointment() {

/*<!--
Start of DoubleClick Spotlight Tag: Please do not remove
Activity name of this tag: Request_An_Appointment
URL of the webpage where the tag is expected to be placed: http://checking.mtb.com/request-appointment/
This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
Creation Date: 07/16/2010
-->
*/
var image = new Image();
var axel = Math.random() + "";
var a = axel * 10000000000000;
image.src = 'https://ad.doubleclick.net/activity;src=2810449;type=sumchkca;cat=reque802;ord=1;num=' + a + '?';


//<!-- End of DoubleClick Spotlight Tag: Please do not remove -->

/*<!--
Start of ClearSaleing Tag: Please do not remove
-->*/
	csOrderType = 'Request An Appointment';
	csOrderNum = 'RAA-' + phpsession;
	csCustomCategory = 'SC - ' + csOrderType;
	csExecuteShoppingCart();
	csExecuteTracker();
}

function Overdraft() {
/*<!--
Start of ClearSaleing Tag: Please do not remove
-->*/
	csOrderType = 'Bonus Overdraft Learn More';
	csOrderNum = 'BOLM-' + phpsession;
	csCustomCategory = 'SC - ' + csOrderType;
	csExecuteShoppingCart();
	csExecuteTracker();
}

function WhyWebBanking() {
/*
<!--
Start of DoubleClick Spotlight Tag: Please do not remove
Activity name of this tag: WhyMTB_Web_Banking
URL of the webpage where the tag is expected to be placed: http://checking.mtb.com/why-mtb-checking/
This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
Creation Date: 07/16/2010
-->
*/
var image = new Image();
var axel = Math.random() + "";
var a = axel * 10000000000000;
image.src = 'https://ad.doubleclick.net/activity;src=2810449;type=sumchkca;cat=whymt259;ord=1;num=' + a + '?';

//<!-- End of DoubleClick Spotlight Tag: Please do not remove -->

/*<!--
Start of ClearSaleing Tag: Please do not remove
-->*/
	csOrderType = 'WhyMTB Web Banking';
	csOrderNum = 'WWB-' + phpsession;
	csCustomCategory = 'SC - ' + csOrderType;
	csExecuteShoppingCart();
	csExecuteTracker();
}

function WhyBusinessBanking() {
/*
<!--
Start of DoubleClick Spotlight Tag: Please do not remove
Activity name of this tag: WhyMTB_Business_Web_Banking
URL of the webpage where the tag is expected to be placed: http://checking.mtb.com/why-mtb-checking/
This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
Creation Date: 07/16/2010
-->
*/
var image = new Image();
var axel = Math.random() + "";
var a = axel * 10000000000000;
image.src = 'https://ad.doubleclick.net/activity;src=2810449;type=sumchkca;cat=whymt963;ord=1;num=' + a + '?';

//<!-- End of DoubleClick Spotlight Tag: Please do not remove -->

/*<!--
Start of ClearSaleing Tag: Please do not remove
-->*/
	csOrderType = 'WhyMTB Business Web Banking';
	csOrderNum = 'WBWB-' + phpsession;
	csCustomCategory = 'SC - WhyMTB Business Web Banking';
	csExecuteShoppingCart();
	csExecuteTracker();
}

// Omniture tag functions

function OmnitureTagging(event)  {
var currentURL = window.location.pathname;
var s = s_gi('rmrosettamarketingcomdev');
s.linkTrackVars="pageName,events";
s.pageName=currentURL;


switch (event)
{
case "onload":
s.t();
break;

case "event11":
s.events = event
s.tl(true,'o');
break;

case "event12":
s.events = event
s.tl(true,'o');
break;

case "event13":
s.events = event
s.tl(true,'o');
break;

case "event14":
s.events = event
s.tl(true,'o');
break;

case "event15":
s.events = event
s.tl(true,'o');
break;

case "event16":
s.events = event
s.tl(true,'o');
break;

case "event17":
s.events = event
s.tl(true,'o');
break;
}

}