$(document).ready(function(){if(imgs.length==0){if($.browser.msie&&$.browser.version==5.5){$('#sb_empty_message').html('The Scrapbook feature requires Internet Explorer 6 or greater.');return false}else if($.browser.msie){return false}}if(($.browser.safari)&&($.browser.version<523)){window.location.replace("/new_layout2/gallery.php?gallery="+menuId+"&nscpt=1&oie=1&osaf=1&jsst=1");return false}if(defaultImgId==undefined||defaultImgId==''){defaultImgId=0}if(!(menuId==undefined||menuId=='')){$('#menu_'+menuId).attr('href','javascript:null(0);');$('#menu_'+menuId).css('color','#b9b9b9');$('#menu_'+menuId).hover(function(){$('#menu_'+menuId).css('color','#b9b9b9')})}var j={sensitivity:2,interval:100,over:thumb_on,timeout:200,out:function(){}};var k='artsess';var l=$('#gallery_header_new_3');var m=$('#main_image');var n=$('#descdiv');var o=$('#sbdiv');var p=$('#thumbs_div');var q='/scrapbook.php';var r='/images/graphics/SB_empty2.jpg';var s='/images/graphics/SB_empty2_ncook.jpg';var t=$('#auxiliary');var u=0;var v=new Array();var w=imgs.length,cookiesDisabled=0;var x=false;var y='/images/graphics/red_square.gif';var z='/images/graphics/blank_square.gif';if($.browser.msie&&$.browser.version==6){r='/images/graphics/scrapbook_empty_oie.gif'}else{var A=readCookie(k);if((A=='')||(A==null)||(A.match(/[^$A-Za-z0-9]/))){cookiesDisabled=1}}var B=defaultImgId;var C='thumb_'+defaultImgId;var D='';var E='';var F=0;var G=false;if($.browser.msie&&$.browser.version<6){F=1;r='/images/graphics/scrapbook_empty_oie.gif'}else{$(".thumbnail").hoverIntent(j)}if(($.browser.opera)||($.browser.safari&&parseInt($.browser.version)<525)){$('.red_dot').css({'padding-top':'6px'})}if((cookiesDisabled==1)&&(isSB=='true')){m.attr('width','220');m.attr('src',s);$('#scrapbook_text').html('Please turn on Cookies to use your Scrapbook.')}$('#gallery_header_wrapper').fadeIn(1);l.css({'display':'none'}).fadeIn(1600);m.css({'display':'none'}).fadeIn(1600,function(){p.css({'visibility':'visible','display':'none'}).fadeIn(1600,function(){$('#'+defaultImgId).fadeTo(800,1.0);n.css({'visibility':'visible','display':'none'});n.html(imgs[defaultImgId]["desc"]);n.fadeIn(1600,function(){o.css({'visibility':'visible','display':'none'});if(cookiesDisabled==1){o.html("<strong>Cookies Required: Saving images in your Scrapbook has been disabled.</strong><BR>To enable this feature, change your browser cookie settings and refresh this page.")}if(F==1){$('#thumb_table').fadeIn(800)}else{o.fadeIn(800,function(){o.animate({opacity:1.0},15000);if(cookiesDisabled!=1){o.fadeOut(800)}})}})})});$('.thumbnail').click(function(){var a=this.id;if(w<1||G||imgs[a]==undefined||cookiesDisabled==1){return false}var b='red_dot_'+a;if(imgs[a]['sbStat']==0){$.post(q,{image_id:imgs[a]["id"],fav_stat:imgs[a]["sbStat"]});imgs[a]['sbStat']=1;o.stop().fadeOut(30);o.css({'visibility':'visible','display':'none'});o.html('<strong>'+imgs[a]["title"]+'</strong>'+' has been added to your <strong>Scrapbook</strong>.');o.fadeIn(300,function(){o.animate({opacity:1.0},3000,function(){o.fadeOut(800)})});$('#'+b).attr('src',y).css({'visibility':'visible','display':'none'}).fadeIn(400)}else{if(isSB!='true'){$.post(q,{image_id:imgs[a]["id"],fav_stat:imgs[a]["sbStat"]});imgs[a]['sbStat']=0;o.css({'visibility':'visible','display':'none'});o.html('<strong>'+imgs[a]["title"]+'</strong>'+' has been removed from your <strong>Scrapbook</strong>.');o.stop().fadeIn(300,function(){o.animate({opacity:1.0},3000,function(){o.fadeOut(800)})});$('#'+b).fadeOut(400)}else{var c=imgs[a]["title"];var d=a;var e=imgs[a]["gall"];tnCnt[e]--;$.post(q,{image_id:imgs[a]["id"],fav_stat:imgs[a]["sbStat"]});delete imgs[a];w--;$('#'+b).attr('src',z).css({'visibility':'visible','display':'none'}).fadeIn(400);t.append('GallCnt '+tnCnt[e]+'<BR>');t.append('Gall '+e+'<BR>');if(tnCnt[e]==0){$('#gw_'+e).hide()}else{$('#tc_'+d).hide()}G=true;if(w>0){var f=getNxtImg(a,imgs);B=f;var g=0;totalSize=0;var h=imgs[f]['path'];m.stop().fadeOut(300,function(){m.attr('width',imgs[f]['pw']);m.attr('src',h);$('#'+f).fadeTo(300,1.0);m.fadeIn(400,function(){m.fadeTo(200,1.0);G=false})});o.stop().fadeOut(30);o.css({'visibility':'visible','display':'none'});o.html('<strong>'+c+'</strong>'+' has been removed from your <strong>Scrapbook</strong>.');o.fadeIn(300,function(){o.animate({opacity:1.0},3000,function(){o.fadeOut(800)})})}else{m.attr('width','245');m.stop().attr('src',r);$('#scrapbook_text').html('There are no images in your Scrapbook.');G=false;m.fadeTo(1000,1.0);n.fadeOut(30);o.fadeOut(1200);o.hide()}G=false}}return false});function thumb_on(){var a=this.id;if(G||imgs[a]==undefined){return false}if(B==a){return false}else{var b=B;B=a}var c=imgs[a]['path'];$('#'+b).fadeTo(300,0.7,function(){$('#'+a).fadeTo(300,1.0)});m.fadeOut(450,function(){m.attr('width',imgs[a]['pw']);m.attr('src',c).fadeIn(450)});n.css({'display':'none'});n.html(imgs[a]['desc']);n.fadeIn(800)};function readCookie(a){var b=document.cookie.split(';');var c=a+'=';for(var i=0;i<b.length;i++){var d=b[i];while(d.charAt(0)==' '){d=d.substring(1,d.length)}if(d.indexOf(c)==0){return d.substring(c.length,d.length)}}return null};function getNxtImg(a,b){currImgId2=a*1;var c=currImgId2+1;while(c<=b.length){for(arrayKey in b){if(arrayKey==c){return arrayKey;break}}c++}for(var i=currImgId2-1;i>=0;i--){for(arrayKey in b){if(arrayKey==i){return arrayKey}}}for(arrayKey in b){if(b[arrayKey]!=undefined){return arrayKey}}return 0};function sizeOf(a){i=0;for(arrayKey in a){if(a[arrayKey]!=undefined){i++}}return i}});
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
