function button_click(a){a=normalizeUrl(a);document.location=a}function button_submit(a){var b=document.getElementById("theForm");b.method="post";a=normalizeUrl(a);b.action=a;b.submit()}function normalizeUrl(a){if(a.charAt(0)=="/"){return appBase+a.substring(1)}else{return a}}function focusOnFirst(){var c=document.getElementsByTagName("input");for(var a=0;a<c.length;a++){var b=c[a];if(b.type=="text"){try{b.focus()}catch(d){}return}}}function formKeyPress(d){var b=null;var c=null;if(d.target){b=d.which;c=d.target}else{b=window.event.keyCode;c=d.srcElement}if(c.nodeName=="SELECT"||c.nodeName=="INPUT"&&(c.type=="text"||c.type=="password"||c.type=="checkbox"||c.type=="radio")){if(b==13||b==3){var a=getFirstButton(c);if(a){a.onclick()}return false}}return true}function getFirstButton(b){var a=findContainer(b);if(!a){return null}return getFirstButtonChild(a)}function getFirstButtonChild(c){var a=c.getElementsByTagName("button");if(a.length>0){return a[0]}var a=c.getElementsByTagName("span");for(var b=0;b<a.length;b++){var d=a.item(b);if(d.getAttribute("button")){return d}}var a=c.getElementsByTagName("img");for(var b=0;b<a.length;b++){var d=a.item(b);if(d.getAttribute("button")){return d}}return null}function findContainer(a){while((a=a.parentNode)!=null){if(a.nodeName=="FORM"){return a}}return null}function updateHiddenTimeField(a){document.getElementById(a).value=document.getElementById("_"+a+"_hour").value+":"+document.getElementById("_"+a+"_minute").value+" "+document.getElementById("_"+a+"_pm").value}function updateSelectTimeFields(d){if(document.getElementById(d)){var b=document.getElementById(d).value;if(b==""){updateHiddenTimeField(d)}else{var a=new Array();var c=new Array();a=b.split(":");c=a[1].split(" ");if(c[0]<8){c[0]="00"}else{if(c[0]<23){c[0]="15"}else{if(c[0]<38){c[0]="30"}else{c[0]="45"}}}document.getElementById("_"+d+"_hour").value=a[0];document.getElementById("_"+d+"_minute").value=c[0];document.getElementById("_"+d+"_pm").value=c[1]}}}function trim(a){return a.replace(/^\s+|\s+$/g,"")}function hideElement(id){if(document.getElementById){document.getElementById(id).style.display="none"}else{if(document.layers){eval("document."+id+".visibility = 'hidden'")}else{eval("document.all."+id+".style.visibility = 'hidden'")}}}function showElement(id){if(document.getElementById){document.getElementById(id).style.display="block"}else{if(document.layers){eval("document."+id+".visibility = 'visible'")}else{eval("document.all."+id+".style.visibility = 'visible'")}}}function moveIt(c,b,a){c.style.position="absolute";c.style.top=b+"px";c.style.left=a+"px"}var xMousePos=0;var yMousePos=0;function captureMousePosition(b){var a=0;var c=0;if(!b){var b=window.event}if(b.pageX||b.pageY){a=b.pageX;c=b.pageY}else{if(b.clientX||b.clientY){a=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;c=b.clientY+document.body.scrollTop+document.documentElement.scrollTop}}xMousePos=a;yMousePos=c}function encode(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e<b.length;e++){var d=b.charCodeAt(e);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return escape(a)}function getDateObject(f,e){var h=f;var g=e;var d=0;var a,c,b;d=f.indexOf(g);c=f.substring(0,d);endPos=f.indexOf(g,d+1);a=f.substring(d+1,endPos);d=endPos;endPos=d+3;b=h.substring(d+1,endPos);if(b.length==2){b="20"+b}dtObject=new Date(b,c-1,a);return dtObject}function cb_verifySelectedItems(a){if(!cb_hasSelectedCheckbox(document,a)){alert("No items selected.");return false}return true}function cb_hasSelectedCheckbox(d,a){if(d.nodeName=="INPUT"&&d.type=="checkbox"){if(d.checked&&d.name==a){return true}}var b=d.childNodes;for(var c=0;c<b.length;c++){var e=b.item(c);if(cb_hasSelectedCheckbox(e,a)){return true}}return false}function cb_getSelectedItemsCount(a){var b=[];jQuery("input[name='"+a+"']").each(function(){if(this.checked){b.push(this.value)}});return b.length}(function(e){var b={},k,m,o,j=e.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),a=false;e.tooltip={blocked:false,defaults:{delay:200,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){e.tooltip.blocked=!e.tooltip.blocked}};e.fn.extend({tooltip:function(q){q=e.extend({},e.tooltip.defaults,q);h(q);return this.each(function(){e.data(this,"tooltip-settings",q);this.tooltipText=this.title;e(this).removeAttr("title");this.alt=""}).hover(l,f).click(f)},fixPNG:j?function(){return this.each(function(){var q=e(this).css("backgroundImage");if(q.match(/^url\(["']?(.*\.png)["']?\)$/i)){q=RegExp.$1;e(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+q+"')"}).each(function(){var r=e(this).css("position");if(r!="absolute"&&r!="relative"){e(this).css("position","relative")}})}})}:function(){return this
},unfixPNG:j?function(){return this.each(function(){e(this).css({filter:"",backgroundImage:""})})}:function(){return this},hideWhenEmpty:function(){return this.each(function(){e(this)[e(this).html()?"show":"hide"]()})},url:function(){return this.attr("href")||this.attr("src")}});function h(q){if(b.parent){return}b.parent=e('<div id="'+q.id+'" class="tool-tip"><strong></strong><span></span></div>').appendTo(document.body).hide();if(e.fn.bgiframe){b.parent.bgiframe()}b.title=e("strong",b.parent);b.body=e("span",b.parent);b.url=e("div.url",b.parent)}function c(q){return e.data(q,"tooltip-settings")}function g(q){if(c(this).delay){o=setTimeout(n,c(this).delay)}else{n()}a=!!c(this).track;e(document.body).bind("mousemove",d);d(q)}function l(){if(e.tooltip.blocked||this==k||(!this.tooltipText&&!c(this).bodyHandler)){return}k=this;m=this.tooltipText;m=m.replace("(s)","<strong>");m=m.replace("(/s)","</strong>");if(c(this).bodyHandler){b.title.hide();var t=c(this).bodyHandler.call(this);if(t.nodeType||t.jquery){b.body.empty().append(t)}else{b.body.html(t)}b.body.show()}else{if(c(this).showBody){var s=m.split(c(this).showBody);b.title.html(s.shift()).show();b.body.empty();for(var r=0,q;q=s[r];r++){if(r>0){b.body.append("<br/>")}b.body.append(q)}b.body.hideWhenEmpty()}else{b.title.html(m).show();b.body.hide()}}if(c(this).showURL&&e(this).url()){b.url.html(e(this).url().replace("http://","")).show()}else{b.url.hide()}b.parent.addClass(c(this).extraClass);if(c(this).fixPNG){b.parent.fixPNG()}g.apply(this,arguments)}function n(){o=null;b.parent.fadeIn(200);d()}function d(s){if(e.tooltip.blocked){return}if(!a&&b.parent.is(":visible")){e(document.body).unbind("mousemove",d)}if(k==null){e(document.body).unbind("mousemove",d);return}b.parent.removeClass("viewport-right").removeClass("viewport-bottom");var u=b.parent[0].offsetLeft;var t=b.parent[0].offsetTop;if(s){u=s.pageX+c(k).left;t=s.pageY+c(k).top;b.parent.css({left:u+"px",top:t+"px"})}var q=i(),r=b.parent[0];if(q.x+q.cx<r.offsetLeft+r.offsetWidth){u-=r.offsetWidth+20+c(k).left;b.parent.css({left:u+"px"}).addClass("viewport-right")}if(q.y+q.cy<r.offsetTop+r.offsetHeight){t-=r.offsetHeight+20+c(k).top;b.parent.css({top:t+"px"}).addClass("viewport-bottom")}}function i(){return{x:e(window).scrollLeft(),y:e(window).scrollTop(),cx:e(window).width(),cy:e(window).height()}}function f(q){if(e.tooltip.blocked){return}if(o){clearTimeout(o)}k=null;b.parent.fadeOut(200).removeClass(c(this).extraClass);if(c(this).fixPNG){b.parent.unfixPNG()}}e.fn.Tooltip=e.fn.tooltip})(jQuery);(function(d){var a=d.fn.height,c=d.fn.width;d.fn.extend({height:function(){if(this[0]==window){return self.innerHeight||d.boxModel&&document.documentElement.clientHeight||document.body.clientHeight}if(this[0]==document){return Math.max(document.body.scrollHeight,document.body.offsetHeight)}return a.apply(this,arguments)},width:function(){if(this[0]==window){return self.innerWidth||d.boxModel&&document.documentElement.clientWidth||document.body.clientWidth}if(this[0]==document){return Math.max(document.body.scrollWidth,document.body.offsetWidth)}return c.apply(this,arguments)},innerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight-b(this,"borderTopWidth")-b(this,"borderBottomWidth"):this.height()+b(this,"paddingTop")+b(this,"paddingBottom")},innerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth-b(this,"borderLeftWidth")-b(this,"borderRightWidth"):this.width()+b(this,"paddingLeft")+b(this,"paddingRight")},outerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight:this.height()+b(this,"borderTopWidth")+b(this,"borderBottomWidth")+b(this,"paddingTop")+b(this,"paddingBottom")},outerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth:this.width()+b(this,"borderLeftWidth")+b(this,"borderRightWidth")+b(this,"paddingLeft")+b(this,"paddingRight")},scrollLeft:function(f){if(f!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(f,d(window).scrollTop())}else{this.scrollLeft=f}})}if(this[0]==window||this[0]==document){return self.pageXOffset||d.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft}return this[0].scrollLeft},scrollTop:function(f){if(f!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(d(window).scrollLeft(),f)}else{this.scrollTop=f}})}if(this[0]==window||this[0]==document){return self.pageYOffset||d.boxModel&&document.documentElement.scrollTop||document.body.scrollTop}return this[0].scrollTop},position:function(o,j){var g=this[0],m=g.parentNode,i=g.offsetParent,o=d.extend({margin:false,border:false,padding:false,scroll:false},o||{}),l=g.offsetLeft,k=g.offsetTop,h=g.scrollLeft,n=g.scrollTop;if(d.browser.mozilla||d.browser.msie){l+=b(g,"borderLeftWidth");k+=b(g,"borderTopWidth")
}if(d.browser.mozilla){do{if(d.browser.mozilla&&m!=g&&d.css(m,"overflow")!="visible"){l+=b(m,"borderLeftWidth");k+=b(m,"borderTopWidth")}if(m==i){break}}while((m=m.parentNode)&&(m.tagName.toLowerCase()!="body"||m.tagName.toLowerCase()!="html"))}var f=e(g,o,l,k,h,n);if(j){d.extend(j,f);return this}else{return f}},offset:function(g,l){var k=0,j=0,u=0,o=0,v=this[0],i=this[0],h,f,t=d.css(v,"position"),s=d.browser.mozilla,m=d.browser.msie,z=d.browser.safari,r=d.browser.opera,n=false,q=false,g=d.extend({margin:true,border:false,padding:false,scroll:true,lite:false},g||{});if(g.lite){return this.offsetLite(g,l)}if(v.tagName.toLowerCase()=="body"){k=v.offsetLeft;j=v.offsetTop;if(s){k+=b(v,"marginLeft")+(b(v,"borderLeftWidth")*2);j+=b(v,"marginTop")+(b(v,"borderTopWidth")*2)}else{if(r){k+=b(v,"marginLeft");j+=b(v,"marginTop")}else{if(m&&jQuery.boxModel){k+=b(v,"borderLeftWidth");j+=b(v,"borderTopWidth")}}}}else{do{f=d.css(i,"position");k+=i.offsetLeft;j+=i.offsetTop;if(s||m){k+=b(i,"borderLeftWidth");j+=b(i,"borderTopWidth");if(s&&f=="absolute"){n=true}if(m&&f=="relative"){q=true}}h=i.offsetParent;if(g.scroll||s){do{if(g.scroll){u+=i.scrollLeft;o+=i.scrollTop}if(s&&i!=v&&d.css(i,"overflow")!="visible"){k+=b(i,"borderLeftWidth");j+=b(i,"borderTopWidth")}i=i.parentNode}while(i!=h)}i=h;if(i.tagName.toLowerCase()=="body"||i.tagName.toLowerCase()=="html"){if((z||(m&&d.boxModel))&&t!="absolute"&&t!="fixed"){k+=b(i,"marginLeft");j+=b(i,"marginTop")}if((s&&!n&&t!="fixed")||(m&&t=="static"&&!q)){k+=b(i,"borderLeftWidth");j+=b(i,"borderTopWidth")}break}}while(i)}var w=e(v,g,k,j,u,o);if(l){d.extend(l,w);return this}else{return w}},offsetLite:function(n,i){var k=0,j=0,g=0,m=0,l=this[0],h,n=d.extend({margin:true,border:false,padding:false,scroll:true},n||{});do{k+=l.offsetLeft;j+=l.offsetTop;h=l.offsetParent;if(n.scroll){do{g+=l.scrollLeft;m+=l.scrollTop;l=l.parentNode}while(l!=h)}l=h}while(l&&l.tagName.toLowerCase()!="body"&&l.tagName.toLowerCase()!="html");var f=e(this[0],n,k,j,g,m);if(i){d.extend(i,f);return this}else{return f}}});var b=function(f,g){return parseInt(d.css(f.jquery?f[0]:f,g))||0};var e=function(j,i,g,k,f,h){if(!i.margin){g-=b(j,"marginLeft");k-=b(j,"marginTop")}if(i.border&&(d.browser.safari||d.browser.opera)){g+=b(j,"borderLeftWidth");k+=b(j,"borderTopWidth")}else{if(!i.border&&!(d.browser.safari||d.browser.opera)){g-=b(j,"borderLeftWidth");k-=b(j,"borderTopWidth")}}if(i.padding){g+=b(j,"paddingLeft");k+=b(j,"paddingTop")}if(i.scroll){f-=j.scrollLeft;h-=j.scrollTop}return i.scroll?{top:k-h,left:g-f,scrollTop:h,scrollLeft:f}:{top:k,left:g}}})(jQuery);$(document).ready(function(){$("ul.question a").click(function(){$(this).next("div").slideToggle(300,function(){$(this).parent().toggleClass("open")});return false});var c=document.getElementsByTagName("input");var a="";if(c){for(var b=0;b<c.length;b++){if(c[b].type=="text"||c[b].type=="password"){c[b].onfocus=function(){a=this.value;this.value=""};c[b].onblur=function(){if(this.value==""){this.value=a}a=""}}}}$("a.tip").tooltip({track:true,showURL:false,showBody:" :: ",opacity:0.9})});$(window).load(function(){if(document.location.href.indexOf("#")<0){document.getElementById("login").focus()}MM_preloadImages("../images/login/howItWorks/vineWaterLoss.jpg","../images/login/howItWorks/environmentalParameters.jpg","../images/login/howItWorks/viewData.jpg","../images/login/howItWorks/sapFlowSensor.jpg","../images/login/TOUR-1.jpg","../images/login/TOUR-2.jpg","../images/login/TOUR-3.jpg","../images/login/TOUR-4.jpg")});
/*
 * jQuery Cycle Plugin (core)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version: 2.80 (05-MAR-2010)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Requires: jQuery v1.2.6 or later
 */
(function(i){var l="2.80";if(i.support==undefined){i.support={opacity:!(i.browser.msie)}}function a(r){if(i.fn.cycle.debug){f(r)}}function f(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "))}}i.fn.cycle=function(s,r){var t={s:this.selector,c:this.context};if(this.length===0&&s!="stop"){if(!i.isReady&&t.s){f("DOM not ready, queuing slideshow");i(function(){i(t.s,t.c).cycle(s,r)});return this}f("terminating; zero elements found by selector"+(i.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var x=m(this,s,r);if(x===false){return}x.updateActivePagerLink=x.updateActivePagerLink||i.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=this.cyclePause=0;var y=i(this);var z=x.slideExpr?i(x.slideExpr,this):y.children();var v=z.get();if(v.length<2){f("terminating; too few slides: "+v.length);return}var u=k(y,z,v,x,t);if(u===false){return}var w=u.continuous?10:h(u.currSlide,u.nextSlide,u,!u.rev);if(w){w+=(u.delay||0);if(w<10){w=10}a("first timeout: "+w);this.cycleTimeout=setTimeout(function(){e(v,u,0,!u.rev)
},w)}})};function m(r,u,s){if(r.cycleStop==undefined){r.cycleStop=0}if(u===undefined||u===null){u={}}if(u.constructor==String){switch(u){case"destroy":case"stop":var v=i(r).data("cycle.opts");if(!v){return false}r.cycleStop++;if(r.cycleTimeout){clearTimeout(r.cycleTimeout)}r.cycleTimeout=0;i(r).removeData("cycle.opts");if(u=="destroy"){q(v)}return false;case"toggle":r.cyclePause=(r.cyclePause===1)?0:1;return false;case"pause":r.cyclePause=1;return false;case"resume":r.cyclePause=0;if(s===true){u=i(r).data("cycle.opts");if(!u){f("options not found, can not resume");return false}if(r.cycleTimeout){clearTimeout(r.cycleTimeout);r.cycleTimeout=0}e(u.elements,u,1,1)}return false;case"prev":case"next":var v=i(r).data("cycle.opts");if(!v){f('options not found, "prev/next" ignored');return false}i.fn.cycle[u](v);return false;default:u={fx:u}}return u}else{if(u.constructor==Number){var t=u;u=i(r).data("cycle.opts");if(!u){f("options not found, can not advance slide");return false}if(t<0||t>=u.elements.length){f("invalid slide index: "+t);return false}u.nextSlide=t;if(r.cycleTimeout){clearTimeout(r.cycleTimeout);r.cycleTimeout=0}if(typeof s=="string"){u.oneTimeFx=s}e(u.elements,u,1,t>=u.currSlide);return false}}return u}function b(r,s){if(!i.support.opacity&&s.cleartype&&r.style.filter){try{r.style.removeAttribute("filter")}catch(t){}}}function q(r){if(r.next){i(r.next).unbind(r.prevNextEvent)}if(r.prev){i(r.prev).unbind(r.prevNextEvent)}if(r.pager||r.pagerAnchorBuilder){i.each(r.pagerAnchors||[],function(){this.unbind().remove()})}r.pagerAnchors=null;if(r.destroy){r.destroy(r)}}function k(z,K,v,u,F){var D=i.extend({},i.fn.cycle.defaults,u||{},i.metadata?z.metadata():i.meta?z.data():{});if(D.autostop){D.countdown=D.autostopCount||v.length}var s=z[0];z.data("cycle.opts",D);D.$cont=z;D.stopCount=s.cycleStop;D.elements=v;D.before=D.before?[D.before]:[];D.after=D.after?[D.after]:[];D.after.unshift(function(){D.busy=0});if(!i.support.opacity&&D.cleartype){D.after.push(function(){b(this,D)})}if(D.continuous){D.after.push(function(){e(v,D,0,!D.rev)})}n(D);if(!i.support.opacity&&D.cleartype&&!D.cleartypeNoBg){g(K)}if(z.css("position")=="static"){z.css("position","relative")}if(D.width){z.width(D.width)}if(D.height&&D.height!="auto"){z.height(D.height)}if(D.startingSlide){D.startingSlide=parseInt(D.startingSlide)}if(D.random){D.randomMap=[];for(var I=0;I<v.length;I++){D.randomMap.push(I)}D.randomMap.sort(function(M,w){return Math.random()-0.5});D.randomIndex=1;D.startingSlide=D.randomMap[1]}else{if(D.startingSlide>=v.length){D.startingSlide=0}}D.currSlide=D.startingSlide||0;var y=D.startingSlide;K.css({position:"absolute",top:0,left:0}).hide().each(function(w){var M=y?w>=y?v.length-(w-y):y-w:v.length-w;i(this).css("z-index",M)});i(v[y]).css("opacity",1).show();b(v[y],D);if(D.fit&&D.width){K.width(D.width)}if(D.fit&&D.height&&D.height!="auto"){K.height(D.height)}var E=D.containerResize&&!z.innerHeight();if(E){var x=0,C=0;for(var G=0;G<v.length;G++){var r=i(v[G]),L=r[0],B=r.outerWidth(),J=r.outerHeight();if(!B){B=L.offsetWidth||L.width||r.attr("width")}if(!J){J=L.offsetHeight||L.height||r.attr("height")}x=B>x?B:x;C=J>C?J:C}if(x>0&&C>0){z.css({width:x+"px",height:C+"px"})}}if(D.pause){z.hover(function(){this.cyclePause++},function(){this.cyclePause--})}if(c(D)===false){return false}var t=false;u.requeueAttempts=u.requeueAttempts||0;K.each(function(){var O=i(this);this.cycleH=(D.fit&&D.height)?D.height:(O.height()||this.offsetHeight||this.height||O.attr("height")||0);this.cycleW=(D.fit&&D.width)?D.width:(O.width()||this.offsetWidth||this.width||O.attr("width")||0);if(O.is("img")){var M=(i.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var P=(i.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var N=(i.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var w=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(M||P||N||w){if(F.s&&D.requeueOnImageNotLoaded&&++u.requeueAttempts<100){f(u.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){i(F.s,F.c).cycle(u)},D.requeueTimeout);t=true;return false}else{f("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}}return true});if(t){return false}D.cssBefore=D.cssBefore||{};D.animIn=D.animIn||{};D.animOut=D.animOut||{};K.not(":eq("+y+")").css(D.cssBefore);if(D.cssFirst){i(K[y]).css(D.cssFirst)}if(D.timeout){D.timeout=parseInt(D.timeout);if(D.speed.constructor==String){D.speed=i.fx.speeds[D.speed]||parseInt(D.speed)}if(!D.sync){D.speed=D.speed/2}while((D.timeout-D.speed)<250){D.timeout+=D.speed}}if(D.easing){D.easeIn=D.easeOut=D.easing}if(!D.speedIn){D.speedIn=D.speed}if(!D.speedOut){D.speedOut=D.speed}D.slideCount=v.length;D.currSlide=D.lastSlide=y;if(D.random){if(++D.randomIndex==v.length){D.randomIndex=0}D.nextSlide=D.randomMap[D.randomIndex]}else{D.nextSlide=D.startingSlide>=(v.length-1)?0:D.startingSlide+1}if(!D.multiFx){var H=i.fn.cycle.transitions[D.fx];
if(i.isFunction(H)){H(z,K,D)}else{if(D.fx!="custom"&&!D.multiFx){f("unknown transition: "+D.fx,"; slideshow terminating");return false}}}var A=K[y];if(D.before.length){D.before[0].apply(A,[A,A,D,true])}if(D.after.length>1){D.after[1].apply(A,[A,A,D,true])}if(D.next){i(D.next).bind(D.prevNextEvent,function(){return o(D,D.rev?-1:1)})}if(D.prev){i(D.prev).bind(D.prevNextEvent,function(){return o(D,D.rev?1:-1)})}if(D.pager||D.pagerAnchorBuilder){d(v,D)}j(D,v);return D}function n(r){r.original={before:[],after:[]};r.original.cssBefore=i.extend({},r.cssBefore);r.original.cssAfter=i.extend({},r.cssAfter);r.original.animIn=i.extend({},r.animIn);r.original.animOut=i.extend({},r.animOut);i.each(r.before,function(){r.original.before.push(this)});i.each(r.after,function(){r.original.after.push(this)})}function c(x){var v,t,s=i.fn.cycle.transitions;if(x.fx.indexOf(",")>0){x.multiFx=true;x.fxs=x.fx.replace(/\s*/g,"").split(",");for(v=0;v<x.fxs.length;v++){var w=x.fxs[v];t=s[w];if(!t||!s.hasOwnProperty(w)||!i.isFunction(t)){f("discarding unknown transition: ",w);x.fxs.splice(v,1);v--}}if(!x.fxs.length){f("No valid transitions named; slideshow terminating.");return false}}else{if(x.fx=="all"){x.multiFx=true;x.fxs=[];for(p in s){t=s[p];if(s.hasOwnProperty(p)&&i.isFunction(t)){x.fxs.push(p)}}}}if(x.multiFx&&x.randomizeEffects){var u=Math.floor(Math.random()*20)+30;for(v=0;v<u;v++){var r=Math.floor(Math.random()*x.fxs.length);x.fxs.push(x.fxs.splice(r,1)[0])}a("randomized fx sequence: ",x.fxs)}return true}function j(s,r){s.addSlide=function(u,v){var t=i(u),w=t[0];if(!s.autostopCount){s.countdown++}r[v?"unshift":"push"](w);if(s.els){s.els[v?"unshift":"push"](w)}s.slideCount=r.length;t.css("position","absolute");t[v?"prependTo":"appendTo"](s.$cont);if(v){s.currSlide++;s.nextSlide++}if(!i.support.opacity&&s.cleartype&&!s.cleartypeNoBg){g(t)}if(s.fit&&s.width){t.width(s.width)}if(s.fit&&s.height&&s.height!="auto"){$slides.height(s.height)}w.cycleH=(s.fit&&s.height)?s.height:t.height();w.cycleW=(s.fit&&s.width)?s.width:t.width();t.css(s.cssBefore);if(s.pager||s.pagerAnchorBuilder){i.fn.cycle.createPagerAnchor(r.length-1,w,i(s.pager),r,s)}if(i.isFunction(s.onAddSlide)){s.onAddSlide(t)}else{t.hide()}}}i.fn.cycle.resetState=function(s,r){r=r||s.fx;s.before=[];s.after=[];s.cssBefore=i.extend({},s.original.cssBefore);s.cssAfter=i.extend({},s.original.cssAfter);s.animIn=i.extend({},s.original.animIn);s.animOut=i.extend({},s.original.animOut);s.fxFn=null;i.each(s.original.before,function(){s.before.push(this)});i.each(s.original.after,function(){s.after.push(this)});var t=i.fn.cycle.transitions[r];if(i.isFunction(t)){t(s.$cont,i(s.elements),s)}};function e(y,r,x,z){if(x&&r.busy&&r.manualTrump){i(y).stop(true,true);r.busy=false}if(r.busy){return}var v=r.$cont[0],B=y[r.currSlide],A=y[r.nextSlide];if(v.cycleStop!=r.stopCount||v.cycleTimeout===0&&!x){return}if(!x&&!v.cyclePause&&((r.autostop&&(--r.countdown<=0))||(r.nowrap&&!r.random&&r.nextSlide<r.currSlide))){if(r.end){r.end(r)}return}if((x||!v.cyclePause)&&(r.nextSlide!=r.currSlide)){var w=r.fx;B.cycleH=B.cycleH||i(B).height();B.cycleW=B.cycleW||i(B).width();A.cycleH=A.cycleH||i(A).height();A.cycleW=A.cycleW||i(A).width();if(r.multiFx){if(r.lastFx==undefined||++r.lastFx>=r.fxs.length){r.lastFx=0}w=r.fxs[r.lastFx];r.currFx=w}if(r.oneTimeFx){w=r.oneTimeFx;r.oneTimeFx=null}i.fn.cycle.resetState(r,w);if(r.before.length){i.each(r.before,function(C,D){if(v.cycleStop!=r.stopCount){return}D.apply(A,[B,A,r,z])})}var t=function(){i.each(r.after,function(C,D){if(v.cycleStop!=r.stopCount){return}D.apply(A,[B,A,r,z])})};r.busy=1;if(r.fxFn){r.fxFn(B,A,r,t,z)}else{if(i.isFunction(i.fn.cycle[r.fx])){i.fn.cycle[r.fx](B,A,r,t)}else{i.fn.cycle.custom(B,A,r,t,x&&r.fastOnEvent)}}r.lastSlide=r.currSlide;if(r.random){r.currSlide=r.nextSlide;if(++r.randomIndex==y.length){r.randomIndex=0}r.nextSlide=r.randomMap[r.randomIndex]}else{var u=(r.nextSlide+1)==y.length;r.nextSlide=u?0:r.nextSlide+1;r.currSlide=u?y.length-1:r.nextSlide-1}if(r.pager){r.updateActivePagerLink(r.pager,r.currSlide,r.activePagerClass)}}var s=0;if(r.timeout&&!r.continuous){s=h(B,A,r,z)}else{if(r.continuous&&v.cyclePause){s=10}}if(s>0){v.cycleTimeout=setTimeout(function(){e(y,r,0,!r.rev)},s)}}i.fn.cycle.updateActivePagerLink=function(r,t,s){i(r).each(function(){i(this).find("a").removeClass(s).filter("a:eq("+t+")").addClass(s)})};function h(w,u,v,s){if(v.timeoutFn){var r=v.timeoutFn(w,u,v,s);while((r-v.speed)<250){r+=v.speed}a("calculated timeout: "+r+"; speed: "+v.speed);if(r!==false){return r}}return v.timeout}i.fn.cycle.next=function(r){o(r,r.rev?-1:1)};i.fn.cycle.prev=function(r){o(r,r.rev?1:-1)};function o(s,v){var r=s.elements;var u=s.$cont[0],t=u.cycleTimeout;if(t){clearTimeout(t);u.cycleTimeout=0}if(s.random&&v<0){s.randomIndex--;if(--s.randomIndex==-2){s.randomIndex=r.length-2}else{if(s.randomIndex==-1){s.randomIndex=r.length-1}}s.nextSlide=s.randomMap[s.randomIndex]}else{if(s.random){s.nextSlide=s.randomMap[s.randomIndex]}else{s.nextSlide=s.currSlide+v;
if(s.nextSlide<0){if(s.nowrap){return false}s.nextSlide=r.length-1}else{if(s.nextSlide>=r.length){if(s.nowrap){return false}s.nextSlide=0}}}}if(i.isFunction(s.prevNextClick)){s.prevNextClick(v>0,s.nextSlide,r[s.nextSlide])}e(r,s,1,v>=0);return false}function d(s,t){var r=i(t.pager);i.each(s,function(u,v){i.fn.cycle.createPagerAnchor(u,v,r,s,t)});t.updateActivePagerLink(t.pager,t.startingSlide,t.activePagerClass)}i.fn.cycle.createPagerAnchor=function(v,w,t,u,x){var s;if(i.isFunction(x.pagerAnchorBuilder)){s=x.pagerAnchorBuilder(v,w)}else{s='<a href="#">'+(v+1)+"</a>"}if(!s){return}var y=i(s);if(y.parents("body").length===0){var r=[];if(t.length>1){t.each(function(){var z=y.clone(true);i(this).append(z);r.push(z[0])});y=i(r)}else{y.appendTo(t)}}x.pagerAnchors=x.pagerAnchors||[];x.pagerAnchors.push(y);y.bind(x.pagerEvent,function(B){B.preventDefault();x.nextSlide=v;var A=x.$cont[0],z=A.cycleTimeout;if(z){clearTimeout(z);A.cycleTimeout=0}if(i.isFunction(x.pagerClick)){x.pagerClick(x.nextSlide,u[x.nextSlide])}e(u,x,1,x.currSlide<v)});if(!/^click/.test(x.pagerEvent)&&!x.allowPagerClickBubble){y.bind("click.cycle",function(){return false})}if(x.pauseOnPagerHover){y.hover(function(){x.$cont[0].cyclePause++},function(){x.$cont[0].cyclePause--})}};i.fn.cycle.hopsFromLast=function(u,t){var s,r=u.lastSlide,v=u.currSlide;if(t){s=v>r?v-r:u.slideCount-r}else{s=v<r?r-v:r+u.slideCount-v}return s};function g(t){function s(u){u=parseInt(u).toString(16);return u.length<2?"0"+u:u}function r(x){for(;x&&x.nodeName.toLowerCase()!="html";x=x.parentNode){var u=i.css(x,"background-color");if(u.indexOf("rgb")>=0){var w=u.match(/\d+/g);return"#"+s(w[0])+s(w[1])+s(w[2])}if(u&&u!="transparent"){return u}}return"#ffffff"}t.each(function(){i(this).css("background-color",r(this))})}i.fn.cycle.commonReset=function(x,u,v,s,t,r){i(v.elements).not(x).hide();v.cssBefore.opacity=1;v.cssBefore.display="block";if(s!==false&&u.cycleW>0){v.cssBefore.width=u.cycleW}if(t!==false&&u.cycleH>0){v.cssBefore.height=u.cycleH}v.cssAfter=v.cssAfter||{};v.cssAfter.display="none";i(x).css("zIndex",v.slideCount+(r===true?1:0));i(u).css("zIndex",v.slideCount+(r===true?0:1))};i.fn.cycle.custom=function(C,w,r,t,s){var B=i(C),x=i(w);var u=r.speedIn,A=r.speedOut,v=r.easeIn,z=r.easeOut;x.css(r.cssBefore);if(s){if(typeof s=="number"){u=A=s}else{u=A=1}v=z=null}var y=function(){x.animate(r.animIn,u,v,t)};B.animate(r.animOut,A,z,function(){if(r.cssAfter){B.css(r.cssAfter)}if(!r.sync){y()}});if(r.sync){y()}};i.fn.cycle.transitions={fade:function(s,t,r){t.not(":eq("+r.currSlide+")").css("opacity",0);r.before.push(function(w,u,v){i.fn.cycle.commonReset(w,u,v);v.cssBefore.opacity=0});r.animIn={opacity:1};r.animOut={opacity:0};r.cssBefore={top:0,left:0}}};i.fn.cycle.ver=function(){return l};i.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,prevNextEvent:"click.cycle",pager:null,pagerClick:null,pagerEvent:"click.cycle",allowPagerClickBubble:false,pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!i.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250,activePagerClass:"activeSlide",updateActivePagerLink:null}})(jQuery);