
window.onload = autoloaders

function autoloaders()
{
	var pageid = document.getElementById('quicklinks');
	if (pageid != null)
	{
		pageid.onchange = jumpto;
	}
	var email_sub = document.getElementById('form_2_email_sub');
	if (email_sub != null)
	{
		email_sub.onfocus = blank;
	}
	var user = document.getElementById('ib_login_user');
	if (user != null)
	{
		user.onfocus = blank;
	}
	var pass = document.getElementById('ib_login_pass');
	if (pass != null)
	{
		pass.onfocus = blank_n_swap;
	}
	changetel();

}

function blank()
{
	this.value="";
}

function blank_n_swap()
{
	var parent = this.parentNode;
	var newfield = document.createElement("input");
	newfield.value="";
	newfield.id = this.id;;
	newfield.name = this.name;
	newfield.type = "password";
	parent.removeChild(this);
	parent.appendChild(newfield)
	newfield.focus();
	
}

function changetel()
{
	var watcher = 0;
	for (ct=1; ct<=3;ct++)
	{
		var teldiv = document.getElementById('headContact'+ct);
		if(teldiv != null)
		{
			if ((teldiv.style.display != "none"))
			{
				teldiv.style.display = "none";
				watcher=ct;
			}
		}
	}
	watcher++
	if (watcher==4)
	{
		watcher=1;
	}
	var teldiv = document.getElementById('headContact'+watcher);
	if(teldiv != null)
	{
		teldiv.style.display = "block";
		window.setTimeout("changetel();",10000);
	}
}


function jumpto()
{
	if (this.value)
	{
		window.location=this.value;
	}
}
