$(document).ready(function() {
	var colorboxUrls = Array();
	var colorboxOpts = {current:"Page {current} / {total}"};
	$('.txt a[target=_self]').colorbox(colorboxOpts);
	$('.txt a[target=_self]').each(function(i){
		if(!(inArray(this.href, colorboxUrls)))
		{
			$(this).attr('rel', 'colorbox1');
			colorboxUrls.push(this.href);
		}
	});
	$('.colorbox a').colorbox(colorboxOpts);
	$('a.colorbox').colorbox(colorboxOpts);
	
	
	$('#password-clear').show();
	$('#signin_password').hide();
	$('#password-clear').focus(function() {
		$('#password-clear').hide();
		$('#signin_password').show();
		$('#signin_password').focus();
	});
	$('#signin_password').blur(function() {
		if($('#signin_password').val() == '') {
			$('#password-clear').show();
			$('#signin_password').hide();
		}
	});
	$('#signin_username').focus(function() {
		if($('#signin_username').val() == 'Votre email') {
			$('#signin_username').val('');
		}
	});
	$('#signin_username').blur(function() {
		if($('#signin_username').val() == '') {
			$('#signin_username').val('Votre email');
		}
	});
});

function inArray(needle, haystack) {
    var length = haystack.length;
    for(var i = 0; i < length; i++) {
        if(haystack[i] == needle) return true;
    }
    return false;
}
