﻿// JScript File

//Provide popup window capability
function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=550,height=400,left = 600,top = 400');");
    }

//Tabbed container Helpers
function PanelClick(sender, e) {
    var Messages = $get('<%=Messages.ClientID%>');
    Highlight(Messages);
}

function ActiveTabChanged(sender, e) {
    var CurrentTab = $get('<%=CurrentTab.ClientID%>');
    CurrentTab.innerHTML = sender.get_activeTab().get_headerText();
    Highlight(CurrentTab);
}

var HighlightAnimations = {};
function Highlight(el) {
    if (HighlightAnimations[el.uniqueID] == null) {
        HighlightAnimations[el.uniqueID] = AjaxControlToolkit.Animation.createAnimation({
            AnimationName : "color",
            duration : 0.5,
            property : "style",
            propertyKey : "backgroundColor",
            startValue : "#FFFF90",
            endValue : "#FFFFFF"
        }, el);
    }
    HighlightAnimations[el.uniqueID].stop();
    HighlightAnimations[el.uniqueID].play();
}

function ToggleHidden(value) {
    $find('<%=Tabs.ClientID%>').get_tabs()[2].set_enabled(value);
}
