$(function() {
	
	
	<!-- Google Analytics Pageview Tracking -->
	$('.logo').click(function() {
		_gaq.push(['_trackPageview', '/MainTopLogo']);			
	});
	
	$('#continentaltire').click(function() {
		_gaq.push(['_trackPageview', '/Footer/ContinentalTire.com']);		
	});
	
	$('#grand_am').click(function() {
		_gaq.push(['_trackPageview', '/Footer/Grand-AM.com']);		
	});
	
	$('#footer_facebook').click(function() {
		_gaq.push(['_trackPageview', '/Footer/Facebook']);	
	});
	
	$('#footer_twitter').click(function() {
		_gaq.push(['_trackPageview', '/Footer/Twitter']);		
	});
	
	$('#footer_youtube').click(function() {
		_gaq.push(['_trackPageview', '/Footer/Youtube']);		
	});
	
	
	<!-- QR Codes -->
	var url = window.location.href;
	var code = url.substr(url.indexOf("qr=") + 3, 12);
	if(url.indexOf("qr=") !== -1)
		$('#barcode').val(code);

	
	
	<!-- Poptastic code -->
	
	$('a.help').click(function(e) {
		popstatic('http://www.picturemarketing.com/help.php');
		e.preventDefault();
	});
	
	$('a.privacy_terms').click(function(e){
		popstatic('http://www.picturemarketing.com/privacy.php');
		e.preventDefault();
	});
	
	$('a.patent_island').click(function(e) {
		popstatic('http://www.picturemarketing.com/patent-island.php');
		e.preventDefault();
	});	
	
	function popstatic(url, width, height) {
		var newwindow = window.open(url, '', 'height=700,width=1000,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
		if (window.focus) {newwindow.focus()}
	}
		
});

