function form(myform, windowname)
{
if (! window.focus)return false;
window.open('', windowname, 'height=600,width=740,left=170,top=20,scrollbars=yes');
myform.target=windowname;
return true;
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 

function select(id){
for(i=0;i<4;i++){
document.getElementById('type_'+i).style.borderColor= '#4a4a4a';
document.search.type[i].checked=false;
}
document.getElementById('type_'+id).style.borderColor= '#aa0000';
document.search.type[id].checked=true;
}

function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length < MaxLen);
}

function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "block";
} else {
obj.style.display = "none";
}
}
}




	function MoveActiveContent(root_id, tag, active_id, ms_move, index)
	{
		this.obj = document.getElementById(root_id).getElementsByTagName(tag);
		this.active_id = active_id;
		this.active_element = document.getElementById(this.active_id);

		this.index = index;
		this.ms_move = ms_move;
		this.timer = null;
	}

	MoveActiveContent.prototype.startMove = function()
	{
		var self = this;
		this.timer = setInterval(function(){self.moveNextContent()}, this.ms_move);
	}

	MoveActiveContent.prototype.stopMove = function()
	{
		clearInterval(this.timer);
	}

	MoveActiveContent.prototype.removeActive = function()
	{
			document.getElementById(this.active_element.getAttribute('title')).className = 'hidden';
			this.active_element.id = '';
	}

	MoveActiveContent.prototype.setActive = function(sender)
	{
		if (!isNaN(sender))
		{
			if (sender == this.index) return;

			this.index = sender;
		}

		this.removeActive();

		var obj = this.obj[this.index];
			document.getElementById(obj.getAttribute('title')).className = 'visible';
			obj.id = this.active_id;
			this.active_element = obj;
	}

	MoveActiveContent.prototype.moveNextContent = function()
	{
		if (++this.index >= this.obj.length) this.index = 0;

		this.setActive();
	}

	MoveActiveContent.prototype.movePreviousContent = function()
	{
		if (--this.index < 0) this.index = this.obj.length - 1;

		this.setActive();
	}