function deleteInstitute(inVal)
{
    if (inVal > 0)
    {
        var data_1 = 'item_row_';
        data_1 = data_1 + inVal.toString();
        
        if (confirm("Are you sure you wish to delete this item?"))
        {
            var poststr = 'callback=true&id=' + inVal.toString();
		    ajaxpack.postAjaxRequest('deleteInstitute.asp', poststr, function t() 
		    { 
		        if(ajaxIsReady()) 
		        { 
		            if(ajaxpack.ajaxobj.responseText == "success")
		            {
		                document.getElementById(data_1).style.display = 'none';
		            }    
		        } 
		    }, 'html');
        }
    }
}

function checkPostcode()
{
    var post_1 = document.getElementById("postcode1").value.length;
    
    try
    {
        if (post_1 == 4)
        {
            document.getElementById("postcode2").focus();
        }
    }
    catch(e)
    {
        //Do nothiong
    }
}

function formSubmitCheck(tid)
{
    switch(tid)
    {
        case 1:
        
            var success = true;
            var fullpostcode = '';
            var post_1 = document.getElementById("postcode1").value;
            var post_2 = document.getElementById("postcode2").value;
            fullpostcode = post_1 + post_2;
            
            if (post_1.length > 0 && post_2.length > 0)
            {
                var poststr = usePointFromPostcode(fullpostcode, showPointLatLng, document.getElementById('form_1'), 1);
            }
            else
            {
                document.forms['form_1'].submit();
            }
            
            break;
        default:
            break;
    }
}

function switchInstitutes()
{
    var id = document.getElementById("selector_id").value;
    if (id > 0)
    {
        document.location = 'institutes.asp?id=' + id.toString();
    }
}

//function switchInstitutes2()
//{
    //var id = document.getElementById("selector_id").value;
    //document.location = 'institute_map.asp?id=' + id.toString();
//}

