
//Send a user to the iTunes Store
function goToITMS(buy_url, buy_fake_url)
{
	//Add some tracking info to Google Analytics
	//var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	//document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
/*	var pageTracker = _gat._getTracker("UA-546676-31");
	pageTracker._initData();
	pageTracker._trackPageview(buy_fake_url);
*/
	window.location = buy_url;
}
	
function changeView(view) {

	if(view == 'trailer') {
		$('#trailer').show();
		$('#screenshots').hide();
		$('#paginator').hide();
		
	} else {
		$('#screenshots').show();
		$('#paginator').show();
		$('#trailer').hide();
	}

}

function changeScreenshot(action) {

	image_base_name = '';
	image_extension_name = '.png';
	
	current_screenshot = $('#current_screenshot').val();
	max_screenshots = $('#max_screenshots').val();
	screenshots_path = $('#screenshots_path').val();

	if(action == 'next') {
	
		current_screenshot++;
		
		if(current_screenshot > max_screenshots) {
			current_screenshot = 1;
		}
		
	} else {
		
		current_screenshot--;
		
		if(current_screenshot < 1) {
			current_screenshot = max_screenshots;
		}
	}
	
	//alert(screenshots_path + '/' + image_base_name + current_screenshot + image_extension_name);
	
	$('#screenshot').attr("src", screenshots_path + '/' + image_base_name + current_screenshot + image_extension_name);
	
	
	$('#current_screenshot').val(current_screenshot);

	
}