function shrinkNutrimemoFlash(){
	$("#page #contextual embed").width(250);
	$("#page #contextual embed").height(130);
	$("#page #contextual object").width(250);
	$("#page #contextual object").height(130);
	$("#contextual .pushAlimentationGuide").css("margin","-4px 0 0 6px");
}

box.ui('carousel').configure({
    btnPrev: '<a href="#" class="{$btnPrevCls} {$btnDisabledCls}" title="' + l10n.prevTitle + '">' + l10n.prev + '</a>',
    btnNext: '<a href="#" class="{$btnNextCls} {$btnDisabledCls}" title="' + l10n.nextTitle + '">' + l10n.next + '</a>'

});

box.dom(function() {
    
    box.ui('carousel').create({
        element: '#mainPushs',
        horizontal: true,
        circular: false,
        duration: 600,
        display: 3
    });
    
    box.ui('carousel').create({
        element: '#clubPushs',
        horizontal: true,
        circular: false,
        duration: 600,
        display: 1
    });
    
    box.dom('#clubLogin').clearTextFields();
    
	/**
	 * login at home page
	 * @param {Object} e
	 */
	$("#tryAgain").live("click",function(e){
				 	$("#loginError").html( '' );
					$("#indexLoginForm").show();
					$("#loginError").hide();
				 	e.preventDefault();
				 });
				 
 $("form[id=clubLogin]").submit(function(e){
	
	var tryTxt = '<p><a id="tryAgain" href="#">' + l10n.indexTryLoginAgain + '</a></p>';
						
	var emailaddress = $("#clubEmail").val();
	var password = $("#clubPwd").val();
	
	var emailPattern = /^\s*[\w-]+(\.[\w-]+)*@([\w-]+\.)+[A-Za-z]{2,7}\s*$/;
	var pwdPattern = /[a-zA-Z0-9]{6,25}/;
	
	if(emailaddress.length <= 0 || !emailPattern.test( emailaddress ))
	{
		$("#loginError").html( l10n.errors.login_emailaddress +  tryTxt );
		$("#indexLoginForm").hide();
		$("#loginError").show();
		return false;
	}
	
	
	if(password.length <= 0 || !pwdPattern.test( password ))
	{
		$("#loginError").html( l10n.errors.login_password +  tryTxt );
		$("#indexLoginForm").hide();
		$("#loginError").show();
		return false;
	}
	
	queryString = 'emailaddress='+emailaddress+'&password='+password;
	
	$.ajax({ 
			type: "POST", 
			url: 'index.php?option=com_club&task=ajaxlogin', 
			data: queryString, 
			dataType:'json',
			success: 
			function(data){ 
					
					if(data.status)
					{
						$("#loginError").html( data.message );
						$("#indexLoginForm").hide();
						$("#loginError").show();
						location.reload();
					}
					else
					{
						$("#loginError").html( data.message +  tryTxt );
						$("#indexLoginForm").hide();
						$("#loginError").show();
					}
			}
	});
	
 e.preventDefault();
 
})
	
});