function showBlock(blockId)	{
	document.getElementById(blockId).style.display = "block";
}
function show(blockId)	{
	document.getElementById(blockId).style.display = "";
}
function hideBlock(blockId)	{
	document.getElementById(blockId).style.display = "none";
}

function $2(id, doc)
{
    if(doc == null){
        if(document.getElementById){ return document.getElementById(id); }
        else if(document.all){ return document.all(id); }
    } else {
        if(doc.getElementById){ return doc.getElementById(id); }
        else if(doc.all){ return doc.all(id); }
    }
}

function toggleBlock(blockId) { if($2(blockId).style.display == "") hideBlock(blockId); else show(blockId); }

function GetKey2(evt)
	{
		evt = (evt) ? evt : (window.event) ? event : null;
		if (evt)
		{
			var cCode = (evt.charCode) ? evt.charCode :
					((evt.keyCode) ? evt.keyCode :
					((evt.which) ? evt.which : 0));
			return cCode; 
		}
	}


function Select(url, params, callback, sync)
{         
    if(sync == true)
    {
        var html = $.ajax({
            type: "GET",
            url: url,
            async: false,
            data: params 
        }).responseText;
        return html;
    }
    else
    {
        $.ajax({
           type: "GET",
           url: url,
           dataType: "html",
           data: params,       
           success: function(data, textStatus){ callback(data); }       
        });
    }
}

function AsyncSelect(url, params, callback, callbackargs)
{             
    return $.ajax({
       type: "GET",
       url: url,
       dataType: "html",
       data: params,       
       success: function(data, textStatus){ callback(data, callbackargs); }       
    });    
}