$(document) .ready(function() {
	
	$("#mms_ad .teaser").click(function() { 
		//top.location.href = '/medactionplan/mymedschedule_mobile.asp';
		learnMore();
	});
	
	
	$("#mms_ad").hover(function() { //On hover...	
		$("#mms_ad").stop()
			.animate({ //Animate and expand 
				width: '375px',
				height:'45em'
			}, 500);
		$("#mms_ad .ad_top").stop()
			.animate({ //Animate and expand
				height: '35em'
			}, 500);
		} , function() {
		$("#mms_ad").stop() //On hover out, go back to original size 
			.animate({
				width: '165px',
				height:'120px'
			}, 220);
		$("#mms_ad .ad_top").stop() //On hover out, go back to original size 
			.animate({
				height: '100px'
			}, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
	});
	
});

function learnMore() {
	if ($('body').attr('id') == 'welcome_user') {
		top.location.href = '/medactionplan/mymedschedule_mobile.asp'; // MAP
	} else { 
		top.location.href = 'home/about_mms_mobile.asp'; // MMS
	}
	pageTracker._trackEvent('Homepage', 'Click', 'Link to MyMedSchedule Mobile page');
}
