$(document).ready(function()
{
	$.urlParam = function(name, url){
    var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url);
    if (!results) { return 0; }
    return results[1] || 0;
  }; 
	
$('a').filter(function () { return (/\.(exe|dmg|apk|zip|rar|bz2)(?:\?([^#]*))?(?:#(\.*))?$/i.test($(this).attr('href'))) && ($(this).attr('notrack') == undefined); }).bind('click', function(){_gaq.push(['_trackPageview',$(this).attr('href')])});
	
	
	if(jQuery.browser.opera)
	{	
		$(".featuresBlockBottom").corner("6px").css('background', '#e2e2e2');
		$('.inner').corner("5px");
		$('.corner').css('margin','-11px 0 0 379px');
	}	
	
	$(function ()
	{
		var img = new Image();
		$(img).load(function ()
		{
			$("#splash").css('background','url("/images/splash.jpg") no-repeat');
		}).attr('src', '/images/splash.jpg');
		
		img = new Image();
		$(img).load(function ()
		{
			$("#splashSh").css('background','url("/images/splash_sh.jpg") no-repeat');
			$("#splashSh").animate({ 
				opacity: 1
			}, 1500 );
		}).attr('src', '/images/splash_sh.jpg');
		
		img = new Image();
		$(img).load(function ()
		{
			$("#smallShadow").css('background','url("/images/small_sh.jpg") no-repeat');
			$("#smallShadow").animate({ 
				opacity: 1
			}, 1500 );
		}).attr('src', '/images/small_sh.jpg');
	});
	
	$('#smallSlogan').infiniteCarousel({
		transitionSpeed : 200,
		displayTime : 10000
	});

//alert(window.colorbox);
//	if (window.colorbox !== undefined){
		
		//$("#upgrade_link").colorbox({width:"900", height:"500", iframe:true, scrolling:false, title:''});
		$(".request_upgrade").colorbox({innerWidth:function(){return $.urlParam('width', $(this).attr('href'));},
										innerHeight:function(){return $.urlParam('height', $(this).attr('href'));},
										title:false, scrolling:false, iframe:true,href: function(){ return $(this).attr('href');}});	
		$(".vimeoVideo").colorbox({innerWidth:"600px", innerHeight:"480px", iframe:true});
		$(".screenshot").colorbox();
		$(".try_link").colorbox({innerWidth:function(){return $.urlParam('width', $(this).attr('value'));},
								 innerHeight:function(){return $.urlParam('height', $(this).attr('value'));},
								 href:function(){return $.urlParam('href', $(this).attr('value'));},								 
								title:true, scrolling:false, iframe:true});		
//	}

	if (window.Cufon !== undefined){
		 Cufon.replace(".Segoe_Print", { fontFamily: 'Segoe Print' });
	}

});
