function getCookie(name) {
	start = document.cookie.indexOf(name + "=");
	if (start >= 0) {
		start += name.length + 1;
		end = document.cookie.indexOf(";",start);
		if (end < 0) end = document.cookie.length;
		return unescape(document.cookie.substring(start,end));
	}
	return "";
}

function setCookie(name, value, days) {
	var time = new Date();
	time.setTime(time.getTime() + (days * 24 * 3600 * 1000));
	document.cookie = name + "=" + escape(value) + ";expires=" + time.toGMTString() + "; path=/";
}

function emptyEmail () {
	if ( document.forms['f_identify'].IDLogin.value == 'email@domaine.com' ) {
		document.forms['f_identify'].IDLogin.value = '';
	}
}
function emptyPass () {
	if ( document.forms['f_identify'].IDPass.value == 'xxxxxxx' ) {
		document.forms['f_identify'].IDPass.value = '';
	}
}
function emptyNEmail () {
	if ( document.forms['form_newsletter'].ff_email.value == 'Insérez votre email' ) {
		document.forms['form_newsletter'].ff_email.value = '';
	}
}

function emptyNewsEmail () {
	if ( document.forms['n_subscribe'].n_mail.value == 'Insérez votre email' ) {
		document.forms['n_subscribe'].n_mail.value = '';
	}
}
function getPwdMd5 ( idLogin, idPass, idMd5, idForm ) {
	pwd = document.getElementById(idPass).value;
	document.getElementById(idPass).value = '';
	
	buf = hex_md5(pwd);
	
	document.getElementById(idMd5).value = buf;
	
	document.getElementById(idForm).submit();
	return true;
}

function ngetPwdMd5 ( idLogin, idPass, idMd5, idForm ) {
	pwd = document.getElementById(idPass).value;
	document.getElementById(idPass).value = '';
	
	buf = hex_md5(pwd);
	document.getElementById(idMd5).value = buf;
	
}
function submitForm ( id ) {
	document.getElementById(id).submit();
}
function changeAndSubmitForm ( change, id ) {
	document.getElementById(id).action = change;
	document.getElementById(id).submit();
}
function chgAvatar ( avatar ) {
	eval("document.forms['f_avatar'].sel_avatar.value = '" + avatar + "';");
	submitForm('f_avatar');
}	
function chgTheme ( theme, color, repeat ) {
	eval("document.forms['f_theme'].sel_theme.value = '" + theme + '|' + color + '|' + repeat + "';");
	submitForm('f_theme');
}
