function addToFavorite(){
	window.external.addFavorite( window.location.href, window.document.title );
	return false;
}
function favLink(){
	try{
		if( window.external && document.all ){
			document.write( '<a href="' + window.location.href + '" onclick="return addToFavorite()">Ajouter à mes Favoris</a>' );
		}else if( window.opera )
			document.write( '<a href="' + window.location.href + '" rel="sidebar">Ajouter à mes Favoris</a>' );
	}catch( e ){
		;
	}
}

$(document).ready(function(){
	// Active les enhancements sur les champs de connexion
	$('login-passwd').attr('autocomplete','off');
	var txtEmail = document.getElementById('login-email');
	if( txtEmail && txtEmail.value=='Mon adresse e-mail' ){
		txtEmail.onfocus = function(){
			if( this.value==this.defaultValue ) this.value = '';
		};
		txtEmail.onblur = function(){
			if( this.value=='' ) this.value = this.defaultValue;
		};
	}
	var txtPassword = document.getElementById('login-passwd');
	if( txtPassword && txtPassword.value=='Mon mot de passe' ){
		txtPassword.onfocus = function(){
			if( this.value==this.defaultValue ){
				this.value = '';
				try { // Echouera sous IE6
					this.type = 'password';
				}catch(e){ ; }
			};
		};
		txtPassword.onblur = function(){
			if( this.value=='' ){
				try { // Echouera sous IE6
					this.type = 'text';
				}catch(e){ ; }
				this.value = this.defaultValue;
			}
		};
		try { // Echouera sous IE6
			txtPassword.type = 'text';
		}catch(e){ ; }
	}
	
	var searchLnk = document.getElementById('search-more-lnk');
	var searchText = document.getElementById('form-recherche-texte');
	if( searchLnk && searchText ){
		searchLnk.onclick = function(){
			window.location.href = this.href + '?q=' + escape(searchText.value);
			return false;
		}
	}
});
