﻿/// <reference path="jquery.min.vsdoc.js" />


function loginPageInit() {
    $("#InfoWhyTab").bind("click", function(e) { showTab('InfoWhyTab', 'loginInfoWhy'); });
    $("#InfoCredibilityTab").bind("click", function(e) { showTab('InfoCredibilityTab', 'loginInfoCredibility'); });
    $("#InfoTimelineTab").bind("click", function(e) { showTab('InfoTimelineTab', 'loginInfoTimeline'); });
    $("#InfoPastListsTab").bind("click", function(e) { showTab('InfoPastListsTab', 'loginInfoPastLists'); });
    $("#InfoFAQTab").bind("click", function(e) { showTab('InfoFAQTab', 'loginInfoFAQ'); });
    $("#InfoConfidentialityTab").bind("click", function(e) { showTab('InfoConfidentialityTab', 'loginInfoConfidentiality'); });

    showTab('InfoWhyTab', 'loginInfoWhy');
}

function showTab(tabName, tabContent) {
    var $tab = $("#" + tabName);
    $tab.parent().children().removeClass("selectedTab");
    $tab.addClass("selectedTab");
    var $tabContent = $("#" + tabContent);
    $tabContent.parent().children().addClass("nodisplay");
    $tabContent.removeClass("nodisplay");
}

function toggleSurveyHelp() {
    var $surveyHelpText = $("#surveyHelpText");
    $surveyHelpText.slideToggle("600");
    //alert($surveyHelpText.data('opened'));
    if ($surveyHelpText.data('opened') === null){
        $("#surveyHelpInfoBox").animate({ width: "550px" }, 600);
        $surveyHelpText.data('opened', 'open');
    }
    if ($surveyHelpText.data('opened') === 'open') {
        $("#surveyHelpInfoBox").animate({ width: "220px" }, 600);
        $surveyHelpText.data('opened', 'closed');
    } else {
        $("#surveyHelpInfoBox").animate({ width: "550px" }, 600);
        $surveyHelpText.data('opened', 'open');
    }
}

function toggleSurveyInstructions() {
    var $surveyInstructionsText = $("#surveyInstructionsText");
    $surveyInstructionsText.slideToggle("600");
    //alert($surveyInstructionsText.data('opened'));
    if ($surveyInstructionsText.data('opened') === null) {
        $("#surveyInstructionsBox").animate({ width: "550px" }, 600);
        $surveyInstructionsText.data('opened', 'open');
    }
    if ($surveyInstructionsText.data('opened') === 'open') {
        $("#surveyInstructionsBox").animate({ width: "220px" }, 600);
        $surveyInstructionsText.data('opened', 'closed');
    } else {
        $("#surveyInstructionsBox").animate({ width: "550px" }, 600);
        $surveyInstructionsText.data('opened', 'open');
    }
}