var topicsredirects = new Array();
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660625"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Female-Infertility";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660703"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Male-Infertility";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660641"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Aftereffects-of-Cancer-Treatment";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660619"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Chronic-Pain";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660693"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Cognitive-Changes";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660667"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Fatigue";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660675"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Lymphedema";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660677"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Neuropathy";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660679"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Ostomies";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660707"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Osteoporosis";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660631"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Second-Cancers";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660713"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Urinary-Incontinence";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660673"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Healthy-Behaviors";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660709"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Physical-Rehabilitation";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662035"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Quality-of-Life-and-Palliative-Care";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662007"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/What-Hospice-Care-Means-for-Caregivers";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662011"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/What-Hospice-Care-Means-for-Survivors";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660627"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Female-Sexual-Dysfunction";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660705"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Physical-Effects-of-Cancer/Male-Sexual-Dysfunction";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660725"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Body-Image";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660695"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Emotional-Effects-of-Cancer";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660669"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Fear-of-Recurrence";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660757"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Finding-Meaning";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660629"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Grief-and-Loss";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660759"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Hope";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660701"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Living-With-Uncertainty";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660683"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Sadness-and-Depression";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660633"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Setting-Priorities";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660711"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Stress";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660643"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Communicating-With-Your-Partner";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660623"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Dating-and-New-Relationships";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660635"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Telling-Others-You-are-a-Survivor";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660755"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Emotional-Support";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660671"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Finding-a-Counselor";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660727"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Meeting-Other-Survivors";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=3038573"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Federal-and-State-Benefit-Programs";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660697"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Finding-and-Evaluating-Resources";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2786585"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Health-Care-Assistance-Programs";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2781049"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Prescription-Assistance";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2788581"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Transportation-and-Other-Support-Services";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660665"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Employment-Discrimination";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662697"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Employment-Law";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662687"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Preparing-for-Not-Working";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=3041451"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Assessing-and-Managing-Your-Financial-Situation";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662879"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Converting-Life-Insurance-into-Income";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662889"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Converting-Personal-Assets-into-Income";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2777865"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Converting-Retirement-Accounts-into-Income";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662421"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Credit-for-Survivors";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662453"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Investment-Planning";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660773"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Planning-Your-Financial-Future";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662479"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Retirement-Planning";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662371"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Tax-Planning";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662555"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Assisted-Living-and-Nursing-Home-Facilities";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660621"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Communicate-With-Your-Health-Care-Team";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662583"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Home-Health-Care";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660771"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Life-Expectancy";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660645"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Emotional-Effects-of-Cancer/Setting-Priorities"; // health insurance
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662381"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Disability-Income-Insurance";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662381"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Individual-and-Group-Health-Insurance";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660699"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Life-Insurance";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662671"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Property-and-Casualty-Insurance";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662659"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Creating-a-Will";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2660681"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Planning-Your-Medical-Future";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662477"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Providing-a-Guardian-for-Your-Children";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662593"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Housing";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662481"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/How-to-Organize-Important-Records";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662483"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Important-Records-Survivors-Should-Keep";
topicsredirects["http://www.livestrong.org/site/lookup.asp?c=khLXK1PxHmF&b=2662567"] = "/Get-Help/Learn-About-Cancer/Cancer-Support-Topics/Practical-Effects-of-Cancer/Funeral-and-Memorial-Service-Preplanning";

$(document).ready(function(){
	extend();
	setup();
	mainNav();
	searchBox();
	fontReplacement();
	homepageFlash();
	resourceDb();
	crosslinks();
	lTemplate();
	aTemplate();
	hTemplate();
	mTemplate();
	zmag();
	regForAnEvent();
	printBtn();
	video();
	homepage();
	heroText();
	aTemplateTopicsRedirects();
});

this.extend = function(){
	$.extend($.expr[':'],{
		external: function(a,i){
		if(!a.href) {return false;}
			return a.hostname && a.hostname !== window.location.hostname;
		}
	});
	
	$('a:not([href*="youtube.com/watch"]):external, a[href*="youtube.com"]:not([href*="youtube.com/watch"]), #Ls-Shop .h_template .grid_4 a').click(function(e){
		window.open($(this).attr('href'));
		e.preventDefault();
	});
	
	$('a[href*="/pdf"]').click(function(){
		var href = $(this).attr('href');
		var value = 'pdf/' + window.location + '/' + href.substring(href.lastIndexOf('/') + 1);
		pageTracker._trackPageview(value);
		window.open($(this).attr('href'));
		return false;
	});
	
	$('a[href*="/ppt"]').click(function(){
		var href = $(this).attr('href');
		var value = 'ppt/' + window.location + '/' + href.substring(href.lastIndexOf('/') + 1);s
		pageTracker._trackPageview(value);
		window.open($(this).attr('href'));
		return false;
	});
	
	$('a[href*="/doc"]').click(function(){
		var href = $(this).attr('href');
		var value = 'doc/' + window.location + '/' + href.substring(href.lastIndexOf('/') + 1);
		pageTracker._trackPageview(value);
		window.open($(this).attr('href'));
		return false;
	});
}

this.setup = function(){
	if(navigator.appVersion.indexOf('Macintosh') != -1)
	{
		if(!$.browser.safari)
		{
			$('.a .grid_4 > ul li a').css({paddingTop: '1px'});
			$('.grey_arrow').css({paddingTop: '2px'});
			$('.gold_arrow').css({paddingTop: '3px'});
			$('.a .grid_4 > ul li h4').css({ paddingBottom: '0' });
		}
	}
	
	$('#crosslinks a').click(function(){
		if($.trim($(this).text()) == 'online' && $(this).attr('href').indexOf('/Get-Help/Get-One-On-One-Support/Online-Intake') > -1)
		{
			window.open('http://www.kintera.org/site/c.khLXK1PxHmF/b.2661783/k.9728/Intake_Form/apps/ka/ct/contactus.asp?c=khLXK1PxHmF&b=2661783&en=btITJ4NGKjJPLXMLLiKMLXONJjLXL9MHLcIVJgOTJpL5ImL');
			return false;
		}
	});
	
	$('body').prepend("<div id=\"video_callout\"></div>");
	
	if($.browser.msie && $.browser.version == 7)
	{
		$('.gold_arrow').each(function(){
			var $this = $(this);
			
			if($this.height() > 20)
				$this.addClass('ie7_gold_arrow_fix').append('<img src="/images/icons/yellow-carrot-circle-arrow-jpg" alt="Gold Arrow" />');
		});
		
		$('.a .grid_4 ul li a').each(function(){
			var $this = $(this);
			
			if($this.height() > 20)
				$this.addClass('ie7_grey_arrow_fix').append('<img src="/images/icons/carrot-a-level-link_ie7" alt="Grey Arrow" />');
		});
	}
}

this.mainNav = function(){
	$('#header #menuElem a').each(function(i){
		if($(this).text().toLowerCase().indexOf('livestrong') > -1)
			$(this).html($(this).text().replace('LIVESTRONG', 'LIVE<strong>STRONG</strong>'));
	});
	
	$('#header #menuElem a.CMSListMenuLinkHighlighted').parentsUntil('#menuElem').addClass('CMSListMenuHighlightedLI').find('a:first-child').addClass('CMSListMenuLinkHighlighted');
	
	$('#header #menuElem > li > ul').each(function(){
		var maxHeight = 0;
		$(this).css({display: 'block'}).find('> li').each(function(){
			maxHeight = $(this).height() > maxHeight ? $(this).height() : maxHeight;
		}).css({minHeight: maxHeight}).parent().removeAttr('style');
	});
	
	if($.trim($('#breadcrumbs #crumbs').text()) != '' && $.trim($('#breadcrumbs #crumbs').text()) != '>')
		$('#breadcrumbs').show();
}

this.searchBox = function(){
	$('#header #search_wrapper input:text').keypress(function(e){
		if(e.which == 13)
		{
			e.preventDefault();
			$('#search_wrapper input[type="submit"]').click();
		}
	});
	
	$('#header #search_wrapper input:text').focus(function(){
		$(this).css({
			background: 'none'
		});
	});
	
	$('#header #search_wrapper input:text').blur(function(){
		if($(this).val() == '')
		{
			$(this).attr('style', '');
		}
	});
}

this.fontReplacement = function(){
	Cufon.replace('#statement, h1, .a h2, .m h2, .l h2, .r h2, #Ls- h3, #Ls- h4 a, h5, .month, .day, #footer h6, .h_template .grid_8 h3, .a > .grid_4 h4, #Ls-Search h2, .l .title', { fontFamily: 'CgGothicNo2', hover: true });
	Cufon.replace('#Ls- #content .grid_6 h2, .m h2 strong, .a h2 strong, .h_template .grid_8 h3 strong, .a .grid_4 h4 strong', { fontFamily: 'CgGothicNo3', hover: true });
	
	Cufon.replace('.h_template .grid_4 h3, .h_template .grid_6 h3', { fontFamily: 'CgGothicNo2' });
	Cufon.replace('.h_template .grid_4 h3 strong, .h_template .grid_6 h3 strong', { fontFamily: 'CgGothicNo3' });
	
	Cufon.replace('.m .grid_8 h3', { fontFamily: 'CgGothicNo2' });
	Cufon.replace('.m .grid_8 h3 strong', { fontFamily: 'CgGothicNo3' });
}

this.homepageFlash = function(){
	if($('body').attr('id') === 'Ls-')
	{
		var preview = _url_param('preview') == '' ? 0 : _url_param('preview')
		
		var embed = {
			swf: '/App_Themes/Livestrong/flash/homepage/HomeRotatorLoader.swf',
			container: 'movie',
			width: '976',
			height: '391',
			minWidth: '976',
			minHeight: '391',
			version: '9.0.124.0',
			expressInstall: '/App_Themes/Livestrong/flash/homepage/expressInstall.swf'
		};

		var flashvars = {
			preview: 1,
			mainLoadPct: 0.62,
			preview: preview
		};

		var params = {
			menu: 'false',
			allowScriptAccess: 'always',
			wmode: 'transparent'
		};

		var attributes = {
			id: 'swf'
		};

		swfobject.embedSWF(embed.swf, embed.container, embed.width, embed.height, embed.version, embed.expressInstall, flashvars, params, attributes);
		
		$('#flash_off').show();
	}
}

this.resourceDb = function(){
	if($('body').attr('id') === 'Ls-Find-More-Resources')
	{
		var embed = {
			swf: '/App_Themes/Livestrong/flash/resource_db/ResourceDatabaseLoader.swf',
			container: 'movie',
			width: '976',
			height: '590',
			minWidth: '975',
			minHeight: '620',
			version: '9.0.124.0',
			expressInstall: '/App_Themes/Livestrong/flash/resource_db/expressInstall.swf'
		};

		var flashvars = {};

		var params = {
			menu: 'false',
			allowScriptAccess: 'always',
			wmode: 'transparent'
		};

		var attributes = {
			id: 'swf'
		};

		swfobject.embedSWF(embed.swf, embed.container, embed.width, embed.height, embed.version, embed.expressInstall, flashvars, params, attributes);

		if(swfmacmousewheel) {
			swfmacmousewheel.registerObject(attributes.id);
		}
		
		$('#flash_off').show();
	}
}

this.crosslinks = function(){
	if($.trim($('#crosslinks').text()) == '')
		$('#crosslinks').hide();
}

this.lTemplate = function(){
	$('#content .l').append('<div id="hoverCallOut"></div>');

	$('.l > .grid_3 > li > a').hover(function(){
		var $this = $(this);
		var $thisParent = $this.parent();
		var $contentL = $('#content .l');
		
		var thisParentHeight = $thisParent.height() / 2;
		var top = $thisParent.offset().top - $contentL.offset().top;
		
		var left = $thisParent.offset().left - $contentL.offset().left;
		var leftOffset = 222;
		
		if($thisParent.parent().hasClass('omega'))
		{
			leftOffset = -259;
			$('#content .l #hoverCallOut').addClass('leftSide');
		}
		
		var $html = $thisParent.find('> div').html();
		
		if($html)
		{
			$('#content .l #hoverCallOut').html($thisParent.find('> div').html()).show().css({
				top: top + (thisParentHeight - $contentL.find('#hoverCallOut').height() / 2),
				left: left + leftOffset
			});
		}
	}, function(){
		$('#content .l #hoverCallOut').hide().empty().removeClass('leftSide');
	});
}

this.aTemplate = function(){
	$('.a .grid_8 table tr:even').addClass('alt');
}

this.hTemplate = function(){
	var maxHeight = 0;
	$('.h_template > .grid_4, .h_template > .grid_6').each(function(){
		maxHeight = $(this).height() > maxHeight ? $(this).height() : maxHeight;
	}).css({ height: maxHeight });
}

this.mTemplate = function(){
	$('.m > .grid_8 > ul li.alpha').each(function(){
		var height = $(this).height() > $(this).next('.omega').height() ? $(this).height() : $(this).next('.omega').height()
		$(this).css({ height: height }).next('.omega').css({ height: height });
	});
}

this.zmag = function(){
	$('a[href*="/zmag?id="]').click(function(e){
		var href = $(this).attr('href');
		var title = '';
		var options = 'toolbar=0,status=0,location=0,resizeable=0,menubar=0,width=900,height=660';
		
		window.open(href, title, options);
		
		e.preventDefault();
	});
}

this.regForAnEvent = function(){
	$('#event_select #submit').click(function(e){
		e.preventDefault();
		
		var selected_event = $('#event_select option:selected').val();
		
		if(selected_event != '')
		{
			if(selected_event.indexOf('/') == 1 || selected_event.indexOf('livestrong.org') > -1)
				window.location = selected_event;
			else
				window.open(selected_event);
		}
		else
		{
			alert('Please Select an Event');
		}
	});
}

this.printBtn = function(){
	if(!$('#content > div').hasClass('a'))
		$('#print').hide();
	
	$('#print').click(function(e){
		window.print();
		e.preventDefault();
	});
}

this.video = function(){
		$('a[href*="youtube.com/watch"]').click(function(e){
			e.preventDefault();
			
			var vid = $(this).attr('href');
			
			p = new Array();
			var params = vid.substring(vid.indexOf('?') + 1).split('&');
			
			for(i in params)
			{
				s = params[i].split('=');
				p[s[0]] = s[1];
			}

			$('#video_callout').html('<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/' + p.v + '&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + p.v + '&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object>');
			$("#video_callout").dialog({
				height: 360,
				width: 506,
				modal: true,
				open: function(){
					window.scrollTo(0, 1);
				},
				close: function(){
					$("#video_callout").empty();
				}
			});
		});
}

this.homepage = function(){
	var maxH = 0;
	
	$('#Ls- .sameHeight').each(function(){
		maxH = $(this).height() > maxH ? $(this).height() : maxH;
	}).css({ height: maxH - 10 });
}

this.heroText = function(){
	var heroWrapHeight = $('#content .hero').height();
	var heroTextHeight = $('#content .hero .grid_6.omega').height();
	
	$('#content .hero .grid_6.omega').css({ marginTop: (heroWrapHeight - heroTextHeight) / 2 });
}

this.aTemplateTopicsRedirects = function(){
	$('.a #related_cancer_topics a').unbind('click').click(function(){
		window.location = topicsredirects[$(this).attr('href')] == undefined ? $(this).attr('href') : topicsredirects[$(this).attr('href')];
		return false;
	});
}

function _url_param(k)
{
	p = new Array();
	u = window.location.href;
	q = u.substring(u.indexOf('?') + 1).split('&');
	
	if(u.indexOf('?') === -1)
		return '';
	
	for(v in q){
		s = q[v].split('=');
		p[s[0]] = s[1];
	}
	
	if(!p[k])
		return '';
	
	return p[k];
}
