function quickLookupInit(valIn, typeId)
{

    switch (typeId)
    {
        case 1: //Station lookup
            
            switch(valIn)
            {
                case 1:
                    
                    var iObj = document.getElementById("lookup_1");
                    if (iObj.value == 'Enter a station')
                    {
                        iObj.value = '';
                        iObj.className = 'quick_lookup_selected';
                    }
                    
                    break;
                case 2:
                    
                    var iObj = document.getElementById("lookup_1");
                    if (iObj.value == 'Enter a station')
                    {
                        iObj.value = '';
                        iObj.className = 'quick_lookup_selected';
                    }
                    else
                    {
                        var strIn = iObj.value;
                        if (strIn != '')
                        {
                            var poststr = 'callback=true&typeid='+ typeId +'&strin=' + escape(strIn);
		                    ajaxpack.postAjaxRequest('getStationLookup.asp', poststr, function t() 
		                    { 
		                         if(ajaxIsReady())
		                         { 
		                            document.getElementById("src_array_1").value = ajaxpack.ajaxobj.responseText;
		                            window.frames['quick_lookup_frame_1'].buildItemsIframe(typeId);
		                         } 
		                    }, 'html');
                        }
                    }
                    
                    break;
                default:
                    break;
            }
            
            break;
        case 2:  //Pub lookup
            
            switch(valIn)
            {
                case 1:
                    
                    var iObj = document.getElementById("lookup_2");
                    if (iObj.value == 'Enter a pub/club')
                    {
                        iObj.value = '';
                        //iObj.className = 'quick_lookup_selected';
                    }
                    
                    break;
                case 2:
                    
                    var iObj = document.getElementById("lookup_2");
                    if (iObj.value == 'Enter a pub/club')
                    {
                        iObj.value = '';
                        //iObj.className = 'quick_lookup_selected';
                    }
                    else
                    {
                        var strIn = iObj.value;
                        if (strIn != '')
                        {
                            var poststr = 'callback=true&typeid='+ typeId +'&strin=' + escape(strIn);
		                    ajaxpack.postAjaxRequest('getQuickLookup.asp', poststr, function t() 
		                    { 
		                         if(ajaxIsReady())
		                         { 
		                            document.getElementById("src_array_2").value = ajaxpack.ajaxobj.responseText;
		                            window.frames['quick_lookup_frame_2'].buildItemsIframe(typeId);
		                         } 
		                    }, 'html');
                        }
                    }
                    
                    break;
                default:
                    break;
            }
            
            break;
        default:
            break;
    }
}

function exit_quick_lookup(typeid)
{
    var divObj = document.getElementById("quick_lookup_div_" + typeid.toString());
    var fObj = document.getElementById("quick_lookup_frame_" + typeid.toString());
    
    fObj.style.display = 'none';
    divObj.style.display = 'none';
}
