﻿// JScript File
function ImageIsLoaded(img) {
    try {
        if (img.readyState == 'complete') {
            return true;
        }
        if (typeof img.naturalWidth!= 'undefined' && img.naturalWidth > 0) {
            return true;
        }
    }
    catch(err) {
    }
    return false;
}

function THSCheckState(clientId) {
    
    clearTimeout(gs(clientId,'thsto'));
    
    for(var i=1;i<=15;i++) {
    
        var img = dge(clientId + '_ths_ths_img_' + i.toString());
        var obj = dge(clientId + '_ths_ths_' + i.toString());
        if (img && obj) {
            if (ImageIsLoaded(img)) {
                obj.style.display = 'block';
            } else {
                obj.style.display = 'none';
            }
        }
    }
    
}

function THSSel(clientId, th) {
    ss(clientId,'th',th);
    var obj = dge(clientId + '_ths_');
    if (obj) {
        if (!th || th=='') {
        obj.className = 'THSItemSEL';
        } else {
            obj.className = 'THSItem';
        }
    }
    for(var i=1;i<=15;i++) {
        obj = dge(clientId + '_ths_' + i.toString());
        if (obj) {
            obj.className = 'THSItem';
            if (i.toString()==th) {
                obj.className = 'THSItemSEL';
            }
        }
    }
}


