function getAdress()
{
    var url=location.href;
    //http://www.ailetip.com/
    if(url.substr(0,10)=='http://www')
    return 'http://www.ailetip.com/';
    else
    return 'http://ailetip.com/';
}
function get_items(type,nid)
{
      $("#loading").bind("ajaxSend", function(){
        $(this).fadeIn('slow');
    }).bind("ajaxComplete", function(){
        $(this).fadeOut('slow');
        $("#loading").unbind();
    });


    $.get(getAdress()+'request.php', { t: type , id:nid ,http:1 }, function (data)
    {
        var li='';
        switch(type) {
            case 'b':
            li='li_birim';
            break;
            case 'k':
            li='li_klinik';
            break;
        }

        $('.smallform > ul > #'+li).html(data);
    });

}

function go_to_cli()
{
var ids='';
var names='';
    if(document.getElementById('go_cli'))
    {
    ids=document.getElementById('go_cli').value;
    names=document.getElementById('go_cli').options[document.getElementById('go_cli').selectedIndex].text;
    }
        if(ids!='' && ids.length>0 && !isNaN(ids))
        {
       $.get(getAdress()+'request.php', { t: 'goto' ,id:ids ,name:names ,http:1 }, function (data)
    {
        location.href=data;
    });
        }
}

function get_items_doc(type,nid)
{
      $("#loading").bind("ajaxSend", function(){
        $(this).fadeIn('slow');
    }).bind("ajaxComplete", function(){
        $(this).fadeOut('slow');
        $("#loading").unbind();
    });


    $.get(getAdress()+'request.php', { d: type , id:nid ,http:1 }, function (data)
    {
        var li='';
        switch(type) {
            case 'b':
            li='li_birim';
            break;
            case 'k':
            li='li_doktor';
            break;
        }

        $('.smallform > ul > #'+li).html(data);
    });

}

function go_to_doc()
{
var ids='';
var names='';
    if(document.getElementById('go_cli'))
    {
    ids=document.getElementById('go_cli').value;
    names=document.getElementById('go_cli').options[document.getElementById('go_cli').selectedIndex].text;
    }
        if(ids!='' && ids.length>0 && !isNaN(ids))
        {
       $.get(getAdress()+'request.php', { d: 'goto' ,id:ids ,name:names ,http:1 }, function (data)
    {
        location.href=data;
    });
        }
}

