// Functions // Rotating Fade Function (function($){ ShowNextItem = function(Slide,Previous) { if(Previous) { if($(Slide+'.active').is($(Slide).first())) { NextSlide = $(Slide).last(); } else { NextSlide = $(Slide+'.active').prev(); } } else { if($(Slide+'.active').is($(Slide).last())) { NextSlide = $(Slide).first(); } else { NextSlide = $(Slide+'.active').next(); } } $(Slide+'.active').stop().fadeTo(500, 0.0, function() { $(this).css('display','none'); $(this).removeClass('active'); }); NextSlide.stop().fadeTo(500, 1.0); NextSlide.addClass('active'); }; })(jQuery); // CUSTOM Text Input Watermark & Form Validation (function($){ ValidateForm = function(Form) { var Elements = Form + ' input[type=text], ' + Form + ' input[type=password], ' + Form + ' input[type=checkbox], ' + Form + ' textarea'; $('body').on('submit',Form,function(event) { var NumberOfErrors = 0; $(Elements).each(function() { if($(this).hasClass('optional')) { $(this).addClass('valid'); } else { if($(this).is(':checkbox')) { if($(this).is(':checked')) { $(this).addClass('valid'); $(this).removeClass('error'); } else { $(this).addClass('error'); event.preventDefault(); } } else if($(this).val() == $(this).attr('title') || $(this).val() == '') { $(this).val($(this).attr('title')); $(this).addClass('error'); event.preventDefault(); } else { $(this).addClass('valid'); $(this).removeClass('error'); } if($(this).hasClass('error')) { NumberOfErrors++ } } if(NumberOfErrors == 0 && $(this).val() == $(this).attr('title')) { $('.optional').val(''); } }); }); } })(jQuery); // Set Values From Title Function (function($){ ApplyFieldTitles = function(Form) { var Elements = Form + ' input[type=text], ' + Form + ' input[type=password], ' + Form + ' textarea'; $(Elements).each(function() { if($(this).val() == '') { $(this).val($(this).attr('title')); } if($(this).attr('type') == 'password') { $(this).get(0).type='text'; $(this).addClass('passwordfield'); } }); // Remove Values If Default Values $('body').on('focus',Elements,function () { if($(this).val() == $(this).attr('title')) { $(this).val(''); } if($(this).hasClass('passwordfield')) { $(this).get(0).type='password'; } }); // Replace Values If Empty $('body').on('blur',Elements,function () { if($(this).val() == '') { if($(this).hasClass('optional')) { $(this).addClass('valid'); $(this).val($(this).attr('title')); } else { $(this).val($(this).attr('title')); $(this).addClass('error'); $(this).removeClass('valid'); if($(this).attr('type') == 'password') { $(this).get(0).type='text'; } } } else { $(this).addClass('valid'); $(this).removeClass('error'); } }); } })(jQuery); // START OF $(document).ready(function() { $(document).ready(function() { var Forms = new Array('.ContactForm','.login'); // General Stuff $('.main ul li:nth-child(even)').addClass('alternate'); // Dropdown Menu $('.nav .dropdown').hover(function(){ var NewHeight = 0; $(this).children().children().each(function(){ NewHeight = NewHeight + $(this).outerHeight(); }); $('div',this).stop().animate({ 'height': '350px' },500); }, function() { $('div',this).stop().animate({ 'height': '0px' },500); }); // Rotating Header $('.rotating a.prev').click(function() { ShowNextItem('ul.rotating li',true); }); $('.rotating a.next').click(function() { ShowNextItem('ul.rotating li'); }); RotatingHeaderLoop = window.setInterval ( function() { ShowNextItem('ul.rotating li'); }, 4000); $('div.rotating').hover(function(){ window.clearInterval(RotatingHeaderLoop); }, function() { RotatingHeaderLoop = window.setInterval ( function() { ShowNextItem('ul.rotating li'); }, 4000); }); // News Feed $('.news-feed .arrow.prev').click(function() { ShowNextItem('.news-feed div',true); }); $('.news-feed .arrow.next').click(function() { ShowNextItem('.news-feed div'); }); $.each(Forms, function( index, value ) { ValidateForm(value); ApplyFieldTitles(value); }); // END - CUSTOM Text Input Watermark & Form Validation //$('.items-feed a.arrow.prev').click(function() { // ShowNextItem('.'+$(this).parent().attr('class').replace(' ','.')+' .items-feed-scroller div',true); // }); // // $('.items-feed a.arrow.next').click(function() { // ShowNextItem('.'+$(this).parent().attr('class').replace(' ','.')+' .items-feed-scroller div'); // }); // // Logos Scroller var NewsCounter = 0; var NewsAnimateTimes = $('.news a').size() - 9; $('.news > a').click(function() { if($(this).hasClass('prev')) { if(NewsCounter > 0) { $('.news > div').animate({'marginTop':'+=170'},300); NewsCounter--; } } else { if(NewsAnimateTimes > NewsCounter) { $('.news > div').animate({'marginTop':'-=170'},300); NewsCounter++; } } }); // END OF $(document).ready(function() { }); $(document).ready(function() { $(".sizeUp").click(function() { $(".main-text").css({"font-size":"90%","line-height":"28px"}); }); $(".normal").click(function() { $(".main-text").css({"font-size":"80%","line-height":"24px"}); }) $(".sizeDown").click(function() { $(".main-text").css({"font-size":"70%","line-height":"20px"}); }) }); jQuery(document).ready(function() { // Custom Lightbox function PlaceCloseButton() { var ImgLeftMargin = ('-'+jQuery('div.lightbox img').width() / 2) - 7; var ImgTopMargin = ('-'+jQuery('div.lightbox img').height() / 2) - 7; jQuery('div.lightbox .close').css('margin-right',ImgLeftMargin+'px'); jQuery('div.lightbox .close').css('margin-top',ImgTopMargin+'px'); if(jQuery('.caption').size()) { jQuery('.caption').css('height',jQuery('div.lightbox img').height() - 30); var CaptionWidth = (800 - jQuery('div.lightbox img').width()) - 30; jQuery('.caption').css('width',CaptionWidth); jQuery('.caption').css('margin-top','-'+(jQuery('div.lightbox img').height()/2)+'px'); jQuery('.caption').css('margin-left',(400-CaptionWidth)+'px'); jQuery('.lightbox').css('margin-left','-'+(CaptionWidth/2)+'px'); } } jQuery('body').on('click','.lightbox-link, a.lightbox',function(event) { jQuery('object').css('display','none'); if(jQuery(this).is('img')) { var ImageURL = jQuery(this).attr('src').replace('-small.jpg','.jpg'); } else { event.preventDefault(); var ImageURL = jQuery(this).attr('href'); } jQuery(this).addClass('active'); jQuery(this).siblings().removeClass('active'); if (jQuery('div.lightbox').length) { // IF LIGHTBOX ALREADY EXISTS FADE IT OUT AND REMOVE IT jQuery('div.lightbox').fadeTo(300, 0.0, function() { jQuery(this).remove(); }); } else { jQuery('body').append('
'); if(jQuery(this).siblings(jQuery(this).get(0).tagName).size()) { jQuery('body').append('Strength: Very Weak
'); } else if(total == 1.5 || total == 2){ thismeter.removeClass(); thismeter.addClass('weak').html('Strength: Weak
'); } else if(total == 2.5 || total == 3 || total == 3.5){ thismeter.removeClass(); thismeter.addClass('medium').html('Strength: Medium
'); } else if(total > 3.5 && total < 5){ thismeter.removeClass(); thismeter.addClass('strong').html('Strength: Strong
'); } else if(total == 5 || total > 5) { thismeter.removeClass(); thismeter.addClass('verystrong').html('Strength: Very Strong
'); } if(total < 4 && total != 0) { thismeter.siblings('input').remove(); thismeter.after(''); } else { thismeter.siblings('input').remove(); } console.log(total); } var isShown = false; var strengthButtonText = this.options.strengthButtonText; var strengthButtonTextToggle = this.options.strengthButtonTextToggle; thisid = this.$elem.attr('id'); this.$elem.addClass(this.options.strengthClass).attr('data-password',thisid).after(''+this.options.strengthButtonText+''); this.$elem.bind('keyup keydown', function(event) { $('.strength_meter div').removeAttr('class'); $('.strength_meter div p').remove(); thisval = $('#'+thisid).val(); $('input[type="text"][data-password="'+thisid+'"]').val(thisval); check_strength(thisval,thisid); }); $('input[type="text"][data-password="'+thisid+'"]').bind('keyup keydown', function(event) { thisval = $('input[type="text"][data-password="'+thisid+'"]').val(); console.log(thisval); $('input[type="password"][data-password="'+thisid+'"]').val(thisval); check_strength(thisval,thisid); }); $(document.body).on('click', '.'+this.options.strengthButtonClass, function(e) { e.preventDefault(); if($('input#'+thisid).val() != $('input#'+thisid).attr('title')) { thisclass = 'hide_'+$(this).attr('class'); if (isShown) { $('input[type="text"][data-password="'+thisid+'"]').hide(); $('input[type="password"][data-password="'+thisid+'"]').show().focus(); $('a[data-password-button="'+thisid+'"]').removeClass(thisclass).html(strengthButtonText); isShown = false; } else { $('input[type="text"][data-password="'+thisid+'"]').show().focus(); $('input[type="password"][data-password="'+thisid+'"]').hide(); $('a[data-password-button="'+thisid+'"]').addClass(thisclass).html(strengthButtonTextToggle); isShown = true; } } }); }, yourOtherFunction: function(el, options) { // some logic } }; // A really lightweight plugin wrapper around the constructor, // preventing against multiple instantiations $.fn[pluginName] = function ( options ) { return this.each(function () { if (!$.data(this, "plugin_" + pluginName)) { $.data(this, "plugin_" + pluginName, new Plugin( this, options )); } }); }; })( jQuery, window, document ); $(document).ready(function(){ $('#setpassword').strength({ strengthClass: 'strength', strengthMeterClass: 'strength_meter', strengthButtonClass: 'button_strength', strengthButtonText: 'Show Password', strengthButtonTextToggle: 'Hide Password' }); }); (function($){ PlaceCloseButton = function() { var ImgLeftMargin = ('-'+$('div.lightbox img').width() / 2) - 7; var ImgTopMargin = ('-'+$('div.lightbox img').height() / 2) - 7; $('div.lightbox .close').css('margin-right',ImgLeftMargin+'px'); $('div.lightbox .close').css('margin-top',ImgTopMargin+'px'); if($('.lightbox .caption').size()) { $('.lightbox .caption').css('height',$('div.lightbox img').height() - 30); var CaptionWidth = (900 - $('div.lightbox img').width()) - 30; $('.lightbox .caption').css('width',CaptionWidth); $('.lightbox .caption').css('margin-top','-'+($('div.lightbox img').height()/2)+'px'); $('.lightbox .caption').css('margin-left',(450-CaptionWidth)+'px'); $('.lightbox').css('margin-left','-'+(CaptionWidth/2)+'px'); } } })(jQuery); // START OF $(document).ready(function() { $(document).ready(function() { // Custom Lightbox $('body').on('click','.photogallery-list a,.lightbox-link',function(event) { if($(this).is('img')) { var ImageURL = $(this).attr('src').replace('-small',''); var ImageURL = $(this).attr('src').replace('/small/','/'); var ImageURL = $(this).attr('src').replace('/thumb/','/'); } else { event.preventDefault(); var ImageURL = $(this).attr('href'); } $(this).addClass('active'); $(this).siblings().removeClass('active'); if ($('div.lightbox').length) { // IF LIGHTBOX ALREADY EXISTS FADE IT OUT AND REMOVE IT $('div.lightbox').fadeTo(300, 0.0, function() { $(this).remove(); }); } else { $('body').append(''); if($(this).siblings($(this).get(0).tagName).size()) { $('body').append('