var Y={anim:YAHOO.util.Anim,cookie:YAHOO.util.Cookie,customEvent:YAHOO.util.CustomEvent,dom:YAHOO.util.Dom,getByClass:YAHOO.util.Dom.getElementsByClassName,easing:YAHOO.util.Easing,effect:YAHOO.widget.ContainerEffect,event:YAHOO.util.Event,json:YAHOO.lang.JSON,lang:YAHOO.lang,region:YAHOO.util.Region,point:YAHOO.util.Point,ua:YAHOO.env.ua,widget:YAHOO.widget},overlay,videoOverlay,lookInsideOverlay,tabbedOverlays=[],videoOverlays=[],SpecialChars=makeHash("backspace",8,"tab",9,"enter",13,"shift",16,"ctrl",17,"alt",18,"pauseBreak",19,"caps",20,"esc",27,"pageUp",33,"pageDown",34,"end",35,"home",36,"leftArrow",37,"upArrow",38,"rightarrow",39,"downArrow",40,"insert",45,"del",46),SessionCache={},ClassToggle,ShowHide,ShowHideSet,Pages,OverlayMgr,TabDisplay,TabbedOverlay,VideoOverlay,Filter,FilteredElements,Carousel,InfoBubble,SelectNav,AddToCartForm,MultipleAddToCart,ProductGallery,teamPages;Y.event.on(window,"load",function(){var d=[{id:"vidProdIntro",url:"http://www.youtube.com/watch v=nzXM2A9Fc7s=1&autoplay=1&showsearch=0&enablejsapi=1&playerapiid=viewVidSToct09"},{id:"vidProdAPK",url:"http://content.screencast.com/users/GroveConsultants/folders/Default/media/db2e0249-5620-45fe-99ca-f0be77f09ceb/flvplayer.swf",width:"481",height:"284",flashvars:"thumb=http://content.screencast.com/users/GroveConsultants/folders/Default/media/db2e0249-5620-45fe-99ca-f0be77f09ceb/FirstFrame.jpg&containerwidth=640&containerheight=498&content= http://content.screencast.com/users/GroveConsultants/folders/Default/media/db2e0249-5620-45fe-99ca-f0be77f09ceb/APKAudioGraphicPresentation_web.mp4",base:"http://content.screencast.com/users/GroveConsultants/folders/Default/media/db2e0249-5620-45fe-99ca-f0be77f09ceb/"},{id:"vidProdCompass",url:"http://content.screencast.com/users/GroveConsultants/folders/Default/media/a4ee7d9f-e0e0-434d-8ea9-ce8f9f1e7d97/flvplayer.swf",width:"481",height:"284",flashvars:"thumb= http://content.screencast.com/users/GroveConsultants/folders/Default/media/a4ee7d9f-e0e0-434d-8ea9-ce8f9f1e7d97/FirstFrame.jpg&containerwidth=640&containerheight=378&content=http://content.screencast.com/users/GroveConsultants/folders/Default/media/a4ee7d9f-e0e0-434d-8ea9-ce8f9f1e7d97/Final%20Prod%20HD_YouTube.mp4 ",base:"http://content.screencast.com/users/GroveConsultants/folders/Default/media/a4ee7d9f-e0e0-434d-8ea9-ce8f9f1e7d97/"},{id:"vidProdIntro",url:"http://www.youtube.com/v/HDxGoAQtMHs&hl=en&fs=1&autoplay=1&showsearch=0&enablejsapi=1&playerapiid=viewVidProdIntro"},{id:"vidProdMtgStartup",url:"http://www.youtube.com/v/_ROWTBm_4pM&hl=en&fs=1&autoplay=1&showsearch=0&enablejsapi=1&playerapiid=viewVidProdMtgStartup"},{id:"vidProdHistory",url:"http://www.youtube.com/v/DKno6lyJH-0&hl=en&fs=1&autoplay=1&showsearch=0&enablejsapi=1&playerapiid=viewVidProdHistory"},{id:"vidProdContextMap",url:"http://www.youtube.com/v/2MF5x5X84WM&hl=en&fs=1&autoplay=1&showsearch=0&enablejsapi=1&playerapiid=viewVidProdContextMap"},{id:"vidProdSPOTMatrix",url:"http://www.youtube.com/v/X6oLgiw1exA&hl=en&fs=1&autoplay=1&showsearch=0&enablejsapi=1&playerapiid=viewVidProdSPOTMatrix"},{id:"vidProdCoverStory",url:"http://www.youtube.com/v/BKyk6ELxxzM&hl=en&fs=1&autoplay=1&showsearch=0&enablejsapi=1&playerapiid=viewVidProdCoverStory"},{id:"vidProd5BoldSteps",url:"http://www.youtube.com/v/twVTGc-v1E8&hl=en&fs=1&autoplay=1&showsearch=0&enablejsapi=1&playerapiid=viewVidProd5BoldSteps"},{id:"vidProdGamePlan",url:"http://www.youtube.com/v/i3XtlniRvmY&hl=en&fs=1&autoplay=1&showsearch=0&enablejsapi=1&playerapiid=viewVidProdGamePlan"},{id:"vidStoryTED2008",url:"http://www.youtube.com/v/MUTTCpzsZpo&hl=en&fs=1&autoplay=1&showsearch=0&enablejsapi=1&playerapiid=viewVidStoryTED2008"}],e={flashvars:"1=1",play:"true",loop:"true",menu:"true",quality:"high",scale:"showall",salign:"",wmode:"window",bgcolor:"#ffffff",devicefont:"false",allowscriptaccess:"always",allowfullscreen:"false"},l={id:"nav",name:"nav",align:"middle"},m={id:"home",name:"home",align:"middle"},n=[],c,h,k,p,g,f,j,b,o="",a;if(Y.dom.get("homepage")){a=Y.cookie.get("homeFlag");e.flashvars=(a!=null&&a=="true")?"disableAnim=true":"disableAnim=false";createCookie("homeFlag","true",1);if(Y.dom.get("noFlashHome")){swfobject.embedSWF("flash/home.swf","noFlashHome","748","465","9.0.0","flash/expressInstall.swf",false,e,m)}e.flashvars="1=1"}if((/netsuite/i).test(document.domain)||(/fusionbot/i).test(document.domain)){e.flashvars="navXml=http://www.grove.com/site/navigation.xml";o="http://www.grove.com/site/"}if(typeof(pageId)!="undefined"){e.flashvars+="&pageID="+pageId+"&disableOpenAnim=1"}swfobject.embedSWF(o+"flash/nav.swf","noFlashNav","200","480","9.0.0",o+"flash/expressInstall.swf",false,e,l);Y.dom.batch(Y.getByClass("_newwin","a"),function(i){Y.event.on(i,"click",function(q){window.open(this.href,"grovewin");Y.event.preventDefault(q)})});Y.dom.batch(Y.getByClass("calloutLink","span"),function(i){Y.event.on(i,"mouseover",function(q){Y.dom.setStyle(this,"backgroundColor","#f7f7f4")});Y.event.on(i,"mouseout",function(q){Y.dom.setStyle(this,"backgroundColor","transparent")});Y.event.on(i,"click",function(r){var q=this.getElementsByTagName("a");if(q.length>0){window.location=q[0].href}})});Y.dom.batch(Y.getByClass("affiliateLink","span"),function(i){Y.event.on(i,"mouseover",function(q){Y.dom.setStyle(this,"backgroundColor","#f7f7f4")});Y.event.on(i,"mouseout",function(q){Y.dom.setStyle(this,"backgroundColor","transparent")});Y.event.on(i,"click",function(r){var q=this.getElementsByTagName("a");if(q.length>0){window.location=q[0].href}})});Y.dom.batch(Y.getByClass("staffLink","a"),function(i){n[n.length]=new ShowHide(i,Y.getByClass(i.id))});new ShowHideSet(n);teamPages=new Pages(Y.getByClass("page","div"),Y.getByClass("pageLink","span"));Y.dom.batch(Y.getByClass("showHide"),function(i){new ShowHide(i,Y.getByClass(i.id))});c=Y.dom.get("faqFilter");if(c){Y.dom.batch(c.getElementsByTagName("dl"),function(r){if(r.className!=""){var q=[],i;Y.dom.batch(Y.dom.getChildren(r),function(s){switch(s.tagName.toLowerCase()){case"dt":i=s.getElementsByTagName("a")[0];break;case"dd":q[q.length]=new ShowHide(i,[s]);break}});new ShowHideSet(q)}})}Y.dom.batch(Y.getByClass("printLink","a"),function(i){Y.event.on(i,"click",function(q){window.print();Y.event.preventDefault(q)})});Y.dom.batch(Y.getByClass("autotab","input"),function(i){Y.event.on(i,"keyup",function(r){if(isSpecialChar(Y.event.getCharCode(r))){return}if(this.value.length>=this.maxLength){for(var q=0;qthis.FADED_OPACITY)){g[g.length]=c}}}this.fadeElements(h,g)},fadeElements:function(b,a){if(this.anim){this.anim.stop()}this.anim=fadeAnim=new Y.anim(null,null,this.DURATION);fadeAnim.onTween.subscribe(function(c,d){Y.dom.setStyle(b,"opacity",this.EASE(d[0].currentFrame,this.FADED_OPACITY,1-this.FADED_OPACITY,this.DURATION*1000));Y.dom.setStyle(a,"opacity",this.EASE(d[0].currentFrame,1,this.FADED_OPACITY-1,this.DURATION*1000))},this,true);fadeAnim.onComplete.subscribe(function(){this.anim=null},this,true);fadeAnim.animate()}};Carousel=function(a){this.SEL_PAGE_CLASS="sel";this.ITEMS_PER_PAGE=4;this.DURATION=0.7;this.EASE=Y.easing.easeOutStrong;this.DISABLED_CLASS="disabled";this.carousel=Y.dom.get(a);this.itemContainer=Y.getByClass("items","ul",this.carousel)[0];this.items=this.itemContainer.getElementsByTagName("li");this.nav=Y.getByClass("nav","tr",this.carousel)[0];this.prevBtn=Y.getByClass("prev","a",this.carousel)[0];this.nextBtn=Y.getByClass("next","a",this.carousel)[0];this.navItems=[];this.counter=Y.getByClass("counter","span",this.carousel)[0];this.itemWidth=getElementWidth(this.items[0])+parseInt(Y.dom.getStyle(this.items[0],"margin-right"))+parseInt(Y.dom.getStyle(this.items[0],"margin-left"));this.currPage=0;this.loadNav();this.updateNav(this.currPage);this.updateCounter()};Carousel.prototype={loadNav:function(){this.numPages=Math.ceil(this.items.length/this.ITEMS_PER_PAGE);if(this.numPages<2){return}var b,a;for(b=0;b=this.numPages-1){Y.dom.addClass(this.nextBtn,this.DISABLED_CLASS)}else{Y.dom.removeClass(this.nextBtn,this.DISABLED_CLASS)}},updateCounter:function(){this.counter.innerHTML=this.items.length},clickNavHandler:function(b,a){this.goToPage(a);Y.event.stopEvent(b)},clickPrevHandler:function(a){if(this.currPage>0){this.goToPage(this.currPage-1)}Y.event.stopEvent(a)},clickNextHandler:function(a){if(this.currPage 0) { //var ddlItem = this.quantityFields[i].id.replace('qty','item'); //multi += document.getElementById(ddlItem).options[document.getElementById(ddlItem).selectedIndex].value + ',' + this.quantityFields[i].value + ';'; multi += addToCartSuppliesFormSelects[i].options[addToCartSuppliesFormSelects[i].selectedIndex].value + ',' + this.quantityFields[i].value + ';'; } } document.getElementById('multi').value = multi; } else { var addToCartFormSelects = Y.getByClass("item","select",this.form); for(var i=0; i < this.quantityFields.length; i++) { if(this.form.id == "addToCart") { if(parseInt(this.quantityFields[i].value, 10) > 0) { if(this.quantityFields[i].id == "leader") { multi += this.form['leaderItemId'].value + ',' + this.quantityFields[i].value + ';'; } else { var ddlItem = this.quantityFields[i].id.replace('qty','item'); multi += addToCartFormSelects[i].options[addToCartFormSelects[i].selectedIndex].value + ',' + this.quantityFields[i].value + ';'; } } } else if(this.form.id == "download") { if(parseInt(this.quantityFields[i].value, 10) > 0) { if(this.quantityFields[i].id == "leaderDl") { //multi += this.form['leaderDlItemId'].value + ',' + this.quantityFields[i].value + ';'; multi += this.form['leaderDlist'].options[this.form['leaderDlist'].selectedIndex].value + ',' + this.quantityFields[i].value + ';'; } else if(this.quantityFields[i].id == "dlQty") { multi += this.form['dl'].options[this.form['dl'].selectedIndex].value + ',' + this.quantityFields[i].value + ';'; } } } } ////// else ////// { ////// for(var i=0; i < this.quantityFields.length; i++) ////// { ////// if(this.form.id == "addToCart") ////// { ////// if(parseInt(this.quantityFields[i].value, 10) > 0) ////// { ////// if(this.quantityFields[i].id == "leader") ////// { ////// multi += this.form['leaderItemId'].value + ',' + this.quantityFields[i].value + ';'; ////// } ////// else ////// { ////// var ddlItem = this.quantityFields[i].id.replace('qty','item'); ////// multi += this.form[ddlItem].options[this.form[ddlItem].selectedIndex].value + ',' + this.quantityFields[i].value + ';'; ////// } ////// } ////// } ////// else if(this.form.id == "download") ////// { ////// if(this.quantityFields[i].id == "leaderDl") ////// { ////// multi += this.form['leaderDlItemId'].value + ',' + this.quantityFields[i].value + ';'; ////// } ////// else if(this.quantityFields[i].id == "dlQty") ////// { ////// multi += this.form['dl'].options[this.form['dl'].selectedIndex].value + ',' + this.quantityFields[i].value + ';'; ////// } ////// } ////// } this.form['multi'].value = multi; } } /* RITWIK - END */ } ,onChangeQuantity:function(a){this.updateSubmitButtons()},onClickCheckRequired:function(a){this.updateSubmitButtons()},onChangeMultiAddToCart:function(a){this.updateQuantityFields();this.updateSubmitButtons()},updateQuantityFields:function(){this.quantityFields=Y.getByClass(this.QUANTITY_CLASS,"input",this.form);Y.event.removeListener(this.quantityFields,"change");Y.event.on(this.quantityFields,"change",this.onChangeQuantity,this,true)},updateSubmitButtons:function(){if(this.validate()){Y.dom.removeClass(this.submitBtns,"disabled")}else{Y.dom.addClass(this.submitBtns,"disabled")}},validate:function(){return(this.validateCheckRequired()&&(this.getTotal()>0))},validateCheckRequired:function(){for(var a=0;a1){this.deleteRow(b)}Y.event.stopEvent(a)},addRow:function(){var a=this.template.cloneNode(true),b=this.rows[this.rows.length-1];this.initRow(a);Y.dom.insertAfter(a,b);this.rows[this.rows.length]=a;Y.dom.removeClass(Y.getByClass(this.DELETE_CLASS,"input",this.container),"disabled");if(this.rows.length>=this.maxRows){Y.dom.addClass(this.addBtn,"disabled")}this.onadd.fire(a)},deleteRow:function(d){var b=[],a,c;for(a=0;a0){this.count=c[0]}this.controls=Y.getByClass(this.CONTROLS_CLASS,"div",this.gallery)[0];this.prevBtn=Y.getByClass(this.PREV_CLASS,"a",this.controls)[0];this.nextBtn=Y.getByClass(this.NEXT_CLASS,"a",this.controls)[0];this.images=this.gallery.getElementsByTagName("img");this.currIndex=0;for(b=0;b=(this.images.length-1))?0:(this.currIndex+1))}Y.event.stopEvent(a)},showImage:function(b){if(b==this.currIndex){return}var a=new Y.anim(null,null,this.DURATION);a.onTween.subscribe(function(c,d){Y.dom.setStyle(this.images[this.currIndex],"opacity",this.EASE(d[0].currentFrame,1,-1,this.DURATION*1000));Y.dom.setStyle(this.images[b],"opacity",this.EASE(d[0].currentFrame,0,1,this.DURATION*1000))},this,true);a.onComplete.subscribe(function(){Y.dom.removeClass(this.images[this.currIndex],this.SHOWN_CLASS);this.currIndex=b;this.updateCount();this.isAnimating=false},this,true);Y.dom.setStyle(this.images[b],"opacity",0);Y.dom.addClass(this.images[b],this.SHOWN_CLASS);this.isAnimating=true;a.animate()},updateCount:function(){if(this.count){this.count.innerHTML=(this.currIndex+1)+this.COUNT_DELIM+this.images.length}}};ProductGallery=function(a){this.SHOWN_CLASS="shown";this.PROMPT_CLASS="prompt";this.CONTROLS_CLASS="control";this.CAPTION_CLASS="caption";this.PANEL_CLASS="panel";this.NAME_CLASS="name";this.COUNT_CLASS="count";this.PREV_CLASS="prev";this.NEXT_CLASS="next";this.CAPTION_HEIGHT=21;this.COUNT_DELIM=" of ";this.CONTROL_DURATION=0.4;this.CONTROL_EASE=Y.easing.easeOut;this.IMAGE_DURATION=0.3;this.IMAGE_EASE=Y.easing.easeIn;this.gallery=Y.dom.get(a);if(!this.gallery){return}this.displayPrompt=Y.getByClass(this.PROMPT_CLASS,"div",this.gallery)[0];this.caption=Y.getByClass(this.CAPTION_CLASS,"div",this.gallery)[0];this.captionPanel=Y.getByClass(this.PANEL_CLASS,"div",this.gallery)[0];this.captionName=Y.getByClass(this.NAME_CLASS,"*",this.caption)[0];this.captionCount=Y.getByClass(this.COUNT_CLASS,"*",this.caption)[0];this.controls=Y.getByClass(this.CONTROLS_CLASS,"div",this.gallery)[0];this.prevBtn=Y.getByClass(this.PREV_CLASS,"a",this.controls)[0];this.nextBtn=Y.getByClass(this.NEXT_CLASS,"a",this.controls)[0];this.images=this.gallery.getElementsByTagName("img");this.currIndex=0;for(var b=0;b=(this.images.length-1))?0:(this.currIndex+1))}Y.event.stopEvent(a)},showControls:function(){this.showAnim=crossFadeAnim=new Y.anim(null,null,this.CONTROL_DURATION);crossFadeAnim.onTween.subscribe(function(a,b){Y.dom.setStyle(this.displayPrompt,"opacity",this.CONTROL_EASE(b[0].currentFrame,1,-1,this.CONTROL_DURATION*1000));Y.dom.setStyle(this.controls,"opacity",this.CONTROL_EASE(b[0].currentFrame,0,1,this.CONTROL_DURATION*1000));Y.dom.setStyle(this.caption,"height",this.CONTROL_EASE(b[0].currentFrame,0,this.CAPTION_HEIGHT,this.CONTROL_DURATION*1000)+"px");Y.dom.setStyle(this.captionPanel,"top",this.CONTROL_EASE(b[0].currentFrame,-1*this.CAPTION_HEIGHT,this.CAPTION_HEIGHT,this.CONTROL_DURATION*1000)+"px")},this,true);crossFadeAnim.onComplete.subscribe(function(){Y.dom.setStyle(this.displayPrompt,"display","none");this.showAnim=null},this,true);Y.dom.setStyle(this.controls,"opacity",0);Y.dom.setStyle(this.controls,"display","block");Y.dom.setStyle(this.caption,"height","0px");Y.dom.setStyle(this.captionPanel,"top","-"+this.CAPTION_HEIGHT+"px");Y.dom.setStyle(this.caption,"display","block");this.isShown=true;crossFadeAnim.animate()},hideControls:function(){this.hideAnim=crossFadeAnim=new Y.anim(null,null,this.CONTROL_DURATION);crossFadeAnim.onTween.subscribe(function(a,b){Y.dom.setStyle(this.displayPrompt,"opacity",this.CONTROL_EASE(b[0].currentFrame,0,1,this.CONTROL_DURATION*1000));Y.dom.setStyle(this.controls,"opacity",this.CONTROL_EASE(b[0].currentFrame,1,-1,this.CONTROL_DURATION*1000));Y.dom.setStyle(this.caption,"height",this.CONTROL_EASE(b[0].currentFrame,this.CAPTION_HEIGHT,-1*this.CAPTION_HEIGHT,this.CONTROL_DURATION*1000)+"px");Y.dom.setStyle(this.captionPanel,"top",this.CONTROL_EASE(b[0].currentFrame,0,-1*this.CAPTION_HEIGHT,this.CONTROL_DURATION*1000)+"px")},this,true);crossFadeAnim.onComplete.subscribe(function(){Y.dom.setStyle(this.controls,"display","none");Y.dom.setStyle(this.caption,"display","none");this.hideAnim=null},this,true);Y.dom.setStyle(this.displayPrompt,"opacity",0);Y.dom.setStyle(this.displayPrompt,"display","block");this.isShown=false;crossFadeAnim.animate()},showImage:function(b){if(b==this.currIndex){return}var a=new Y.anim(null,null,this.IMAGE_DURATION);a.onTween.subscribe(function(c,d){Y.dom.setStyle(this.images[this.currIndex],"opacity",this.IMAGE_EASE(d[0].currentFrame,1,-1,this.IMAGE_DURATION*1000));Y.dom.setStyle(this.images[b],"opacity",this.IMAGE_EASE(d[0].currentFrame,0,1,this.IMAGE_DURATION*1000))},this,true);a.onComplete.subscribe(function(){Y.dom.removeClass(this.images[this.currIndex],this.SHOWN_CLASS);this.currIndex=b;this.updateCaption();this.isAnimating=false},this,true);Y.dom.setStyle(this.images[b],"opacity",0);Y.dom.addClass(this.images[b],this.SHOWN_CLASS);this.isAnimating=true;a.animate()},updateCaption:function(){this.captionCount.innerHTML=(this.currIndex+1)+this.COUNT_DELIM+this.images.length;this.captionName.innerHTML=this.images[this.currIndex].getAttribute("alt")}};