1jQuery.noConflict(); 2jQuery(function($) { 3 4 5 6 7 8 /* Drop Down Menu (superfish + hoverintent + supersubs) 9 ___________________________________________________________________ */ 10 // http://users.tpg.com.au/j_birch/plugins/superfish/#getting-started 11 // http://users.tpg.com.au/j_birch/plugins/superfish/#options 12 $(".sf-menu").supersubs({ 13 minWidth: 12, // minimum width of sub-menus in em units 14 maxWidth: 27, // maximum width of sub-menus in em units 15 extraWidth: 1 // extra width can ensure lines don't sometimes turn over 16 // due to slight rounding differences and font-family 17 }).superfish({ 18 dropShadows: false, 19 delay: 400 20 21 }); // call supersubs first, then superfish, so that subs are 22 // not display:none when measuring. Call before initialising 23 // containing tabs for same reason. 24 25 26 27 28 /* Scroll to top animation 29 ___________________________________________________________________ */ 30 $('.scroll-top').click(function(){ 31 $('html, body').animate({scrollTop:0}, 600); return false; 32 }); 33 34 35 36 37 /* Hide parent on click (error messages, etc...) 38 ___________________________________________________________________ */ 39 $('a.hideparent').click(function(){ 40 $(this).parent().fadeOut(); 41 return false; 42 }); 43 44 45 46 47 /* Menu Hover Indent 48 ___________________________________________________________________ */ 49 var sf_hover_sel = $(".sf-menu ul a"); 50 var sf_link_padding = parseInt(sf_hover_sel.css('padding-left')); 51 var sf_hover_offset = 2 + sf_link_padding; 52 $(sf_hover_sel).hover( 53 function () { 54 $(this).stop().animate({"padding-left": sf_hover_offset + "px"}, 75); 55 }, 56 function () { 57 $(this).stop().animate({"padding-left": sf_link_padding + "px"}, 250); 58 } 59 ); 60 61 62 63 64 /* Fade Hover 65 ___________________________________________________________________ */ 66 67 if ( ! $.browser.msie ) { 68 $(".social-icon").stop().fadeTo("fast", .4); 69 $(".social-icon").hover( 70 function(){ 71 $(this).stop().fadeTo("fast", .6); 72 }, 73 function(){ 74 $(this).stop().fadeTo("fast", .4); 75 } 76 ); 77 78 // Any link to an image, fade on hover 79 $('a img').hover( 80 function(){ $(this).stop().animate({ opacity : '.85' }); }, 81 function(){ $(this).stop().animate({ opacity : '1' }); } 82 ); 83 } else { 84 // IE, do nothing 85 } 86 87 88 89 90 /* Contact Form Validation 91 ___________________________________________________________________ */ 92 93 var hasChecked = false; 94 $(".standard #cf_submit").click(function () { 95 hasChecked = true; 96 return checkForm(); 97 }); 98 $(".standard #cf_name,.standard #cf_email,.standard #cf_message").live('change click', function(){ 99 if(hasChecked == true) { 100 return checkForm(); 101 } 102 }); 103 function checkForm() { 104 var hasError = false; 105 var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; 106 if($(".standard #cf_name").val() == '') { 107 $("#cf_name").addClass('error'); 108 hasError = true; 109 }else{ 110 $("#cf_name").removeClass('error'); 111 } 112 if($("#cf_email").val() == '') { 113 $("#cf_email").addClass('error'); 114 hasError = true; 115 }else if(!emailReg.test( $("#cf_email").val() )) { 116 $("#cf_email").addClass('error'); 117 hasError = true; 118 }else{ 119 $("#cf_email").removeClass('error'); 120 } 121 if($("#cf_message").val() == '') { 122 $("#cf_message").addClass('error'); 123 hasError = true; 124 }else{ 125 $("#cf_message").removeClass('error'); 126 } 127 if(hasError == true){ 128 return false; 129 }else{ 130 return true; 131 } 132 } 133 // end contact form validation 134 135 136 137}); // end jQuery
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.