/*

ABT BASE Functions

==================================================================================================================*/

/* Remove negative text-indent borders on links */
var theahrefs = document.getElementsByTagName('a');
//fix dotted line thing when link is OnClicked
for(var x=0;x!=theahrefs.length;x++){ theahrefs[x].onfocus = function stopLinkFocus(){this.hideFocus=true;}; }
//a:focus { -moz-outline-style: none; }   <-- this is found in the moz.css file to take care of firefox
	

function printThis() {
	(window.print) ? window.print() : alert('To print his page press Ctrl-P on your keyboard \nor choose print from your browser or device after clicking OK');
}

/* ======================================= */

Cufon.replace('h1', { fontFamily: 'myriadbold' });
Cufon.replace('h2, h3, .app-games li a span, .features span, blockquote', { fontFamily: 'myriad' });

$(document).ready(function() {	
	// tabs
	$('ul.app-games').tabs('.tab-content', { effect: 'fade' });
	
	// iphone screens	
	$('.screen-left').cycle({ 
    	fx:    		'fade', 
    	speed:  	500,
		timeout:	5000
 	});
	$('.screen-right').cycle({ 
    	fx:    		'fade', 
    	speed:  	500,
		timeout:	5000,
		delay:		2500
 	});
	
	//run special tracking script when button is clicked?
	$('.b-tracking a').click(function(){
		ClickTracking( $(this).parent().attr('id') );
	});
});

//Special click tracking?
function ClickTracking(sourceId){
		//alert('clicked on ' + sourceId);
		
		//using regular analytics tracker
		if(pageTracker) {
			pageTracker._trackPageview('/button/'+sourceId);
		}
	
		//from special analytics code
		var _gaq = _gaq || [];
		_gaq.push(['_setAccount', 'UA-8328299-1']);
		_gaq.push(['_trackPageview', '/button/'+sourceId]);
		(function() {
			var ga = document.createElement('script');
			ga.type = 'text/javascript';
			ga.async = true;
			ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
			var s = document.getElementsByTagName('script')[0];
			s.parentNode.insertBefore(ga, s);
		})
		(); 
	};
