var slideShow = new Array(); slideShow[0] = '/wp-content/themes/vca/images/slideshow/home/OneClickScheduling.jpg'; slideShow[1] = '/wp-content/themes/vca/images/slideshow/home/2YrWarranty.jpg'; slideShow[2] = '/wp-content/themes/vca/images/slideshow/home/OpticalDispensary.jpg'; slideShow[3] = '/wp-content/themes/vca/images/slideshow/home/Optos.jpg'; slideShow[4] = '/wp-content/themes/vca/images/slideshow/home/Varilux.jpg'; slideShow[5] = '/wp-content/themes/vca/images/slideshow/home/HistoricalBuilding.jpg'; var slideShowLinks = new Array(); slideShowLinks[0] = '/appointment/'; slideShowLinks[1] = '/gallery/warranty/'; slideShowLinks[2] = '/experience/new/'; slideShowLinks[3] = '/library/technology/'; slideShowLinks[4] = '/gallery/lens/'; slideShowLinks[5] = '/experience/office/'; jQuery(document).ready(function($) { $('#footer li.clear').prepend('
'); //Preserves the mouse-over on top-level menu elements when hovering over children $("#menu ul").each(function(i){ $(this).hover(function(){ $(this).parent().find("a").slice(0,1).addClass("active"); },function(){ $(this).parent().find("a").slice(0,1).removeClass("active"); }); }); // IE6 Fix: Drop-down fix due to lack of support for :hover on list elements if($.browser.msie && ($.browser.version < 7)) { $("#menu").each(function(i){ $(this).find("li").hover(function(){ $(this).addClass("sfhover"); },function(){ $(this).removeClass("sfhover"); }); }); } $("a[href^='http:']:not([href*='" + window.location.host + "'][target='_blank'])").live('click', function(){ $(this).attr('target','_blank'); }); if ($('.page-id-45 #vca_swf_replacement').length!=0) { $('.page-id-45 #vca_swf_replacement').flash( { src: '/wp-content/themes/vca/media/VCAFrameGallery.swf', width: 775, height: 340, wmode: 'transparent' }, { version: 9 } ); } if ($('.page-id-39 #vca_swf_replacement').length!=0) { $('.page-id-39 #vca_swf_replacement').flash( { src: '/wp-content/themes/vca/media/myLife.swf', width: 775, height: 340, wmode: 'transparent' }, { version: 9 } ); } if ($('#column-right div').length!=0) { processSlideshow('#column-right div',slideShow,4000,1000,,slideShowLinks); } if (($('.page-id-22 ul.gallery').length!=0) || ($('.page-id-29 ul.gallery').length!=0)){ $('.page-id-22 ul.gallery, .page-id-29 ul.gallery').galleria({ history : true, clickNext : true, insert : '#main_image', onImage : function(image,caption,thumb) { // let's add some image effects for demonstration purposes // fade in the image & caption if(! ($.browser.mozilla && navigator.appVersion.indexOf("Win")!=-1) ) { // FF/Win fades large images terribly slow image.css('display','none').fadeIn(1000); } //caption.css('display','none').fadeIn(1000); // fetch the thumbnail container var _li = thumb.parents('li'); // fade out inactive thumbnail _li.siblings().children('img.selected').fadeTo(500,0.3); // fade in active thumbnail thumb.fadeTo('fast',1).addClass('selected'); // add a title for the clickable image image.attr('title','Next image >>'); }, onThumb : function(thumb) { // thumbnail effects goes here // fetch the thumbnail container var _li = thumb.parents('li'); // if thumbnail is active, fade all the way. var _fadeTo = _li.is('.active') ? '1' : '0.3'; // fade in the thumbnail when finnished loading thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500); // hover effects thumb.hover( function() { thumb.fadeTo('fast',1); }, function() { _li.not('.active').children('img').fadeTo('fast',0.3); } // don't fade out if the parent is active ) } }).css('display','block'); } if ($('.page-id-56 #status_search').length!=0) { $('input#status_search').quicksearch('table#status_table tbody tr', { 'selector': 'td:first', 'stripeRows': ['odd', 'even'], 'noResults': 'tr#noresults' }); } }); function processSlideshow(elem,imageList,imageDuration,fadeSpeed,current,links) { var listSize = imageList.length; if (!current || current >= listSize) current = 0; if (!imageDuration) imageDuration = 2000; if (!fadeSpeed) fadeSpeed = 1000; jQuery(elem + " img").attr("src", imageList[current]); if (current == (listSize - 1)) { jQuery(elem).css("background", "transparent url(" + imageList[0] + ") no-repeat"); } else { jQuery(elem).css("background", "transparent url(" + imageList[current + 1] + ") no-repeat"); } jQuery(elem + " img").animate({ opacity: "1" }, imageDuration). animate({ opacity: "0.01" }, fadeSpeed, function() { var isLink = (links[current + 1]!=null?1:0); jQuery(this).css('opacity','1').parent().attr('href',links[isLink?current + 1:0]); processSlideshow(elem, imageList, imageDuration, fadeSpeed, current + 1,links); }); }