﻿$(function() 
{
    // make the tabs
    $("#DocumentationSelection").tabs();
    
    // collapse the different sample codes
    $("#SampleCodeSelection").accordion(
        {
            active: false,
            autoHeight: false,
            collapsible: true
        }
    );
});

function Search()
{
    var sSearchString = $("#txtSearch").val();
    if(sSearchString != "")
    {
        window.open("http://www.xignite.com/Search.aspx?search=" + sSearchString, "Xignite");
    }
}

function View(pAsmxOperationUrl, pRegistrationUrl)
{
    var sUrl = pAsmxOperationUrl;
    var sCookie = $.cookie("xigniteemail");
    var allInputs = $(".textBoxInput, .dropDownInput, input.radioInput:checked");
    $.each(allInputs, 
        function(pIndex, pInput)
        {
            var sInputName = pInput.name.toString();
            var sInputValue = pInput.value.toString();
            arrInputAttributes = sInputName.split("$");
            sInputName = arrInputAttributes[arrInputAttributes.length - 1];
            if(sUrl.indexOf("?") == -1)
            {
                sUrl += "?";
            }
            else
            {
                sUrl += "&";
            }
            sUrl += sInputName + "=" + escape(sInputValue)                   
        }
    );        
    
    if (null != pRegistrationUrl)
    {
        sUrl = pRegistrationUrl + "&ReturnUrl=" + escape(sUrl);
    }
    window.open(sUrl, "_blank");
}

$(function() 
{
    // make the tabs
    $("#DocumentationSelection").tabs();
    
    // collapse the different sample codes
    $("#SampleCodeSelection").accordion(
        {
            active: false,
            autoHeight: false,
            collapsible: true
        }
    );
});