var identifier=0;$(function(){$('a[rel="external"]').attr('target','_blank');$('a[rel="popup"]').click(function(){var name=$(this).attr('id');if(!name){name='identifier_'+ ++identifier;$(this).attr('id',name)}var width=height=650,top=left=0,percent=80;if(!!screen.width){width=Math.ceil((screen.width/100)*percent);left=Math.ceil((screen.width-width)/2)}if(!!screen.height){height=Math.ceil((screen.height/100)*percent);top=Math.ceil((screen.height-height)/2)}window.open($(this).attr('href'),name,'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes');return false});$('a[rel="download"]').click(function(){var file=$(this).attr('href'),ext=file.split('.').pop().toLowerCase();if($.inArray(ext,['gif','png','jpg','jpeg','bmp'])>-1){window.open(file);return false}})});function toggleDiv(pageBlockId){$('#foldout_'+pageBlockId).slideToggle('slow');if($('#foldoutLink_'+pageBlockId).hasClass('foldoutRightArrow')){$('#foldoutLink_'+pageBlockId).removeClass('foldoutRightArrow');$('#foldoutLink_'+pageBlockId).addClass('foldoutDownArrow')}else{$('#foldoutLink_'+pageBlockId).removeClass('foldoutDownArrow');$('#foldoutLink_'+pageBlockId).addClass('foldoutRightArrow')}}$(document).ready(function(){$('.additionalPhotos').each(function(){var innerSlider=$(this).find('.innerSlider');var images=$(this).find('a');var imageCount=images.length;var packageCount=$(this).attr('id').replace('-count','');if(imageCount>packageCount){$(nextButton).show()}var nextButton=$(this).find('.nextButton');var prevButton=$(this).find('.prevButton');$(this).find('.nextButton').bind('click',function(){var curPos=$(innerSlider).css('left');var curPos=-curPos.substring(0,curPos.length-2)/122;var newPos=curPos+1;if(curPos<imageCount-packageCount){$(innerSlider).animate({'left':'-=122px'},200)}if(newPos==imageCount-packageCount){$(nextButton).hide()}if(newPos>0){$(prevButton).show()}});$(this).find('.prevButton').bind('click',function(){var curPos=$(innerSlider).css('left');var curPos=-curPos.substring(0,curPos.length-2)/122;var newPos=curPos-1;if(curPos>0){$(innerSlider).animate({'left':'+=122px'},200)}if(newPos==0){$(prevButton).hide()}if(newPos<imageCount-packageCount){$(nextButton).show()}})})});
