function otk_redirect(location)
{
    location.href = location;
}
function otk_show_hide(id)
{
    var element = document.getElementById(id);
    if (element.style.display == 'block') {
        element.style.display = 'none';
    } else {
        element.style.display = 'block';
    }
    return false;
}
function otk_intercept()
{
    for (var count = 0; count < document.links.length; count++) {
        if (document.links[count].className == 'blank') {
            document.links[count].target = '_blank';
        }
        if (document.links[count].className == 'button_blank') {
            document.links[count].target = '_blank';
        }
        if (document.links[count].className == 'partner') {
            document.links[count].target = '_blank';
        }
    }
}

id_popup = 0;
function otk_popup(url, w, h)
{
    if (w) {
        w = w + 'px';
    } else {
        w = 'auto';
    }
    if (h) {
        h = h + 'px';
    } else {
        h = 'auto';
    }
    var style = 'top=0, left=0, width=' + w + ', height=' + h + ', status=no, menubar=no, toolbar=no, scrollbars=no';
    window.open(url, '', style);
}

function otk_update(id, urls)
{
    var url = otk_base + urls[urls.selectedIndex].value;
    document.getElementById(id).setAttribute('src', url);
}

function otk_confirm()
{
    $$('a.otk_confirm').each(
    function(a) {
        a.observe('click', function(e) {
                is_confirmed = confirm(otk_lang['validation_alerts']['confirm']);
                if (is_confirmed) {
                    return true;
                } else {
                    Event.stop(e);
                    return false;
                }
            }
        );
    }
    );
}

function otk_help(text) {
    var wrapper = $('otk_help_wrapper');
    new Insertion.Top(wrapper, '<div class=\"otk_help\" style=\"display: none;\">' + text + '</div>');
    var elements = wrapper.descendants();
    var element = elements[0];
     new Effect.Appear(element); 
     new Effect.Fade(element, {duration: 10, delay: 5}); 
}


