(function($){$.fn.alternateViewsProgress=function(options){var opts=$.extend({},$.fn.alternateViewsProgress.defaults,options);this.show();$("#"+opts.currentPageId).html(opts.pageNumber);$("#"+opts.totalPagesId).html(opts.pageCount);return this};$.fn.alternateViewsProgress.defaults={pageNumber:1,pageCount:1,currentPageId:null,totalPagesId:null}})(jQuery);(function($){$.fn.chartTipster=function(options){var opts=$.extend({},$.fn.chartTipster.defaults,options),map=$("map[name="+this.attr("usemap").replace("#","")+"]"),ul=$('<ul class="chartTipster"><li><div class="content"><div class="imageContainer"></div></div></li></ul>'),chart=this.clone(true);ul.insertAfter(this);ul.find("div[class=imageContainer]").append(chart);var tips=[];map.children("area").each(function(){var coords=$(this).attr("coords").split(",",4),left=parseInt(coords[2]),top=parseInt(coords[3]),url=$(this).attr("href"),lotId=parseInt($(this).attr("title")),descr=null;if(typeof options.getContent!="undefined")descr=options.getContent(lotId);var tip=null;if(descr!=null){tip=$("<span></span>").html(descr);typeof $.preload!="undefined"&&tip.find("img").preload()}var tipContainer=$("<div style='width:14px;height:12px;margin-left:-10px;margin-top:-12px;' class='marker'></div>").attr("class","marker").attr("title",left+","+top),image=$("<img style='width:100%;height:100%;' />").css("opacity",0);tipContainer.append(image);tip!=null&&tipContainer.append(tip);var separator=url.indexOf("?")>=0?"&":"?";ul.find("div[class=content]").append(tipContainer);tips.push(tipContainer)});chart.removeAttr("usemap");this.remove();map.remove();return ul.jTipster(options)}})(jQuery);function centerPopup(elementId){var windowWidth=document.documentElement.clientWidth,windowHeight=document.documentElement.clientHeight,popupHeight=$("#"+elementId).height(),popupWidth=$("#"+elementId).width(),scrollTop=$(document).scrollTop();$("#"+elementId).css({position:"absolute",top:scrollTop+windowHeight/2-popupHeight/2,left:windowWidth/2-popupWidth/2}).show()}var photos=[],photoslink=[],which=1,linkornot=0;if(photoslink==0)for(var i=0;i<photos.length;i++)photoslink[i]="";var preloadedimages=[],preloadedEnlargedimages=[];for(i=0;i<photos.length;i++){preloadedimages[i]=new Image;preloadedimages[i].src=photos[i];preloadedEnlargedimages[i]=new Image;preloadedEnlargedimages[i].src=enlargedPhotos[i]}function keeptrack(){window.status="Image "+(which+1)+" of "+photos.length}function changeEnlargeLink(){var lnk=document.getElementById("enlargeLink2");if(lnk)lnk.href=enlargedPhotos[which]}function backward(){if(which>0){which--;document.images.photoslider.src=photos[which];keeptrack();changeEnlargeLink()}}function forward(){if(which<photos.length-1){which++;document.images.photoslider.src=photos[which];keeptrack();changeEnlargeLink()}}function transport(){window.location=photoslink[which]}function changeMainImage(){var mainImg=document.getElementById("imgMain"),mainLnk=document.getElementById("lnkMain");mainImg&&mainImg.setAttribute("src",photos[which]);mainLnk&&mainLnk.setAttribute("href",enlargedPhotos[which])}function CarouselPagerSyncExtender(opts){this._carousel=null;this._itemsCount=0;this._carouselId=opts.carouselId;this._pagerDivId=opts.pagerDivId;this._imagePreviewId=opts.imagePreviewId;this._linkEnlargeId=opts.linkEnlargeId;this._viewItemClass=opts.viewItemClass;this._selectedViewItemClass=opts.selectedViewItemClass;this._statusContainerId=opts.statusContainerId;this._statusOptions=opts.statusOptions;this._selectionCallback=opts.selectionCallback}CarouselPagerSyncExtender.prototype.initialize=function(carousel){this._carousel=carousel;this._itemsCount=$("#"+this._carouselId+" img").length;this.selectPage(1);this.highlightItemByPageNumber(1);var caller=this;$("#"+this._carouselId+" img").click(function(){caller.itemSelected($(this))});typeof $.preload!="undefined"&&$("#"+this._carouselId+" img").each(function(){$("<a href='"+$(this).attr("previewUrl")+"'>loading</a>").preload()})};CarouselPagerSyncExtender.prototype.selectPage=function(pageNumber){var caller=this;this._pagerDivId!=null&&$("#"+this._pagerDivId).pager({pagenumber:pageNumber,pagecount:this._itemsCount,buttonClickCallback:function(selectedPage){caller.pageSelected(selectedPage)}});if(typeof jQuery.fn.alternateViewsProgress!="undefined"){var statusOptions=$.extend({},caller._statusOptions,{pageNumber:pageNumber,pageCount:caller._itemsCount}),statusSelector="#"+this._statusOptions.containerId;$(statusSelector).alternateViewsProgress(statusOptions)}};CarouselPagerSyncExtender.prototype.scrollTo=function(pageNumber){this._carousel.scroll(jQuery.jcarousel.intval(pageNumber))};CarouselPagerSyncExtender.prototype.highlightItemByPageNumber=function(pageNumber){var selectedImage=$("#"+this._carouselId+" img:eq("+(parseInt(pageNumber)-1)+")");this.highlightItem(selectedImage)};CarouselPagerSyncExtender.prototype.highlightItem=function(selectedImage){var previewUrl=selectedImage.attr("previewUrl"),enlargeUrl=selectedImage.attr("enlargeUrl");this._imagePreviewId!=null&&$("#"+this._imagePreviewId).css("background-image","url("+previewUrl+")");this._zoomer!=null&&this._zoomer.setImageDescriptor(previewUrl);$("#"+this._linkEnlargeId).attr("href",enlargeUrl);var previouslySelectedContainer=$("#"+this._carouselId+" div[class="+this._selectedViewItemClass+"]:first");previouslySelectedContainer.attr("class",this._viewItemClass);previouslySelectedContainer.find("img:first").fadeTo("slow",1);selectedImage.fadeTo("slow",.6);selectedImage.parent("div:first").attr("class",this._selectedViewItemClass)};CarouselPagerSyncExtender.prototype.pageSelected=function(selectedPage){this.selectPage(selectedPage);this.scrollTo(selectedPage);this.highlightItemByPageNumber(selectedPage)};CarouselPagerSyncExtender.prototype.itemSelected=function(selectedImage){this.highlightItem(selectedImage);var items=$("#"+this._carouselId+" img"),itemNumber=jQuery.inArray(selectedImage[0],items)+1;this.selectPage(itemNumber);typeof this._selectionCallback=="function"&&this._selectionCallback(itemNumber)};
