function revealInfo(i) {
	if(document.getElementById(i).style.display == "none") {
		document.getElementById(i).style.display = "none";
	} else {
		document.getElementById(i).style.display = "block";
	}
}

function r(i) {
	document.getElementById(i).style.display = "block";
}

function h(i) {
	document.getElementById(i).style.display = "none";
}

function checkValue() {
	var f = document.forms.dcform.varcheckthis;

	if(f.value == '') {
		f.value = 'yourdomain.com';
	}
}

function updateLoginForm() {
	var f = document.forms.clogin;
	var u = f.username;
	var s = f.login_option.options[f.login_option.options.selectedIndex].value;

	if(s != 'ca' && s != '2096') {
		if(u.value == '' || u.value == 'E-mail address') u.value = "Username";
	} else {
		if(u.value == '' || u.value == 'Username') u.value = "E-mail address";
	}

	if(s == '2083' || s == '2087') {
		f.action = 'http://www.vidahost.com/cplogin.php';
		r('clogindomain');
	} else if(s == 'ca') {
		f.action = 'http://my.vidahost.com/dologin.php?goto=clientarea';
		h('clogindomain');
	} else if (s == '2096') {
		f.action = 'http://www.vidahost.com/cplogin.php';
		h('clogindomain');
	}
}

function updateUsername() {

	if (document.forms.clogin.username.value == '') {
		alert(document.forms.clogin.username.value);
		updateLoginForm();
	}
}

function prepareForm() {

	var str = document.df.domain2.value;
	var pos = str.indexOf(".");
	document.df.domain.value = str.substring(0,pos);
	document.df.ext.value = str.substring(pos);
	return true;
}
