// JavaScript Document


var tim;
var tim_halt;
var inter;			// holds the timer for the front page imager
var search_key;		// the contents of the search box are saved here and 



// <express code timers>
function init(){
clearInterval( tim );
clearTimeout( tim_halt );
tim = setInterval('checkcode()', 10 );

}

function halt(){
	var stopper = clearInterval( tim );
	tim_halt = setTimeout('clear_select();', 1500);
}


function checkcode() {
	
if($F('code') == search_key ) return;
search_key = $F('code');

//alert("Check Code");

if($F('code').length < 2){ clear_select(); }
	
if($F('code').length >= 2) {
	var url = 'scripts/divcode.asp';
	var ajax = new Ajax.Updater(
		{success: 'results'},
		url, {
				method: 'get', parameters: 'code=' + search_key });
		}
	//alert("Check Code:" + search_key);
}


function clear_select(){
	var ajax = new Ajax.Updater( {success: 'results'}, 'ajax/null.asp', { method: 'get', parameters: ''} );
	//alert("off");
}

function fillExpress( found ){
$('code').value = found;
var stopper = clearInterval( tim );
$('results').innerHTML='';
//	alert( found );
}


// </express code timers>

