;(function($){var $$;$$=$.fn.galleria=function($options){if(!$$.hasCSS()){return false;} $.historyInit($$.onPageLoad);var $defaults={insert:'.galleria_container',history:true,clickNext:true,onImage:function(image,caption,description,thumb){},onThumb:function(thumb){}};var $opts=$.extend($defaults,$options);for(var i in $opts){$.galleria[i]=$opts[i];} var _insert=($($opts.insert).is($opts.insert))?$($opts.insert):jQuery(document.createElement('div')).insertBefore(this);var _div=$(document.createElement('div')).addClass('galleria_wrapper');var _span=$(document.createElement('div')).addClass('caption');var _caption_title_span=$(document.createElement('div')).addClass('caption_title');_insert.addClass('galleria_container').append(_div).append(_span);jQuery(_caption_title_span).insertBefore(_span);_caption_title_span.css('cursor','pointer').click(function(){currentCounerForLinks=(currentCounerForLinks==0)?images.length:currentCounerForLinks;var localImageCounter=currentCounerForLinks-1;var url=images[localImageCounter][1];if(url&&url!=""&&url!=undefined){switch(images[localImageCounter][4]){case 0:location.href=url;break;case 1:location.href=url;break;case 2:window.open(url);break;case'3':window.open(url,"newPopUp","menubar=1,resizable=1,width="+images[localImageCounter][5]+",height="+images[localImageCounter][6]);break;case'4':try{window.frames[images[localImageCounter][7]].location=url;}catch(e){location.href=url;} break;default:location.href=url;}}else{clearTimeout(clearVar);clearTimeout(timeOutReturnVarForClear);rotateGalleryForLinks();}}) return this.each(function(){$(this).addClass('galleria');$(this).children('li').each(function(i){var _container=$(this);var _o=$.meta?$.extend({},$opts,_container.data()):$opts;_o.clickNext=$(this).is(':only-child')?false:_o.clickNext;var _a=$(this).find('a').is('a')?$(this).find('a'):false;var _img=$(this).children('img').css('display','none');var _src=_a?_a.attr('href'):_img.attr('src');var _title=_a?_a.attr('title'):_img.attr('title');var _loader=new Image();if(_o.history&&(window.location.hash&&window.location.hash.replace(/\#/,'')==_src)){_container.siblings('.active').removeClass('active');_container.addClass('active');} $(_loader).load(function(){$(this).attr('alt',_img.attr('alt'));var _thumb=_a?_a.find('img').addClass('thumb noscale').css('display','none'):_img.clone(true).addClass('thumb').css('display','none');if(_a){_a.replaceWith(_thumb);} if(!_thumb.hasClass('noscale')){var w=Math.ceil(_img.width()/_img.height()*_container.height());var h=Math.ceil(_img.height()/_img.width()*_container.width());if(wError loading image: '+_src+'');}).attr('src',_src);});});};$$.nextSelector=function(selector){return $(selector).is(':last-child')?$(selector).siblings(':first-child'):$(selector).next();};$$.previousSelector=function(selector){return $(selector).is(':first-child')?$(selector).siblings(':last-child'):$(selector).prev();};$$.hasCSS=function(){$('body').append($(document.createElement('div')).attr('id','css_test').css({width:'1px',height:'1px',display:'none'}));var _v=($('#css_test').width()!=1)?false:true;$('#css_test').remove();return _v;};$$.onPageLoad=function(_src){var _wrapper=$('.galleria_wrapper');var caption=$('.caption');var caption_title=$('.caption_title');var _thumb=$('.galleria img[rel="'+_src+'"]');if(_src){if($.galleria.history){window.location=window.location.href.replace(/\#.*/,'')+'#'+_src;} _thumb.parents('li').siblings('.active').removeClass('active');_thumb.parents('li').addClass('active');var _img=$(new Image()).attr('src',_src).addClass('replaced');_wrapper.empty().append(_img);var imageDescriptionMediaFlipperBox=(_thumb.attr('description')==undefined)?"":_thumb.attr('description');_wrapper.siblings('.caption').html(imageDescriptionMediaFlipperBox);var current_image_index=_thumb.attr('imageIndex');_wrapper.siblings('.caption_title').html(images[current_image_index][2]);$.galleria.onImage(_img,_wrapper.siblings('.caption'),_wrapper.siblings('.caption_title'),_thumb);if($.galleria.clickNext){_img.css('cursor','pointer').click(function(){var url=_thumb.attr('full');if(url&&url!=""&&url!=undefined){switch(_thumb.attr('linkop')){case'0':location.href=url;break;case'1':location.href=url;break;case'2':window.open(url);break;case'3':window.open(url,"newPopUp","menubar=1,resizable=1,width="+_thumb.attr('widthOfWindow')+",height="+_thumb.attr('heightOfWindow'));break;case'4':try{window.frames[_thumb.attr('iframeNameOfWindow')].location=url;}catch(e){location.href=url;} break;default:location.href=url;}}else{clearTimeout(clearVar);clearTimeout(timeOutReturnVarForClear);rotateGalleryForLinks()}})}}else{_wrapper.siblings().andSelf().empty();$('.galleria li.active').removeClass('active');} $.galleria.current=_src;} $.extend({galleria:{current:'',onImage:function(){},activate:function(_src){if($.galleria.history){$.historyLoad(_src);}else{$$.onPageLoad(_src);}},next:function(){var max_elem=Math.min((current_page_index+1)*items_per_page,images.length);var totalPages=Math.ceil(images.length/items_per_page);if($.galleria.current===images[max_elem-1][0]&&totalPages>1){current_page_index=(images.length==max_elem)?-1:current_page_index;var opt={callback:pageselectCallback,items_per_page:items_per_page,current_page:current_page_index+1};$("#Pagination").pagination(images.length,opt);return true;} var _next=$($$.nextSelector($('.galleria img[rel="'+$.galleria.current+'"]').parents('li'))).find('img').attr('rel');if(_next==undefined)$.galleria.activate($.galleria.current);else $.galleria.activate(_next);},prev:function(){var _prev=$($$.previousSelector($('.galleria img[rel="'+$.galleria.current+'"]').parents('li'))).find('img').attr('rel');$.galleria.activate(_prev);}}});})(jQuery);jQuery.extend({historyCurrentHash:undefined,historyCallback:undefined,historyInit:function(callback){jQuery.historyCallback=callback;var current_hash=location.hash;jQuery.historyCurrentHash=current_hash;try{if(jQuery.browser.msie){if(jQuery.historyCurrentHash==''){jQuery.historyCurrentHash='#'} $("body").prepend('');document.getElementById("jQuery_history").innerHTML=current_hash;}else if($.browser.safari){jQuery.historyBackStack=[];jQuery.historyBackStack.length=history.length;jQuery.historyForwardStack=[];jQuery.isFirst=true}}catch(e){} jQuery.historyCallback(current_hash.replace(/^#/,''));setInterval(jQuery.historyCheck,100)},historyAddHistory:function(hash){jQuery.historyBackStack.push(hash);jQuery.historyForwardStack.length=0;this.isFirst=true},historyCheck:function(){if(jQuery.browser.msie){try{var ihistory=$("#jQuery_history")[0];var current_hash=ihistory;if(current_hash!=jQuery.historyCurrentHash){document.getElementById("jQuery_history").innerHTML=current_hash;jQuery.historyCurrentHash=current_hash;jQuery.historyCallback(current_hash.replace(/^#/,''))}}catch(e){}}else if($.browser.safari){if(!jQuery.dontCheck){var historyDelta=history.length-jQuery.historyBackStack.length;if(historyDelta){jQuery.isFirst=false;if(historyDelta<0){for(var i=0;i=0){jQuery.historyCallback(document.URL.split('#')[1])}else{var current_hash=location.hash;jQuery.historyCallback('')} jQuery.isFirst=true}}}else{var current_hash=location.hash;if(current_hash!=jQuery.historyCurrentHash){jQuery.historyCurrentHash=current_hash;jQuery.historyCallback(current_hash.replace(/^#/,''))}}},historyLoad:function(hash){var newhash;if(navigator.appName=="Microsoft Internet Explorer"){newhash='#'+hash;document.getElementById("jQuery_history").innerHTML=newhash;}else{newhash=hash} jQuery.historyCurrentHash=newhash;if(jQuery.browser.msie){current_hash=document.getElementById("jQuery_history").innerHTML jQuery.historyCurrentHash=current_hash;document.getElementById("jQuery_history").innerHTML=current_hash;jQuery.historyCallback(hash)}else if(jQuery.browser.safari){jQuery.dontCheck=true;this.historyAddHistory(hash);var fn=function(){jQuery.dontCheck=false};window.setTimeout(fn,200);jQuery.historyCallback(hash);location.hash=newhash}else{jQuery.historyCallback(hash)}}});var clearVar;function pageselectCallback(page_index,jq){items_per_page=scrollItem;current_page_index=page_index;var max_elem=Math.min((page_index+1)*items_per_page,images.length);var newcontent='';var firstImageFlag=1;var initialCounter=1;var masterBlock=document.getElementById('masterBlockForLinks');masterBlock.innerHTML="";currentCounerForLinks=page_index*items_per_page;for(var i=page_index*items_per_page;i';else newcontent+='
  • ';firstImageFlag=0;}else{newcontent+='
  • ';} initialCounter++;var divElement=document.createElement('div');divElement.id="block"+i;divElement.index=i;divElement.className="buttonClass";divElement.onclick=function(){callActivationScript(this.index);} var imageSrc=images[i][0];if(images[i][11]!==0){divElement.innerHTML=""+images[i][8]+"";} if(images[i][15]!==0){divElement.innerHTML=divElement.innerHTML+"
    "+images[i][12]+"";} if(images[i][11]=='0'&&images[i][15]=='0'){divElement.style.display="none";} masterBlock.appendChild(divElement);} $('#gallery_demo_ul').html(newcontent);currentImageIndex=page_index*items_per_page;if(page_index==0&&firstTime){firstTime=false;$("#progressbar").fadeIn(500).progressbar(function(){interval:500;text:0;textClass:"progressBarTextXugular";width:250;range:true;increment:1;});setTimeout("initialProgressing();",50);setTimeout("advance10Percent();",1000);setTimeout("advance10Percent();",1000);}else{$('#main_image').html('');$('ul.gallery_demo').galleria(getGalleriaParams());initialImage=images[currentImageIndex][0];if(page_index===0)var delay=2000;else var delay=500;if(firstTime===true)firstTime=false;else setTimeout("testingaftersometimeOasis()",delay);} return true;} function callActivationScript(src){var imageSrc=images[src][0];currentCounerForLinks=src;clearTimeout(clearVar);clearTimeout(timeOutReturnVarForClear);rotateGalleryForLinks() $.galleria.activate(imageSrc);} function testingaftersometimeOasis(){$(".buttonClass").animate_v_1_3_2({left:"0px",backgroundPosition:"0 0"},{queue:false,duration:500});if(document.getElementById("block"+currentCounerForLinks).style.display!=="none"){$("#block"+currentCounerForLinks).animate_v_1_3_2({left:"-17px",backgroundPosition:"-135 0"},{queue:false,duration:500});} currentCounerForLinks++;if(currentCounerForLinks==totalImagesLinks)currentCounerForLinks=0;$.galleria.activate(initialImage);return true;} function thumbCallbackOasis(thumb){var _li=thumb.parents('li');var _fadeTo=_li.is('.active')?'1':'0.3';thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500);thumb.hover(function(){thumb.fadeTo('fast',1);},function(){_li.not('.active').children('img').fadeTo('fast',0.3);})} function imageCallBackOasis(image,caption,description,thumb){image.css('display','none').fadeIn(1000);caption.css('display','none').fadeIn(1000);var _li=thumb.parents('li');_li.siblings().children('img.selected').fadeTo(500,0.3);thumb.fadeTo('fast',1).addClass('selected');} function getGalleriaParams(){return{history:false,clickNext:true,insert:'#main_image',onImage:imageCallBackOasis,onThumb:thumbCallbackOasis};} function loadGalleryMediaFlipperOasis(contentId,descriptionLimit,displayLimit,scrollItem,autoPlay){$('.gallery_demo_unstyled').addClass('gallery_demo');$.ajax({url:"/custom_code/feature_group_image_gal_in_xml_java_form.php?sid="+Math.random()+"&collectionId="+contentId+"&descriptionLimit="+descriptionLimit+"&displayLimit="+displayLimit+"&collectionType=FeatureGroup&galleria=Galleria&resultOutput=javascript&additionalLinks=1",success:function(data){eval(data);if(images.length==0){return;} firstTime=true;totalImagesLinks=images.length;var opt={callback:pageselectCallback,items_per_page:scrollItem};$("#Pagination").pagination(images.length,opt);return;}});} function startGalleria(){for(var i=0;i<2;i++){if(i==0){$('#gallery_demo_ul').fadeIn(600);}else{$('#main_image').html('');currentImageIndex=current_page_index*items_per_page;$('ul.gallery_demo').galleria(getGalleriaParams());$(".buttonClass").animate_v_1_3_2({left:"0px",backgroundPosition:"0 0"},{queue:false,duration:500});if(document.getElementById("block"+currentCounerForLinks).style.display!=="none"){$("#block"+currentCounerForLinks).animate_v_1_3_2({left:"-17px",backgroundPosition:"-135 0"},{queue:false,duration:500});} currentCounerForLinks++;if(currentCounerForLinks==totalImagesLinks)currentCounerForLinks=0;if(autoPlay)timeOutReturnVarForClear=setTimeout("rotateGalleryForLinks()",timeDelayForJqueryFlipper);return false;}}} var currentCounerForLinks=0;function rotateGalleryForLinks(){if(progress>100){$(".buttonClass").animate_v_1_3_2({left:"0px",backgroundPosition:"0 0"},{queue:false,duration:500});try{currentCounerForLinks=(currentCounerForLinks>=totalImagesLinks)?0:currentCounerForLinks;if(document.getElementById("block"+currentCounerForLinks).style.display!=="none"){$("#block"+currentCounerForLinks).animate_v_1_3_2({left:"-17px",backgroundPosition:"-135 0"},{queue:false,duration:500});} currentCounerForLinks++;if(currentCounerForLinks==totalImagesLinks)currentCounerForLinks=0;}catch(e){} if(autoPlay){$.galleria.next();clearVar=setTimeout("rotateGalleryForLinks();",timeDelayForJqueryFlipper);}}else{clearVar=setTimeout("rotateGalleryForLinks();",1000);} return false;}