﻿var chkClick = false; 

function toggleInfo(boothID) {
    var main = gE('main');
    var thumbnail = gE('thumbnail' + boothID);
    var info = gE('info' + boothID);

    if (info.className.indexOf('coll') > -1) {
        sT(info, gT(thumbnail) + 85);
        sL(info, gL(thumbnail) - gL(main) + 59);
        eE(info);
    }
    else
        cE(info);
}

function showBooth(logo, boothNumber, address, phone, graphic, company, email, website, description) {

    if (chkClick) {
        chkClick = false;
        return;
    }
//function showBooth(logo, boothNumber) {
    var booth = gE('tblBooth');
    //var jj = gST();
    
    gE('imgLogo').src = 'tml/upload/company/' + logo;
    wH('boothNumber', 'Booth #' + boothNumber);
    wH('address', address);
    wH('phone', 'Phone ' + phone);
    gE('imgGraphic').src = 'tml/upload/booth/graphic/' + graphic;
    wH('company', company);
    gE('email').href = 'mailto:' + email;
    gE('website').href = website;
    wH('description', description);

    //if (jj < 296) {
        sT(booth, 10);
    //}
    //else {
    //    sT(booth, jj + 10);
    //}
    
    sL(booth, -12);
    
    eE(booth);
}

function hideBooth() {
    cE(gE('tblBooth'));
}

function printBooth() {
    var count = document.forms[0].length;
    var list = '';

    for (var c = 0; c < count; c++) {
        if (document.forms[0][c].id.indexOf('chk') > -1) {
            if (document.forms[0][c].checked) {
                if (list.length > 0)
                    list += ',';

                list += document.forms[0][c].value;
            }
        }
    }

    if (list.length > 0)
        gE('ifrPrintBooth').src = 'tml/frames/print-booth.aspx?ids=' + list;
}
