$(document).ready(function(){
	initMenuTop();

  /* Cession */

  $('#cession-franchise').click(function(){
    $('.cession-wrapper.left').fadeTo("slow", 0.33);
    $('.subscribe-option.not-franchise').fadeTo("slow", 0.0);
    $('.subscribe-content.franchise').show();
    $('.subscribe-content.franchise').animate({
      height: 270,
      width: 288
    }, 1000 );
    return false;
  });

  $('#cession-not-franchise').click(function(){
    $('.cession-wrapper.left').fadeTo("slow", 0.33);
    $('.subscribe-option.franchise').fadeTo("slow", 0.0);
    $('.subscribe-content.not-franchise').show();
    $('.subscribe-content.not-franchise').animate({
      height: 525,
      width: 288
    }, 1000 );

    return false;
  });

  $('.got-an-account a').click(function(){
    $('.cession-wrapper.left').fadeTo("slow", 1.0);
    $('.subscribe-option.franchise').fadeTo("slow", 1.0);
    $('.subscribe-option.not-franchise').fadeTo("slow", 1.0);
    $('.subscribe-content.not-franchise').hide();
    $('.subscribe-content.not-franchise').animate({
      height: 0
    }, 1000 );
    $('.subscribe-content.franchise').hide();
    $('.subscribe-content.franchise').animate({
      height: 0
    }, 1000 );

    return false;
  });
  
  
  /* Cession */
  $('#cession-franchise').click(function(){
    $('.cession-wrapper.left').fadeTo("slow", 0.33);
    $('.subscribe-option.not-franchise').fadeTo("slow", 0.0);
    $('.subscribe-content.franchise').show();
    $('.subscribe-content.franchise').animate({height: 270 + 'px', width: 288 + 'px'}, 1000);
    return false;
  });

  $('#cession-not-franchise').click(function(){
    $('.cession-wrapper.left').fadeTo("slow", 0.33);
    $('.subscribe-option.franchise').fadeTo("slow", 0.0);
    $('.subscribe-content.not-franchise').show();
    $('.subscribe-content.not-franchise').animate({
	    height: 500,
		width: 288
	  }, 1000 );

    return false;
  });

  $('.got-an-account a').click(function(){
    $('.cession-wrapper.left').fadeTo("slow", 1.0);
    $('.subscribe-option.franchise').fadeTo("slow", 1.0);
    $('.subscribe-option.not-franchise').fadeTo("slow", 1.0);
    $('.subscribe-content.not-franchise').hide();
    $('.subscribe-content.not-franchise').animate({
	    height: 0
	  }, 1000 );
	$('.subscribe-content.franchise').hide();
    $('.subscribe-content.franchise').animate({
	    height: 0
	  }, 1000 );

    return false;
  });

});


function	initMenuTop()
{
	$("ul.sub-nav").hide();
	
	$("#nav > ul > li").hover(function()
	{
	if ($.browser.msie && $.browser.version.substr(0,1)<7) {
	  $('#find-a-franchise select, #find-a-video select').css('visibility','hidden');
	}
	subnav = $('.sub-nav',this);
	left = ($(this).width() - 208 + 28)/2;
	subnav.css("left",left+"px");
	subnav.show();
	
	},function() {
	 $('.sub-nav',this).hide();
	  if ($.browser.msie && $.browser.version.substr(0,1)<7) {
		$('#find-a-franchise select, #find-a-video select').css('visibility','visible');
	  }
	});
}

function	changeLvlAssist(lvl)
{
	$('.nav li.active[id*="lvl"]').removeClass('active');
	$('#lvl' + lvl).addClass('active');
}

