// JScript File
var isform = false;
 var $window = $(window);
 $(document).ready(function() {
 
 
  
  // $('#main-body').css('display','none');
  // $('#nav2').css('display','none');
  // $('#nav3').css('display','none');
 
  
  $('#link-explore').click(function(){

    openForm();
    
  });
  
  $('#a-collections').click(function(){

    openNav3();return false;
    
  });
  
  $('p.footer-left').click(function(){
  
  
   if($('#popup').css('height') == '0px'){
  openFooter()
    }
    else
    {
     closeFooter()
    }
  
  });

$('.footer-close').click(function(){
    closeFooter(); 
  });
  
  $('#more-info').click(function(){
    openMoreInfo()
 });

 });

 function closeFooter(){
   $('#popup').animate({ 
    height: "0px", top: ($window.height())+"px"
    }, 1200,function() {
    
        $('#popup').css('display','none');
    
    });
 }
 
 function openFooter(){
 $('#popup').css('height','0px');
 $('#popup').css('top',($window.height())+"px");
  $('#popup').animate({ 
    height: ($window.height()-75)+"px", top: "55px"
    }, 1200,'');
 
 }
 
 
 
function openMoreInfo(){
    $("#slidecaption").slideToggle(1200, function(){

        if($('#slidecaption').css('display')!='none')
        {
            $('#more-info').fadeTo(1200,0);
        }
        else
        {
             $('#more-info').fadeTo(1200,1);
        }
    });
 }
 
 function openForm(){
 
 if($('#popup').css('height') != '0px'){
    closeFooter();
 }


    if($('#supersize').css('top') == '55px')
    {
    $('#nav2').show();
    $('#supersize').animate({
    top: "85px"
    }, 'fast','');
    }
    else
    {
    
    $('#supersize').animate({ 
    top: "55px"
    }, 'fast',function(){$('#nav2').hide();});
    }
 }
 
 function openSignUp(iTop){
 
 var ie6 = ($.browser.msie && parseInt($.browser.version, 10) <= 6);
 
 if($('#popup').css('height') != '0px'){
    closeFooter();
 }

 $('#main-body').css('height',($window.height()-100-20)+"px");
 
    if(ie6)
    {
        $('#nav2').show();
        $('#supersize').hide();
        $('#main-body').show();
    }
    else
    {
    
        if($('#supersize').css('top') <= '55px')
        {
        $('#main-body').css('display','block');
        $('#nav2').show();
        $('#supersize').animate({
        top: iTop
        }, 1200,'');
        }
        else
        {
        $('supersize').animate({
        top: "0px"
        }, 1200,'', function(){
        
        $('#main-body').css('display','none');
            if(isform==true){
                $('#expando').fadeOut('slow');
                document.location.href = "/";
            }
        });
        }
    }
    


 }
 
 function openNav3(){
 
 if($('#popup').css('height') != '0px'){
    closeFooter();
 }
//alert($('#nav3').css('display'));
    if($('#nav3').css('display') == 'none')
    {
    $('#nav3').show();
    $('#supersize').animate({
    top: "75px"
    }, 'fast','');
    }
    else
    {
    if($('#supersize')){
    $('#supersize').animate({ 
    top: "55px"
    }, 'fast',function(){$('#nav3').hide();});
    }
    else
    {
    $('#nav3').hide();
    }
    }
    
    
 }


