jQuery(function( $ ){

     
         
     $('#PanelCycle').cycle({ 
    fx:     'fade', 
    speed:  '250', 
    timeout: 0 
});

  $(".Popvideo").click(function() {
        $.fancybox({
            'padding'       : 0,
            'autoScale'     : false,
            'transitionIn'  : 'none',
            'transitionOut' : 'none',
            'title'         : this.title,
            'width'         : 640,
            'height'        : 385,
            'href'          : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
            'type'          : 'swf',
            'swf'           : {
            'wmode'             : 'transparent',
            'allowfullscreen'   : 'true'
            }
        });
 
        return false;
    });
    

    
$('#NavCreate').click(function() { 
    $('#PanelCycle').cycle(0); 
    $('.Panels').find('a').removeClass("Selected");
    $(this).addClass("Selected");
    return false; 
}); 
 
$('#NavManage').click(function() {  
    $('#PanelCycle').cycle(1); 
    $('.Panels').find('a').removeClass("Selected");
    $(this).addClass("Selected");    return false;  
}); 
 

$('#NavCollaborate').click(function() { 
    $('#PanelCycle').cycle(2); 
        $('.Panels').find('a').removeClass("Selected");
    $(this).addClass("Selected");
    return false; 
}); 
 
$('#NavFiles').click(function() {  
    $('#PanelCycle').cycle(3);  
        $('.Panels').find('a').removeClass("Selected");
    $(this).addClass("Selected");
    return false;  
}); 
 

$('#SignUp.Plans.Step1 .Promos.Plans .Item').live('click', function() {  
    $('#SignUp.Plans .Promos.Plans .Item').removeClass("Selected");
    $(this).addClass("Selected"); 
     $(this).find('.Nan').hide(); 
    var temp = $(this).attr('title');
     $('#SignUp.Plans .PlanSelect').val(temp);
    temp=temp.toLowerCase();
     $('.Form form').attr('action','https://www.remotedirector.com/signup/step_1/'+temp);

   
    
}).hover(
function(){ $(this).not('.Selected').find('.Nan').show().css('display','block');  },
function(){ $(this).find('.Nan').hide(); }

); 


$('#SignUp.Plans.Step2 .Promos.Plans .Item').live('click', function() {
    $('#SignUp.Plans .Promos.Plans .Item').removeClass("Selected");
    $(this).addClass("Selected"); 
     $(this).find('.Nan').hide(); 
    var userID = $('.UID').val(); 
    var temp = $(this).attr('title');
     $('#SignUp.Plans .PlanSelect').val(temp);
     $('#SignUp.Plans .BillingType').hide();
     $('.BillingType .MonthSel').addClass("Selected").click();
     $('.BillingType .YearSel').removeClass("Selected");
     $('#SignUp.Plans .BillingType.'+temp).show();
     temp=temp.toLowerCase();
     $('.Form form').attr('action','https://www.remotedirector.com/signup/step_2/'+temp+'/'+userID);
}).hover(
function(){ $(this).not('.Selected').find('.Nan').show().css('display','block');  },
function(){ $(this).find('.Nan').hide(); }

); 


$('#SignUp.Plans .BillingType .Item').click( function() {  
    $(this).siblings().removeClass("Selected");
    $(this).addClass("Selected"); 
     $(this).find('.Nan').hide(); 
    var temp = $(this).attr('title');
     $('#SignUp.Plans .PaySelect').val(temp);
     temp=temp.toLowerCase();
    
}).hover(
function(){ $(this).not('.Selected').find('.Nan').show().css('display','block');  },
function(){ $(this).find('.Nan').hide(); }

); 

$('.Form form').validate();

$(".Form").validate({
   rules: {
    email: {
       required: true,
       email: true
     },
     firstName: "required",
     lastName: "required"
     // compound rule
 
     
   },
   messages: {
     email: {  required: "", email: "" },
     firstName: {  required: "" },
     lastName: {  required: "" }      
   },
      highlight: function(element, errorClass, validClass) {
     $(element.id).addClass(errorClass).removeClass(validClass);
    
  },
  unhighlight: function(element, errorClass, validClass) {
     $(element.id).removeClass(errorClass).addClass(validClass);

  }
});


 
$('#SignUp.Plans .Text .Button').click(function() {  
    $('.Form form').submit();
    return false;
}); 






});



