function startup()
	{	
	var a = document.getElementsByTagName("IMG")
	for (var b=0;b<a.length;b++)
		{
		if (a[b].className=="th"||a[b].className=="gr")
			{
			a[b].onmouseover = function(){cursor_sniff(this.style)}
			a[b].onclick 	 = function()
				{
				if(document.getElementById("th1"))document.getElementById("th1").className="gr"
				if(document.getElementById("th2"))document.getElementById("th2").className="gr"
				this.className="th"
				limg	= document.getElementById("lg")
				limg.src= this.src.replace(/\/142\//,'\/300\/')				
				}
			}
		}
	}

function login()
	{
	empty = false;
	fm 	= document.login;
	checker(fm.user,"You must enter your user name");
	checker(fm.pass,"You must enter your password");
	if (empty == false){fm.submit()}
	}
	
function stock()
	{
	empty = false;
	fm 	= document.stock;
	checker(fm.make,"You must enter the make");
	if (empty == false){fm.submit()}
	}
	
function checker(obj,msg)
	{if(obj.value=="" && empty==false){alert(msg);empty=true;obj.focus()}}

function message(msg,obj)
	{alert(msg);empty=true;obj.focus()}
	
function cursor_sniff(obj)
	{if (document.all){obj.cursor="hand"}else{obj.cursor="pointer"}}

function del_caravan(id,f1,f2)
	{ok=window.confirm('Click OK to delete');if (ok==true){location.href=('?u=2&id='+id+'&f1='+f1+'&f2='+f2)}}

window.onload=startup