// 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(''); } } if (jQuery(this).attr('title')) { if(jQuery(this).is('img')) { var Title = '

'+ jQuery(this).attr('alt') +'

'; } else { var Title = ''; } var Caption = '
' + Title + jQuery(this).attr('title').replace(/---/g,'

') +'
'; } else { var Caption = ''; } jQuery('body').append(''); jQuery('div.lightbox img').fadeTo(1000, 0.0, // FADE OUT ALREADY HIDDEN IMG TO ALLOW IMG TO BE LOADED FULLY function() { jQuery('div.lightbox').fadeTo(400, 1.0); jQuery('div.overlay').fadeTo(400, 0.5); if(jQuery(window).height() > jQuery('div.lightbox img.original').height()) { jQuery('div.lightbox').css('background-size','auto'); } PlaceCloseButton(); }); }); jQuery('body').on('click','.close',function() { jQuery('object').css('display','block'); jQuery('.lightbox').fadeTo(300, 0.0, function() { jQuery(this).remove(); }); jQuery('.lightbox-thumbs').fadeTo(300, 0.0, function() { jQuery(this).remove(); }); jQuery('.overlay').fadeTo(300, 0.0, function() { jQuery(this).remove(); }); }); jQuery(window).resize(function() { if(jQuery(window).height() > jQuery('div.lightbox img.original').height()) { jQuery('div.lightbox').css('background-size','auto'); jQuery('div.lightbox img.source').removeAttr('style'); jQuery('div.lightbox-thumbs').css('display','block'); PlaceCloseButton(); } else { jQuery('div.lightbox').css('background-size','auto 75%'); jQuery('div.lightbox img.source').css('height','75%'); jQuery('div.lightbox-thumbs').css('display','none'); PlaceCloseButton(); } }); // End Custom Lightbox // Social Feed Slide jQuery('body').on('click','.social-feed a.tab',function(){ if(jQuery(this).parent().hasClass('onLeft')) { var Position = 'left'; } if(jQuery(this).parent().hasClass('onRight')) { var Position = 'right'; } var AnimateParams = {}; if (jQuery(this).parent().css(Position) == '0px') { AnimateParams[Position] = "-240px";} else { AnimateParams[Position] = "0px";} jQuery(this).parent().stop().animate(AnimateParams,400); }); // End Social Feed Slide });if(Tablets) { // Mobile & Tablet Redirect (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego|android|ipad|playbook|silk).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera); } else { // Mobile Only Redirect (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera); } // START OF $(document).ready(function() { if(window.location.search.indexOf("redirect") > -1) { var ExpiryDate = new Date(); ExpiryDate.setTime(ExpiryDate.getTime()+(900*1000)); // Set Expiry To 15 Minutes Later var ExpiryTime = ExpiryDate.toGMTString(); document.cookie = "Redirect=False; expires="+ExpiryTime+";"; } if(document.cookie.indexOf("Redirect=False") == -1) { if(jQuery.browser.mobile) { window.location.href = window.location.href.replace('http://','http://m.'); } }$(document).ready(function() { ValidateForm('form.testimonials'); ApplyFieldTitles('form.testimonials'); });/*! * strength.js * Original author: @aaronlumsden * Further changes, comments: @aaronlumsden * Licensed under the MIT license */ ;(function ( $, window, document, undefined ) { var pluginName = "strength", defaults = { strengthClass: 'strength', strengthMeterClass: 'strength_meter', strengthButtonClass: 'button_strength', strengthButtonText: 'Show Password', strengthButtonTextToggle: 'Hide Password' }; // $('').appendTo('head'); function Plugin( element, options ) { this.element = element; this.$elem = $(this.element); this.options = $.extend( {}, defaults, options ); this._defaults = defaults; this._name = pluginName; this.init(); } Plugin.prototype = { init: function() { var characters = 0; var capitalletters = 0; var loweletters = 0; var number = 0; var special = 0; var upperCase = new RegExp('[A-Z]'); var lowerCase = new RegExp('[a-z]'); var numbers = new RegExp('[0-9]'); var specialchars = new RegExp('([`,~,!,@,#,$,%,^,&,*,(,),_,-,+,=,{,},\\\\,|,:,;,",\',<,>,(,),.,?,/])'); function GetPercentage(a, b) { return ((b / a) * 100); } function check_strength(thisval,thisid){ if (thisval.length > 8) { characters = 1; } else { characters = 0; }; if (thisval.length > 12) { charactersbonus = 1; } else { charactersbonus = 0; }; if (thisval.match(upperCase)) { capitalletters = 1; } else { capitalletters = 0; }; if (thisval.match(lowerCase)) { loweletters = 0.5} else { loweletters = 0; }; if (thisval.match(numbers)) { number = 1} else { number = 0; }; if (thisval.match(specialchars)) { special = 1} else { special = 0; }; var total = characters + charactersbonus + capitalletters + loweletters + number + special; var totalpercent = GetPercentage(7, total).toFixed(0); get_total(total,thisid); } function get_total(total,thisid){ var thismeter = $('div[data-meter="'+thisid+'"]'); if(total == 0){ thismeter.removeClass().html(''); } else if(total <= 1) { thismeter.removeClass(); thismeter.addClass('veryweak').html('

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(''); } } if ($(this).attr('title')) { if($(this).is('img')) { var Title = '

'+ $(this).attr('alt') +'

'; } else { var Title = ''; } var Caption = '
' + Title + $(this).attr('title').replace(/---/g,'

') +'
'; } else { var Caption = ''; } $('body').append(''); $('div.lightbox img').fadeTo(1000, 0.0, // FADE OUT ALREADY HIDDEN IMG TO ALLOW IMG TO BE LOADED FULLY function() { $('div.lightbox').fadeTo(400, 1.0); $('div.overlay').fadeTo(400, 0.5); if($(window).height() > $('div.lightbox img.original').height()) { $('div.lightbox').css('background-size','auto'); } PlaceCloseButton(); }); }); $('body').on('click','.close, .exit',function() { $(this).parent().fadeTo(300, 0.0, function() { $(this).remove(); }); $('.lightbox').fadeTo(300, 0.0, function() { $(this).remove(); }); $('.lightbox-thumbs').fadeTo(300, 0.0, function() { $(this).remove(); }); $('.overlay').fadeTo(300, 0.0, function() { $(this).remove(); }); }); $(window).resize(function() { if($(window).height() > $('div.lightbox img.original').height()) { $('div.lightbox').css('background-size','auto'); $('div.lightbox img.source').removeAttr('style'); $('div.lightbox-thumbs').css('display','block'); PlaceCloseButton(); } else { $('div.lightbox').css('background-size','auto 75%'); $('div.lightbox img.source').css('height','75%'); $('div.lightbox-thumbs').css('display','none'); PlaceCloseButton(); } }); // End Custom Lightbox });