// sets the top panels to scroll to the left from a nav element.
// set the number of the panel you want to slide in the nav element id at the 4th position
// for example nav1, myn1 nv-1 and so on then set the id for the panel to be p1, p2, p3 etc.

/* DISABLED IN THIS VERSION 

$('#navigation li.nav').click(function () {         // replace '#navigation li.nav' with the name of the nav element
        var id = ($(this).attr('id')).substring(4);
        goToPanel('p' + id);
});

function goToPanel(id) {
        $('#navigation a.nav').removeClass('on');
        $('#navigation a#nav-' + id).addClass('on');
        $('.panel#' + id).appendTo('#scroll-wrapper');
}
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
        var ie = new Number(RegExp.$1)
        if (ie >= 7) var goIE = 1;
} else {
        var goIE = 0;
}

function scroller(id) {
        if (goIE == 1) {
                $('.panel#' + id).animate({
                        left: "0"
                }, 1500);
        } else {
                $('.panel#' + id).animate({
                        left: '0',
                }, {
                        duration: 800,
                        specialEasing: {
                                left: 'easeInOutCubic'
                        },
                        complete: function () {
                                $('.panel').not(':last').animate({
                                        left: '1280'
                                });
                        }
                });
        }
}
*/
$('.panel-content-holder').fadeOut('fast');
$('.nav-explore').hover(

function () {
        if ($(this).attr('active') == 'yes') {
        } else {
                $('.nav-explore').each(function (index) {
                        $(this).attr('active', 'no');
                });
                $(this).attr('active', 'yes')
                panelHide();
                s = $(this);
                panelShow(s);
        }
}, function () {});

function panelShow(s) {
        var p = s.attr('id');
        s.animate({
                bottom: '-320',
                height: '120'
        }, 200, function () {
                $('#' + p + '-p').fadeTo('slow', 1.0, function () {
                        $(this).attr('active', 'yes');
                });
        });
}
$('.panel-close').click(function () {
        $('.nav-explore').each(function (index) {
                $(this).attr('active', 'no');
        });
        panelHide();
});

function panelHide() {
        $('.panel-content-holder').fadeTo('slow', 0.0, function () { });
        $('.nav-explore').animate({
                bottom: '-380',
                height: '60'
        }, 500, function () {});
}

// CONTROLS THE UPCOMING EVENTS AND FEATURED PROGRAMS PAGINATION

$('.blue-top').find('li:eq(0)').each(function (index) {
        $(this).fadeIn('slow');
});

$('.player-box').find('li:eq(0)').each(function (index) {
        $(this).fadeIn('slow');
});


$(document).ready( function() {
$('.pager').find('em').click(function () {
        var rC = $(this).closest('div.box');
        rC.find('em').each(function (index) {
                $(this).removeClass('on');
        });
        var pN = $(this).text() - 1;
        $(this).addClass('on');
        playSlide(pN, rC);
        
});

function playSlide(pN, rC) {
        rC.find('li').each(function (index) {
                $(this).hide();
        });
        rC.find('li:eq(' + pN + ')').fadeIn('slow');
}
$('.pager').find('em:last').click();
});

$(document).ready(
  function() {
    $('#get-started').click(function() {
      var select_I_am_a = $('#I_am_a .select-text').attr('value');
      var select_interested_in_one = $('#interested_in .select-text').attr('value');
      var select_interested_in_two = $('#interested_in_level_two_ddl .select-text').attr('value');

      var select_and_looking_for = $('#and_looking_for .select-text').attr('value');
      
      if(select_I_am_a != "" && select_and_looking_for != ""){
      window.location.href = "/i-am-results.aspx?PartType="+ select_I_am_a+"&Interest1="+select_interested_in_one +"&Interest2="+select_interested_in_two+"&LookingFor="+select_and_looking_for;
      }
      else
      {
      alert('Please review selection');
      }
        })        
      
      
      $('#interested_in select').change(function() {
      var selectedInterest = $(this).val();
      if(selectedInterest != "")
      {
        var concatselectedId = '#interested_in_options select#'+ selectedInterest + '_options';
  
        $('#interested_in_level_two_ddl select').html($(concatselectedId).html());
        $('#interested_in_level_two_ddl .select-text').html('Select');
        $('#interested_in_level_two').show();
      }
      else
      {
        $('#interested_in_level_two_ddl select').html('<option class="answer" value="" selected="selected">Select</option>');
       $('#interested_in_level_two').hide();
      }
      
      });
      
      
      });
    
    

  









