var HomePage = {

	init: function() {
		/* Init the buttons */
		$('.splashGraphic button').click(function(){ location.href = './signup.php'; });
		$('.tourBanner button').click(function(){ location.href = './signup.php'; });
		$('.qrGenerator button.generate').click(HomePage.generateQrCode);
		$('.qrGenerator button.download').click(HomePage.downloadQrCode);
	}, 
	generateQrCode: function() {		
		
		var imgSrc = "./qrgenerator.php?file=0" + 
		 				'&text=' + encodeURIComponent($('.qrGenerator .text').val()) + 
 						'&imageType=png';
		
		$('.qrPreview').attr('src', imgSrc);
		$('.qrPreview').fadeIn('slow');
		$('button.download').fadeIn('slow');		
	},
	downloadQrCode: function() {		
		
		document.location = "./qrgenerator.php?file=1" + 
				 				'&text=' + $('.qrPreview').attr('src') + 
		 						'&imageType=' + $('.imageType').val();		
	}	
	
}

$(document).ready(function() {
    HomePage.init();
});







