$(document).ready(function() { /* new masthead */ $('div.close').click(function() { $('div.login-wrapper-open').addClass('login-wrapper-close').removeClass('login-wrapper-open'); }); $('li.log-in a').click(function(e) { e.preventDefault(); if ($('div.login-wrapper-close').length) { $('div.login-wrapper-close').addClass('login-wrapper-open').removeClass('login-wrapper-close'); }else{ $('div.login-wrapper-open').addClass('login-wrapper-close').removeClass('login-wrapper-open'); } }); $('#header-search input#qr').focus(function() { if ($(this).val() == 'Search') { $(this).val(''); } }); $('#header-search input#qr').blur(function() { if ($(this).val().length < '1') { $(this).val('Search'); } }); /* focusPassword(); $('input#header-email').focus(function() { if($('input#header-email').val() == 'Username') { $('input#header-email').val('').addClass("input-text-changed"); } }); $('input#header-email').blur(function() { if($('input#header-email').val() == '') { $('input#header-email').val('Username').removeClass("input-text-changed"); } }); $('input#login-submit').click(function(e) { e.preventDefault(); if (($('input#header-email').attr('class') == 'input-text input-text-changed') && ($('input#PASSWORD').length)){ $('#loginform').submit(); }else{ $("label.username").before("
Please provide the required information
"); if (($('input#header-email').attr('class') != 'input-text input-text-changed') || ($('input#header-email').val == '') ) $('input#header-email').css("border", "1px solid #ff0000"); else{ $('input#header-email').css("border", "1px solid #cccccc"); } if (!$('input#PASSWORD').length){ $('input#fake-password').css("border", "1px solid #ff0000"); } else{ $('input#fake-password').css("border", "1px solid #cccccc"); } if ($('input#PASSWORD').val == ''){ $('input#PASSWORD').css("border", "1px solid #ff0000"); } else{ $('input#PASSWORD').css("border", "1px solid #cccccc"); } } }); */ }); /* function focusPassword(){ $('input#fake-password').focus(function() { $('input#fake-password').remove(); $("label.password").after(""); $('input#PASSWORD').focus().addClass("input-text-changed"); if ($('p.form-error').length){ $('input#PASSWORD').css("border", "1px solid #ff0000"); } blurPassword(); }); } function blurPassword(){ $('input#PASSWORD').blur(function() { if($('input#PASSWORD').val() == ''){ $('input#PASSWORD').remove(); $("label.password").after(" "); if ($('p.form-error').length){ $('input#fake-password').css("border", "1px solid #ff0000"); } } focusPassword(); }); } */