// JavaScript Document
function resetField(theObj,strDefault){
	var curentValue = theObj.value;
	if(curentValue == strDefault){
		theObj.value = '';
	}
	else {
		return;
	}
}

function confirm_supp_avatar(lien) {
	confirmation = confirm('Etes vous sur de vouloir supprimer votre avatar ?');
	if (confirmation) {
		document.location.href = lien;
	}
}

function open_win (id, url, w, h) {
	window.open(url, id, 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,menuBar=0,width=' + w + ',height=' + h + ',top=100,left=100');
	return false;
}

function ltrim(str) {
	return str.replace(/^\s*/g,"")
}

var type_login = 'normal';
function switch_login_type () {
	if (type_login == 'normal') {
		type_login = 'openid';

		$('div_login_normal').hide();
		$('div_login_openid').show();

		$('type_login').innerHTML = "Login normal";
	}
	else {
		type_login = 'normal';

		$('div_login_openid').hide();
		$('div_login_normal').show();

		$('type_login').innerHTML = "Login OpenID";
	}
}

function switch_forum(id) {
	var url = $(id).options[$(id).selectedIndex].value;
	document.location.href = url;
}
