function update(a){if(a.index==1){$("#screen").fadeOut(2E3);$("div#first.productImage img").addClass("selected")}$("div.navigation div:eq("+(a.index-1)+") a img").fadeTo(2E3,1).removeClass("loading")}function finish(){$("div.navigation div a img").fadeTo(2E3,1).removeClass("loading")}jQuery(function(a){a("div.productImage img").preload({placeholder:"http://farm.sg/harvest/work/images/loading-thumbs.gif",threshold:1,onComplete:update,onFinish:finish})});
function hideVideo(){$("#video").dialog("close")}function showVideo(a){$("#viewer").load("/harvest/work/php/youtubeviewer.php?video="+a);$("#video").dialog("open")}
$(document).ready(function(){function a(){return $(window).width()}function l(){$(this).parents("div:first").find("img.selected").fadeTo(2E3,i).removeClass("selected").end().end().find("img").fadeTo(2E3,1).addClass("selected")}function m(){$(this).parents("div.navigation").find("img").removeClass("selected").end().end().find("img").addClass("selected")}function n(c,f,q,r,g,o){if($("div.navigation div:eq("+g+") a img").hasClass("loading"))return false;c=document.documentElement.clientWidth;f=Math.floor((c-
b[g].offsetWidth)/2)*-1;o.value=g==0?Math.floor(c-960-20)/-2:f;if(g!=0){e.fadeTo("normal",1);$("div.productText").fadeTo("slow",i)}}function p(c){c.id=="first"&&$("div.productText").fadeTo("normal",i).fadeTo("slow",1);var f=$("#slider .scrollContainer").find('div[id$="'+c.id+'"]').get(0);l.call(f);c=$("#slider .navigation").find('a[href$="'+c.id+'"]').get(0);m.call(c)}$("div.navigation div a img:last").load(function(){$("div.naviLayout").show()});var i=0.05,b=$("#slider .scrollContainer > div"),h=
$("#slider .scrollContainer"),k=$("#slider"),e=$("#slider .scroll");b.css({"float":"left",position:"relative"});for(var d=0,j=0;j<b.length;j++)d+=b[j].offsetWidth;h.css("width",b[0].offsetWidth*b.length*3);k.css("width",a()-20);e.css("width",a()-20);d=Math.floor(a()-960-20)/2;h.css("padding-left",d<0?0:d);$.browser.msie&&parseInt(jQuery.browser.version)==8&&$(b[b.length-1]).css("padding-right",Math.floor((a()-$(b[b.length-1]).width())/2));$(window).resize(function(){k.css("width",a()-20);e.css("width",
a()-20);var c=Math.floor(a()-960-20)/2;h.css("padding-left",c<0?0:c);$.browser.msie&&parseInt(jQuery.browser.version)==8&&$(b[b.length-1]).css("padding-right",Math.floor((a()-$(b[b.length-1]).width())/2))});e=$("#slider .scroll").css("overflow","hidden");d=parseInt(h.css("paddingTop")||0)*-1;d={target:e,items:b,navigation:".navigation a",prev:"img.left",next:"img.right",axis:"x",offset:d,onBefore:n,onAfter:p,duration:800,easing:"easeInOutSine",constant:false};$("#slider").serialScroll(d);e.trigger("goto",
[0]);$("#video").dialog({autoOpen:false,bgiframe:true,height:450,width:850,modal:true,resizable:false,draggable:false})});