var SlideItems=function(a){this.oP=(a)?a:{};this.id=this.oP.id||"photoListDiv";this.oP.remoteURL=this.oP.remoteURL||"";this.oP.currentItemId=this.oP.currentItemId||0;this.oP.showItemsNum=this.oP.showItemsNum||6;this.oP.loadingImg=this.oP.loadingImg||"/images/loading.gif";this.oP.param=this.oP.param||{};this.alreadyGetFirst=false;this.alreadyGetLast=false;this.maxItemId=0;this.minItemId=0;this.topItemId=0;this.init()};SlideItems.prototype.init=function(){var b=this;var a={currentItemId:this.oP.currentItemId,showItemsNum:this.oP.showItemsNum};$.ajax({type:"POST",url:this.oP.remoteURL,dataType:"json",data:a,success:function(c){$("#"+b.id).html("");$.each(c,function(f,d){if(b.minItemId==0||b.minItemId>d.itemId){b.minItemId=d.itemId}if(b.maxItemId<d.itemId){b.maxItemId=d.itemId}var g="";if(d.itemId==b.oP.currentItemId){g=" class='on' "}var e="<a href='"+d.url+"' "+g+" rel='"+d.itemId+"' title=\""+d.title+"\"><img src='"+d.imgurl+"' /></a>";$("#"+b.id).append(e)});b.topItemId=b.minItemId}})};SlideItems.prototype.previous=function(){var c=this;if(c.topItemId>c.minItemId){var d=$("#"+c.id+" a[rel="+c.topItemId+"]");var b=d.prev();b.show();c.topItemId=b.attr("rel");return}if(c.alreadyGetFirst){return}var a={minItemId:c.minItemId,showItemsNum:1};$.ajax({type:"POST",url:c.oP.remoteURL,dataType:"json",data:a,success:function(e){if(!e){c.alreadyGetFirst=true;return}$.each(e,function(h,f){if(c.minItemId>f.itemId){c.minItemId=f.itemId}else{if(c.minItemId<=f.itemId){return}}var g="<a href='"+f.url+"' rel='"+f.itemId+"' title=\""+f.title+"\"><img src='"+f.imgurl+"' /></a>"+$("#"+c.id).html();$("#"+c.id).html(g)});c.topItemId=c.minItemId}})};SlideItems.prototype.next=function(){var d=this;var e=$("#"+d.id+" a[rel="+d.topItemId+"]");var b=$("#"+d.id+" a:last");var c=$("#"+d.id);if(d.alreadyGetLast&&(b.position().top)<(c.position().top+c.height())){return}e.hide();d.topItemId=e.next().attr("rel");if(!d.alreadyGetLast&&(b.position().top)<(c.position().top+c.height())){var a={maxItemId:d.maxItemId,showItemsNum:1};$.ajax({type:"POST",url:d.oP.remoteURL,dataType:"json",data:a,success:function(f){if(!f){d.alreadyGetLast=true;return}$.each(f,function(j,g){if(d.maxItemId<g.itemId){d.maxItemId=g.itemId}else{if(d.maxItemId>=g.itemId){return}}var h="<a href='"+g.url+"' rel='"+g.itemId+"' title=\""+g.title+"\"><img src='"+g.imgurl+"' /></a>";$("#"+d.id).append(h)})}})}};function ShowLargePhoto(b){var a=new Boxy("<img class='photo_preview' src='"+b+"' onclick='Boxy.get(this).hide(); return false' title='Click to close' /><div class='photo_preview_tool'><img src='/images/adv_search_close.gif' onclick='Boxy.get(this).hide(); return false' /></div>",{borderWidth:0,modal:true});$(".photo_preview").load(function(){a.center()})}function voteWorks(c,a){$$("ratingDiv").innerHTML="<img src='/images/loading.gif' />";bool_hasvote=true;var f="work_id="+a+"&int_vote="+c;var b=new Ajax("/plus/works/rating.php",f,function(){$$("ratingDiv").innerHTML=b.httpRequest.responseText});b.sendData();try{pageTracker._trackPageview("picture/ratings/unregistered")}catch(d){}};
