var MyTiffPopUp = {
	puOpen: false,
	currId: null,
	/*
		For every link in the footer that you'd like to make into a 
		link that loads a new URL into the iFrame, simply create 
		(or remove or alter) an object in the MyTiffPopUp.popUpVars 
		array below and set the following properties:
		
			id: ID of the <a> tag that loads the iFrame content
			url: URL/HTML that should load into the iFrame
		
		The JavaScript should do the rest. I've got it working in all 
		of the target browsers.
	*/
	popUpVars: [
		{
			id: 'mtLaunch',
			url: '/utilityframes/tiff-masterlogin.aspx'
		},
		{
			id: 'wimtLaunch',
			url: '/utilityframes/tiff-whatismytiff.aspx'
		},
		{
			id: 'regLaunch',
			url: '/utilityframes/tiff-masterlogin.aspx'
		},
		{
			id: 'pr1Launch',
			url: '/utilityframes/tiff-masterlogin.aspx'
		},
		{
			id: 'pr2Launch',
			url: '/utilityframes/tiff-masterlogin.aspx'
		},
		{
			id: 'pr3Launch',
			url: '/utilityframes/tiff-masterlogin.aspx'
		},
		{
			id: 'fs1Launch',
			url: '/utilityframes/tiff-masterlogin.aspx'
		},
		{
			id: 'fs2Launch',
			url: '/utilityframes/tiff-masterlogin.aspx'
		},
		{
			id: 'liLaunch',
			url: '/utilityframes/tiff-masterlogin.aspx'
		},
		{
			id: 'mtlLaunch',
			url: '/utilityframes/tiff-mytifflist.aspx'
		},
		{
			id: 'msLaunch',
			url: '/utilityframes/tiff-myschedule.aspx'
		},
		{
			id: 'profLaunch',
			url: '/utilityframes/tiff-profile.aspx'
		},
		{
			id: 'shopLaunchB',
			url: '/utilityframes/shoppingcart-b.aspx'
		},
		{
			id: 'shopLaunchBtic1',
			url: '/utilityframes/shoppingcart-b.aspx'
		},
		{
			id: 'shopLaunchBtic2',
			url: '/utilityframes/shoppingcart-b.aspx'
		},
		{
			id: 'mySchedLaunch',
			url: '/utilityframes/tiff-myschedule.aspx'
		},
		{
			id: 'mySchedLn1',
			url: '/utilityframes/tiff-myschedule.aspx'
		},
		{
			id: 'mySchedLn2',
			url: '/utilityframes/tiff-myschedule.aspx'
		},
		{
			id: 'manlstLaunch',
			url: '/utilityframes/tiff-mytifflistmanager.aspx'
		}
		
		
		
	],
	spawnMtpu: function(id, url) {
		$('#' + id).click(function() {
			
			if (!MyTiffPopUp.puOpen) {
				$('#footerIframeCont').show().animate({
					'height': '460px'
				}, 500, function() {
					$('#footerIframeCont').append('<iframe width="915" height="401" frameborder="0" scrolling="no" src="' + url + '" id="fiFrame"></iframe>');
					MyTiffPopUp.puOpen = true;
					MyTiffPopUp.currId = id;
					$('#footerIframeCont a.ficClose').click(function() {
						$('#footerIframeCont').animate({
							'height': '1px'
						}, 500, function() {
							$('#fiFrame').remove();
							$(this).hide();
							MyTiffPopUp.puOpen = false;
						});
						return false;
					});
				});
			} else {
				if (id != MyTiffPopUp.currId) {
					$('#fiFrame').attr('src', url);
					MyTiffPopUp.currId = id;
				}
			}
			return false;
		});
	},
	setFooterLinks: function() {
		$('#myTiff a').each(function() {
			var linkId = $(this).attr('id');
			jQuery.each(MyTiffPopUp.popUpVars, function(i) {
				if (linkId == MyTiffPopUp.popUpVars[i].id) 
					MyTiffPopUp.spawnMtpu(linkId, MyTiffPopUp.popUpVars[i].url);
			});
		});
	},
	init: function() {
		this.setFooterLinks();
	}
};