/*
 * m.share.download.js
 * (c) 2008 Memeo, Inc.
 * Author: Grant Wiant (grant@memeo.com)
 * Comment: Extending to include the 'download' page specific logic
 */
m.share.download = (function() {
	// private methods
	m.vars.run = {
		intro: function() {
			$("#marketing").fadeIn('slow', function() {
				$("#divider1").fadeIn();
				$("li.one").fadeIn('slow', function() {
					$("#divider2").fadeIn();
					$("li.two").fadeIn('slow', function() {
						$("li.three").fadeIn('slow', function() {
							if (navigator.appVersion.indexOf("Win")!=-1) {
								$("#pcDownload").fadeIn('slow');
							} else if (navigator.appVersion.indexOf("Mac")!=-1) {
								$("#macDownload").fadeIn('slow');
							}
						});
					});
				});
			});
		}
	};
	return {
		// pubilic methods
		init: function() {
			$(document).ready(function() {
				$("#innerContent").css('height', '450px');
				m.vars.run.intro();
				$(".macDownload").click(function() {
					pageTracker._trackPageview('/download/downloadnewuser_MAC');
				});
				$(".pcDownload").click(function() {
					pageTracker._trackPageview('/download/downloadnewuser_PC');
				});
				$("a.thickbox").click(function() {
					return false;
				});
				$("a.why").mousedown(function() {
					$('#modalWindow p').remove();
					$(".modalIframe").attr('height', '310');
					$(".modalIframe").attr('src', $(this).attr('href'));
					$("#modalTitle").text($(this).attr('title'));
					$.blockUI({ message: $('#modalWindow'), css: { 
							border: 'none', 
							left: ($(window).width() - 600) /2 + 'px',
							top: ($(window).height() - 340) /2 + 'px',
							width: '600px',
							height: '340px'
						} 
					});
					$('.modalClose').corners('3px transparent');
					$(".modalIframe").show();
				});
				$("a.systemReq").mousedown(function() {
					$('#modalWindow p').remove();
					$(".modalIframe").attr('height', '290');
					$(".modalIframe").attr('src', $(this).attr('href'));
					$("#modalTitle").text($(this).attr('title'));
					$.blockUI({ message: $('#modalWindow'), css: { 
							border: 'none', 
							left: ($(window).width() - 440) /2 + 'px',
							top: ($(window).height() - 320) /2 + 'px',
							width: '440px',
							height: '320px'
						} 
					});
					$('.modalClose').corners('3px transparent');
					$(".modalIframe").show();
				});
				$("a.modalClose, div.blockUI").click(function() {
					$("#modalIframe").attr('src', '');
					$.unblockUI();
					return false;
				});
				$("#check64Bit").click(function() {
					$('#modalWindow p').remove();
					$(".modalIframe").hide();
					$("#modalTitle").text($(this).attr('title'));
					$('#modalWindow').append('<p style="text-align: left; font-size: 80%; margin: 20px;">To find out if you have a 64bit computer: Click on the Windows "Start" button. Click "Control Panel" from the list on the right. Then double-click "System". Next to "System Type" you will see either "32-bit" or "64-bit".</p><p><img src="/assets/images/64bit_check.png"/></p>');
					$.blockUI({ message: $('#modalWindow'), css: { 
							border: 'none', 
							left: ($(window).width() - 440) /2 + 'px',
							top: ($(window).height() - 320) /2 + 'px',
							width: '440px',
							height: '320px'
						} 
					});
				});
			});

		}
	}
})();
m.share.download.init();