var OSTOMY = {};

OSTOMY.Nav = function() {
 
  var self = this;
  self.navElem = $('#nav > ul');
  self.navElem.find('li:has(ul)').addClass('parent');
  self.navElem.droppy({speed: 10});
  
};
//login form behaviors
OSTOMY.LoginForm = function () {
   
    var userName = $('input.SecureSiteUserName');
    var passWord = $('input.SecureSitePassword');
    var nameValue = $('input.SecureSiteUserName').val('');
    var passwordValue = $('input.SecureSitePassword').val('');
    if($(nameValue).val() == '') {   // check if input value is empty
        $(userName).focus( function() {
            $(this).parent('div').children('span').hide(); //if so, hide span tag
        });
    }
    $(userName).blur( function() {
        if($(nameValue).val() == '') {
            $(this).parent('div').children('span').show();
        }
    });
    if($(passwordValue).val() == '') {
        $(passWord).focus( function() {
            $(this).parent('div').children('span').hide();
        });
    }
    $(passWord).blur( function() {
        if($(passwordValue).val() == '') {
            $(this).parent('div').children('span').show();
        }
    });
    if ($('.SecureSiteLoginForm').length > 0){
      $('<div id="loginCta">[+] Click to Login</div>').insertAfter('#forgot');
    
      $('#loginCta').click( function() {
            $('.SecureSiteLoginForm').toggle();
            $('#forgot').toggle();
            $(this).toggleClass('x');
      });
     }  
    
};
//content behaviors
OSTOMY.ContentEffects = function() {

  $('#content p:first').addClass('lead');

};
//dom ready
$(function(){
  
  OSTOMY.Nav(); 
  OSTOMY.LoginForm();
  OSTOMY.ContentEffects();  
  
});

