	function join(form, n, type) {
		form.target = "form" + n + type;
		if (type == 'Q')
			{
			form.jar.value = form.jarQ.value;
			form.codebase.value = "com.copart.vb2.applets.buyer.LiteBuyerApplet.class";
			form.height.value = "315";
			form.width.value = "380";
			options = 'resizable=no,scrollbars=no,width=385,height=315,screenX=0,screenY=0,status=yes';
			}
		else
			{
			form.jar.value = form.jarF.value;
			form.codebase.value = "com.copart.vb2.applets.buyer.BuyerApplet.class";
			form.height.value = "540";
			form.width.value = "705";
			options = 'resizable=no,scrollbars=no,width=713,height=550,screenX=0,screenY=0,status=yes';
			}
		popUpWindow = window.open('http://www.copart.com/loading.htm',form.target,options);
		form.submit();
	}
	
	function popupWin(path,winWidth,winHeight,scrollBar,resizable){
		if (winWidth==null||winWidth=="") winWidth=400;
		if (winHeight==null||winHeight=="") winHeight=300;
		if (scrollBar==null||scrollBar=="") scrollBar='yes';
		if (resizable==null||resizable=="") resizable='yes';
		var window_handler="";
	   	var options="";
		options='width='+winWidth+', height='+winHeight+', scrollbars='+scrollBar+', resizable='+resizable;
		if (typeof(window_handler) == "object" && !window_handler.closed ) {
			window_handler.close();
		}
	   window_handler=window.open(path,'window_handler',options);
	   window_handler.focus();
	}
	
	function autoJoin(ajYard, ajLane, totalRows)
	{
		var autoJoin = document.getElementById("autoJoin");
		if (ajYard.length != 0)
		{
			for(i=1;i<=totalRows;i++)
			{
				var jForm = document.getElementById("form"+i);
				var jSaleRow = document.getElementById("sale"+i);
				if (jForm.yardNum.value == ajYard && jForm.lane.value == ajLane && jForm.host.value != '')
				{
					autoJoin.innerHTML = "Joining \""+jForm.yardName.value+"\"  ...";
					jSaleRow.style.backgroundColor = "#FFBE05";
					autoJoin.style.display = 'block';
					join(jForm, i, 'F');
				}
			}
		}		
	}

