
if (document.all) {
	browserType = 'ie';	
} else {
	browserType = 'moz';	
}

function doLogin(theForm)
{
	if (theForm.login.value == '' || theForm.cpwd.value == '')
	{
		alert('Inserire user e password.');
		return false;
	}
	pwdhash = hex_md5(theForm.cpwd.value);
	theForm.cpwd.value = '';
	theForm.hpwd.value = pwdhash;
	return true;
}
/*
function linkTellFriend(id)
{
	window.location.href = '/user/dillo-a-un-amico.htm?id=' + id
}
*/
function goTo( ind ) 
{
	window.location.href = ind;
}

function emailWrite(itemObj) {
	if (itemObj.value == 'Inserisci la tua Email') {
		itemObj.value = '';
	} else {
		if (itemObj.value == '') {
			itemObj.value = 'Inserisci la tua Email';
		} else {
			itemObj.value = itemObj.value;
		}
	}
}
function pwdWrite(itemNum) {
	itemPwdObj = document.getElementById('password_pwd'+ itemNum);
	itemTxtObj = document.getElementById('password_txt'+ itemNum);
	
	if (itemPwdObj.style.display == 'none') {
		itemTxtObj.style.display = 'none';
		itemPwdObj.style.display = '';
		itemPwdObj.focus();
	} else {
		if (itemPwdObj.value.length != 0) {
			itemTxtObj.style.display = 'none';
			itemPwdObj.style.display = '';
		} else {
			itemTxtObj.style.display = '';
			itemPwdObj.style.display = 'none';
		}
	}
}

function loginForm(theForm)
{
	if (theForm.login.value == '' || theForm.cpwd.value == '' || theForm.login.value == 'Inserisci la tua Email')
	{
		document.getElementById('login_error').style.display = '';
		theForm.login.style.backgroundColor = '#ffff00';
		theForm.cpwd.style.backgroundColor = '#ffff00';
		theForm.pwdTxt.style.backgroundColor = '#ffff00';
		return false;
	}
	document.getElementById('login_error').style.display = 'none';
	theForm.login.style.backgroundColor = '';
	theForm.cpwd.style.backgroundColor = '';
	pwdhash = hex_md5(theForm.cpwd.value);
	theForm.cpwd.value = '';
	theForm.hpwd.value = pwdhash;
	return true;
}

function checkBanner(id_banner) {
	if (!document.getElementById(id_banner +'_swf')) {
		document.getElementById(id_banner +'_jpg').style.display = '';
	}
}


