﻿$(document).ready(function () {
    var selOption;

    $(".details").hide(0);
    $(".details > div").hide(0);

    $(".wif_options li").fadeTo(0, 0.6);
    $(".wif_options li").hover(function () {
        $(this).fadeTo(300, 1);
    }, function () {
        if (!$(this).is(selOption)) { $(this).fadeTo(0, 0.6); }
    });

    $(".whositfor .wif_options li").click(function () {
        $(".details").show(0);
        $(".details > .wi4_box").stop().hide(0);
        $(".details > ." + $(this).attr("class")).fadeTo(700, 1);
        $(".wif_options li").not($(this)).fadeTo(0, 0.6);
        $(this).fadeTo(300, 1);
        selOption = $(this);
    });

    //////////////////////////
    //Check if one of the panels have been preselected:
    var querystring = location.search.replace('?', '').split('&');
    var queryObj = {};
    for (var i = 0; i < querystring.length; i++) {
        var name = querystring[i].split('=')[0];
        var value = querystring[i].split('=')[1];
        queryObj[name] = value;
    }
    if (queryObj["for"] != null) {
        $(".wif_options li:nth-child(" + queryObj["for"].toString() + ")").click();
    }


});



