function jump(link) {
    document.location.href = link;
}

function ChangeElementImage(idElement, idImage, idTable) {
    newImage = "url("+idImage+")";
    document.getElementById(idElement).style.backgroundImage = newImage;
    ShowHide_Room_Description(idTable);
}

function ShowHide_Room_Description(ElementId)
{
    thistd = document.getElementById(ElementId);
    thistd.style.display = (thistd.style.display == 'none' || thistd.style.display == '' ? 'block' : 'none');
}

function HideShow_Room_Description(ElementId)
{
    thistd = document.getElementById(ElementId);
    thistd.style.display = (thistd.style.display == 'block' || thistd.style.display == '' ? 'none' : 'block');
}

function Hide_Room_Description(ElementId)
{
    thistd = document.getElementById(ElementId);
    thistd.style.display="none";
}

function Show_Room_Description(ElementId)
{
    thistd = document.getElementById(ElementId);
    thistd.style.display="block";
}

function rm_f()
{
    $("#dialog_working").dialog('open');
    $.ajax({
        url: "ajax/rm_f.php?id="+$("#member_id").val()+
        "&notes="+$("#rm_notes").val()
        ,
        cache: false,
        success: function(html){
            $("#dialog_working").dialog('close');
            $("#dialog_complete").dialog('open');
        }
    });
}

function rb_f()
{
    $("#dialog_working").dialog('open');
    $.ajax({
        url: "ajax/rb_f.php?id="+$("#member_id").val()+
        "&notes="+$("#rb_notes").val()
        ,
        cache: false,
        success: function(html){
            $("#dialog_working").dialog('close');
            $("#dialog_complete").dialog('open');
        }
    });
}

function search_f(action, search_string)
{
    $('#li_search').show();
    $.ajax({
        url: "ajax/search_f.php?action="+action+"&search="+search_string
        ,
        cache: false,
        success: function(html){
            $("#search_result").html(html);
            $('#li_search').hide();
        }
    });
}

function cancel_event_f(id)
{
    $.ajax({
        url: "ajax/cancel_event_f.php?id="+id
        ,
        cache: false,
        success: function(html){
            $("#divMemberEvents").html(html);
        }
    });
}

function rsvp_f(id, amount, notes)
{
    $.ajax({
        url: "ajax/rsvp_f.php?id="+id+"&amount="+amount+"&notes="+notes
        ,
        cache: false,
        success: function(html){
            $("#divBHEvents").html(html);
        }
    });
}

function manager_f()
{
    $('#li_manager').show();
    $.ajax({
        url: "ajax/manager_f.php?subject="+$("#subject").val()+
        "&notes="+$("#notes").val()
        ,
        cache: false,
        success: function(html){
            $("#divOverflown").html(html);
        }
    });
}

function r_room_f()
{
    $('#li_r_room').show();
    $.ajax({
        url: "ajax/r_room_f.php?hotel-type="+$("#hotel-type").val()+
        "&datepicker="+$("#datepicker").val()+
        "&datepicker-out="+$("#datepicker-out").val()+
        "&room-type="+$("#room-type").val()+
        "&number-of-people="+$("#number-of-people").val()+
        "&notes="+$("#notes").val()
        ,
        cache: false,
        success: function(html){
            $("#divOverflown").html(html);
        }
    });
}

function r_restaurants_f()
{
    $('#li_r_restaurants').show();
    $.ajax({
        url: "ajax/r_restaurants_f.php?rest-type="+$("#rest-type").val()+
        "&datepicker="+$("#datepicker").val()+
        "&number-of-people="+$("#number-of-people").val()+
        "&datepicker-hh="+$("#datepicker-hh").val()+
        "&datepicker-mm="+$("#datepicker-mm").val()+
        "&notes="+$("#notes").val()
        ,
        cache: false,
        success: function(html){
            $("#divOverflown").html(html);
        }
    });
}

function r_boardroom_f()
{
    $('#li_r_boardroom').show();
    $.ajax({
        url: "ajax/r_boardroom_f.php?datepicker="+$("#datepicker").val()+
        "&number-of-people="+$("#number-of-people").val()+
        "&datepicker-hh="+$("#datepicker-hh").val()+
        "&datepicker-mm="+$("#datepicker-mm").val()+
        "&fdatepicker-hh="+$("#fdatepicker-hh").val()+
        "&fdatepicker-mm="+$("#fdatepicker-mm").val()+
        "&notes="+$("#notes").val()
        ,
        cache: false,
        success: function(html){
            $("#divOverflown").html(html);
        }
    });
}

function r_breakfast_f()
{
    $('#li_r_breakfast').show();
    $.ajax({
        url: "ajax/r_breakfast_f.php?datepicker="+$("#datepicker").val()+
        "&number-of-people="+$("#number-of-people").val()+
        "&notes="+$("#notes").val()
        ,
        cache: false,
        success: function(html){
            $("#divOverflown").html(html);
        }
    });
}

function edit_profile_f()
{
    $('#li_edit_profile').show();
    $.ajax({
        url: "ajax/edit_profile_f.php?first-name="+$("#first-name").val()+
        "&last-name="+$("#last-name").val()+
        "&dofb-dd="+$("#dofb-dd").val()+
        "&dofb-mm="+$("#dofb-mm").val()+
        "&dofb-yyyy="+$("#dofb-yyyy").val()+
        "&position="+$("#position").val()+
        "&phone="+$("#phone").val()+
        "&nationality="+$("#nationality").val()+
        "&u-description="+$("#u-description").val()+
        "&email="+$("#email").val()+
        "&password="+$("#password").val()+
        "&u-title="+$("#u-title").val()+
        "&industry="+$("#industry").val()+
        "&company="+$("#company").val()+
        "&p-address="+$("#p-address").val()+
        "&b-address="+$("#b-address").val()+
        "&membership_type_visible="+$("#membership_type_visible").attr("checked")+
        "&photo_visible="+$("#photo_visible").attr("checked")+
        "&receive_mail="+$("#receive_mail").attr("checked")+
        "&display_profile="+$("#display_profile").attr("checked")
        ,
        cache: false,
        success: function(html){
            $("#divOverflown").html(html);
        }
    });
}

function edit_c_profile_f()
{
    $('#li_edit_c_profile').show();
    $.ajax({
        url: "ajax/edit_c_profile_f.php?c-name="+$("#c-name").val()+
        "&c-web="+$("#c-web").val()+
        "&c-address="+$("#c-address").val()+
        "&c-ceo="+$("#c-ceo").val()+
        "&c-revenue="+$("#c-revenue").val()+
        "&c-description="+$("#c-description").val()
        ,
        cache: false,
        success: function(html){
            $("#divOverflown").html(html);
        }
    });
}
