jQuery.noConflict(); jQuery(document).ready(function($) { $('a[rel=external]').click(function() { open(this.href); return false; }); $('#rotatingLogos ul').innerfade( { speed: 2000, timeout: 6000, type: 'sequence', containerheight: '154px' }); // show the correct menu var backgrounds = '#mainBackgrounds'; var url = location.href; if (url.match(/\/golf\//)) { $('#golf').show(); backgrounds = '#golfBackgrounds'; $('#main').hide(); } else if (url.match(/\/weddings\//)) { $('#weddings').show(); backgrounds = '#weddingsBackgrounds'; $('#main').hide(); // gallery page $('#galleryBox').each(function() { $(this).insertAfter('#weddingsBackgrounds'); $('#weddingBackgrounds').remove(); backgrounds = ''; }); } else if (url.match(/\/corporate\//)) { $('#corporate').show(); backgrounds = '#corporateBackgrounds'; $('#main').hide(); } // backgrounds $(backgrounds).show().innerfade( { speed: 2000, timeout: 5000, type: 'sequence', containerheight: '329px' }); // animate the menu changes $('#menu a[rel]').click(function() { var width = 454; var duration = 1500; var easing = 'swing'; // linear var href = this.href; var menu = $('#menu ul:visible'); var newMenu = $('#'+this.rel); if (menu.get(0).id == this.rel) { return true;} // is already open $('#homeSquare').animate( { left: '+='+width+'px' }, duration, easing, function() { if (menu) { menu.hide();} if (newMenu) { newMenu.show();} $('#homeSquare').animate( { left: '-='+width+'px' }, duration, easing, function() { location.href = href; }); }); return false; }); });