﻿function SimpleTip(text) {
    Tip(text, STICKY, true, BORDERWIDTH, 1, PADDING, 10, BGCOLOR, '#eeeeee', CLICKCLOSE, true, BORDERCOLOR, '#999999', DELAY, 0);
}

function MakeSubMenu(guid, ctrl, offsetX, width, height) {
    TagToTip(guid, HEIGHT, height, WIDTH, width, DELAY, 0, FADEIN, 200, FADEOUT, 200, STICKY, true, COPYCONTENT, true, CLICKCLOSE, true, BGCOLOR, '#ffffff', BORDERCOLOR, '#999999', OPACITY, 95, SHADOW, true, SHADOWWIDTH, 1, SHADOWCOLOR, '#aaaaaa')
}

function KeyValuePair(text, link) {
    this.text = text;
    this.link = link;
}


function GenerateOverlayLinks(containter, id, array) {
    var table = document.createElement('table');
    table.setAttribute('id', id);
    table.setAttribute('style', 'height: 200px;');
    var tbo = document.createElement('tbody');
    var tr = document.createElement('tr');
    var td = document.createElement('td');
    td.setAttribute('style', 'padding:10px');
    for (i = 0; i < array.length; i++) {
        try {
            var href = document.createElement('a');
            href.setAttribute('href', array[i].link);
            //href.setAttribute('text', array[i].text);
            //href.innerText = array[i].text;
            href.setAttribute('class', 'MDLink1');
            var span = document.createElement('span');
            span.innerText = array[i].text;
            span.innerHTML = array[i].text;
            href.appendChild(span);
            td.appendChild(href);

            var br = document.createElement('br');
            td.appendChild(br);
        }
        catch (e) {
        }
    }

    tr.appendChild(td);
    tbo.appendChild(tr);

    table.appendChild(tbo);
    document.getElementById(containter).appendChild(table);
    return table;
}

function InitGallery(container) {
    $(document).ready(function() {
        $(container).bxGallery({
            thumbwidth: 75,
            //thumbheight:20,
            thumbcrop: false,
            maxheight: 450,
            maxwidth: 520,
            thumbcontainer: 75,
            croppercent: .20,
            load_image:'spinner.gif',
            thumbplacement: 'right',
            wrapperclass: 'outer3'
        });
    });
}

function InitServicesTabs(container, hasPhotos) {

    var showMode = "table-cell";
    if ($.browser.msie) {
        showMode = "block";
    }


    var $tabs = $(container).tabs({ selected: 0 });

    if (!hasPhotos) {
        $('#tabPhotos').css("display", "none");
        $tabs.tabs('select', 1); // switch to third tab
        $get('tabServices').className = 'TabHeaderSelected';
    }
    else {
        $('#tabPhotos').css("display", showMode);
    }
    $('#tabPhotos').click(function() { // bind click event to link
        $tabs.tabs('select', 0); // switch to third tab
        $get('tabServices').className = 'TabHeaderInactive';
        $get('tabPhotos').className = 'TabHeaderSelected';
        //$get('tabKenteken').className = 'SearchTab';
        return false;
    });
    $('#tabServices').click(function() { // bind click event to link
        $tabs.tabs('select', 1); // switch to third tab
        $get('tabServices').className = 'TabHeaderSelected';
        $get('tabPhotos').className = 'TabHeaderInactive';
        return false;
    });

}