if ($.browser.msie && $.browser.version < 7) {
	$('#footer a, .pngfix').belatedPNGfix();
}

$(document).ready(function() {


	$('#i18n-box a').live('click', function(e) {
		e.preventDefault();
		$.post("update_i18n", { country_code: $(this).attr('title') }, function(data) {
			window.location.reload(true);
		});
	});
	
	$('#features .inner a').cycle({ 
		fx: 'fade',
		next: '#features .next',
		prev: '#features .prev'
	});
	$('#features .inner a').cycle('pause');
	
});

// TitilliumTitle20: light text
// TitilliumMaps29L: strong text

Cufon.replace('body.page-support #content-footer h3, body.page-support #content-footer p, body.page-features #content h3, .heading h2, .heading p, #why-choose-us h2, #why-choose-us p, .cufon, body.page-signup label, #footer .inner .second .row, #footer .inner .third p strong, #footer .inner h4, #footer .outer .first, #header ul a, #toolbar .login-or-signup, #call-to-actions h2, .button-type1, .button-type2, .button-type3, body.page-index #content .second-column h3, body.page-index #content .second-column p', { fontFamily: 'TitilliumMaps29L' });

window.onload = function() {
	applyDefaultValue(document.getElementById('username'), 'Username');
	applyDefaultValue(document.getElementById('password'), 'Password');
}

function applyDefaultValue(elem, val) {
	if (!elem) {
		return;
	}
	elem.style.color = '#b3b3b3';
	elem.value = val;
	elem.onfocus = function() {
		if(this.value == val) {
			this.style.color = '';
			this.value = '';
		}
	}
	elem.onblur = function() {
		if(this.value == '') {
			this.style.color = '#b3b3b3';
			this.value = val;
		}
	}
}

