	//function for AddThis buttons
	function addthis_proxy(arg1, arg2, arg3, arg4, left) {
		addthis_pub = 'scjred'; 
		addthis_logo = 'http://www.scjohnson.com/Images/logo_scj_top.gif';
		addthis_logo_background = '011d8a';
		addthis_logo_color = 'ffffff';
		addthis_brand = 'S.C. Johnson';
		addthis_options = 'email, favorites, facebook, myspace, google, digg, delicious, live, stumbleupon, reddit, mixx, more';
		
		if( left )
		{
			addthis_offset_left = 0;
			addthis_offset_top = 0;
		} 
		else 
		{
			addthis_offset_left = -160;
			addthis_offset_top = 3;// ie6 fix
		}
		
		addthis_open(arg1, arg2, arg3, arg4);
	}

	//e-mail Press Release, Glossary etc.
	function sendPR() {

	var curUrl = window.location;
	var subj = $(".dateSpan ~ h2, h2 span").html();
	
	var removeAllOther = /\s*&{1}\w*;\s*/g;
	var swapAnd1 = /&amp;/g;
	var swapAnd2 = /&\s/g;
	
	if (removeAllOther) {
		adjSubj = subj.replace(removeAllOther , "");
	}
		var adjSubj = subj.replace(swapAnd1, "and").replace(swapAnd2, "and");
	
	document.location = "mailto:?subject=" + escape(adjSubj) + "&body="+ escape(curUrl);

	}

	function openPopup(url, dims) {
		
		if (dims) {
			window.open(url, '', dims + ',height=650,scrollbars=yes,resizable=yes,status=yes');	
		}
		else {
			window.open(url, '', 'width=600,height=650,scrollbars=yes,resizable=yes,status=yes');
		}
		pageTracker._trackPageview(url);		
	}
	
	function resizeTabContainer()
	{
		$('#tabContainer').css( 'height', $('.windexTab.current').outerHeight() );
	}

// doc.ready begin
$(document).ready(function() {
	
		// product carousel
		
		var carouselUL = $('#brand-carousel');
		var carouselItem = $('#brand-carousel li'); // var for LI
		var liWidth = carouselItem.outerWidth(true); // var for LI width
		var ulWidth = liWidth * carouselItem.length; // var for UL width
		var carouselWindow = liWidth * 10;
		var stopOn = Math.floor(carouselItem.length / 10);
		 /* captures last item the carousel should stop on*/
		var prev = $('.arrowLeftCarousel a'); // var for previous button
		var next = $('.arrowRightCarousel a'); // var for next button
		var listID = 0; // var for ID counter
		
		carouselUL.css('width', ulWidth); // creates width of video list
		prev.css({opacity : .3});
		
		//console log info
		
//			 console.log('total ul width: ' + ulWidth);
//			 console.log('carousel window width: ' + carouselWindow);
//			 console.log('total items: ' + carouselItem.length);
//			 console.log('should stop on: ' + stopOn);
//			 console.log('list ID: ' + listID);
		
		// user clicks on previous

		prev.click(function(event) {
		  if (listID!=0) {
			event.preventDefault(); // prevents url linkage
			listID--; // subtracts for ID count
		    var moveLeft = - (carouselWindow * listID) ;
// console.log('list ID: ' + listID) // tallies list ID number
// console.log('moves left: ' + moveLeft); // left position of UL
			carouselUL.animate({'left' : moveLeft}, 400); // moves UL left at 200
		    }
		  else {
			return false;
		  };
		  
		  // if statements for button opacity
		  if (listID==0) {
			prev.css({opacity : .3});
			}
			else {
				prev.css({opacity : 1});
				};
		  if (listID < stopOn) {
			next.css({opacity : 1});
			};
		});
		
		// user clicks on next
		next.click(function(event) {
		  if (listID!=stopOn) { 
			event.preventDefault(); // prevents url linkage
			listID++;
		    var moveRight = - (carouselWindow * listID) ;
// console.log('list ID: ' + listID) // tallies list ID number
// console.log('moves left: ' + moveRight) // left position of UL
			carouselUL.animate({'left' : moveRight}, 400); // moves UL right at 200
			}		
		  else {
		    return false;
		  };
		  		  
		  // if statements for button opacity
		  if (listID==stopOn) {
			next.css({opacity : .3});
			}
			else {
				next.css({opacity : 1});
				};
				
		  if (listID > 0) { 
			prev.css({opacity : 1});
			};
		  
		});
		
		// brand hovers 
		
		$('.brand-carousel-thumb').css({opacity: .8});
		$('.brand-carousel-thumb').mouseover(function(){$(this).stop().animate({opacity: 1}, 'fast')});
  		$('.brand-carousel-thumb').mouseout(function() {$(this).stop().animate({opacity: .8}, 'fast')});

		
		// FAQ accordion
		
		$('.faq_answer p:last-child').css('margin-bottom', '0'); // removing margin from bottom for IE support
		var questionHeader = $('.faq_question-and-answer h3');
		$('.faq_answer').hide();
		questionHeader.eq(0).addClass('current-faq').children('img').attr('src', '/Images/bg_answer_current.gif');
		$('.faq_question-and-answer .faq_answer').eq(0).show();
		questionHeader.hover(
			function(){
				$(this).css({'cursor': 'pointer', 'text-decoration': 'underline'})
				},
			function(){
				$(this).css({'cursor': 'pointer', 'text-decoration': 'none'})
				});
			questionHeader.click(function() {
			$(this).children('img').attr('src', '/Images/bg_answer_current.gif');
			$(this).parent().siblings('.faq_question-and-answer').children('h3').children('img').attr('src', '/Images/bg_answer_non-current.gif');
			$(this).parent().siblings('.faq_question-and-answer').children('.current-faq').next('.faq_answer').slideUp(500);
			$(this).addClass('current-faq').next('.faq_answer').slideDown(500);
			});
		
		// product detail rollovers
		
		
		$('.product-rollover_detail').css('opacity', '0');
		$('.product-image').hover(
			function() { // mouse over
    			var halfProductWidth = $(this).outerWidth() / 2;
				var xCoor = $(this).position().left;
				var productLeft = (halfProductWidth - 93);
				$(this).next('.product-rollover_detail').css({'left': productLeft});
				$(this).next('.product-rollover_detail').animate({
								opacity: 1,
								bottom: 135
								}, 500);
			},
			function() { // mouse out
				$(this).next('.product-rollover_detail').animate({
								opacity: 0,
								bottom: 145
								}, 500);
			});
		
	    //news feed rotation (home page)ter10
		
	    var curIndex = 0;

	    if ($(".newsTitleDiv div").length) {

	        var newsList = $(".newsTitleDiv div");
	        $(".newsTitleDiv div:first-child").css("display", "block");

	    }

	    var stopAnimation = false;
	    var timeOut = 0;

	    function doFadeOut() {

	        if (stopAnimation == false) {
	            $(newsList[curIndex]).fadeOut(500);
	            curIndex = ((curIndex >= newsList.length - 1) ? (0) : (curIndex + 1));
	            clearTimeout(timeOut);
	            timeOut = setTimeout(doFadeIn, 500);
	        }
	    }

	    function doFadeIn() {

	        if (stopAnimation == false) {
	            $(newsList[curIndex]).fadeIn(500);
	            clearTimeout(timeOut);
	            timeOut = setTimeout(doFadeOut, 4000);
	        }
	    }

	    if ($(".newsTitleDiv div").length) {

	        timeOut = setTimeout(doFadeOut, 4000);


	        newsList.hover(
			function() {
			    stopAnimation = true;
			    clearTimeout(timeOut);
			},
			function() {
			    stopAnimation = false;
			    setTimeout(doFadeOut, 4000);
			}
	   );
	    }


	    //menu drop down
	    $(".mainMenuItem").children(".subMenu").css({
	        'display': 'none',
	        'opacity': 0
	    });

	    $(".mainMenuItem").hover(

		function() {

		    var image = $(this).find("a img")[0];
		    image.src = image.src.replace("_off", "_hover");
		    image.src = image.src.replace("_on", "_hover");


		    var $subMenu = $(this).children(".subMenu");
		    $subMenu.css('display', 'block');


		    if ($(this).data("isPlaying")) {
		        $subMenu.stop();
		    }
		    else {
		        $(this).data("isPlaying", true);
		    }

		    $subMenu.animate(
				{ opacity: 1 },
				{ queue: false,
				    duration: 300
				}
			);


		},

		function() {

		    var image = $(this).find("a img")[0];
		    if ($(image).hasClass("activeMenu")) {

		        image.src = image.src.replace('_hover', '_on');
		    }
		    image.src = image.src.replace("_hover", "_off");


		    var $subMenu = $(this).children(".subMenu");

		    $subMenu.stop();
		    $subMenu.animate(
				{ opacity: 0 },
				{ queue: false,
				    duration: 300,
				    complete: function() {
				        $(this).css('display', 'none');
				    }
				}
			);

		}
	);

	    //adding css classes to first and last Items
	    $(".module179wLinkList .module179wDotItem:first-child").addClass("firstItem");
	    $(".module179wLinkList .module179wDotItem:last-child").addClass("lastItem");
	    $('.get-tips_consumer-tips:last').addClass("lastItem");
		$(".firstP + .module-box").css("margin-top", "30px");


	    //simple image rollover
	    $(".utilNav a img, #footerLinksDiv a img, .tabsDiv a img").hover(
		function() {
		    this.src = this.src.replace("_off", "_on");
		},
		function() {
		    if (!($(this).hasClass("activeNav"))) {

		        this.src = this.src.replace("_on", "_off");

		    }
		}
	);


	    //rollover for search buttons
	    $(".searchBtn").hover(
		function() {
		    $(this).css("background", "url(/images/btn_search_hover.gif) no-repeat left top");
		},
		function() {
		    $(this).css("background", "url(/images/btn_search.gif) no-repeat left top");
		}
	);

	    $(".searchDivFullPage .searchBtnBlue").hover(
			function() {
			    $(this).css("background", "url(/images/btn_submit_arrow_hover.gif) no-repeat left top");
			},
		function() {
		    $(this).css("background", "url(/images/btn_submit_arrow.gif) no-repeat left top");
		}
	);

	    //rollover for submit buttons
	    $(".btnLink").hover(

		function() {
		    $(this).children(".left").css("background", "url(/images/bg_btn_left_on.gif) no-repeat left top");
		    $(this).children(".center").css("background", "url(/images/bg_btn_center_on.gif) repeat-x left top");
		    $(this).children(".right").css("background", "url(/images/bg_btn_right_on.gif) no-repeat left top");
		},
		function() {
		    $(this).children(".left").css("background", "url(/images/bg_btn_left.gif) no-repeat left top");
		    $(this).children(".center").css("background", "url(/images/bg_btn_center.gif) repeat-x left top");
		    $(this).children(".right").css("background", "url(/images/bg_btn_right.gif) no-repeat left top");
		}

	);



	    //collapse/expand behavior
	    $(".module179wExpandItem:last-child").addClass("lastExpandItem");
	    $(".expandLinkDiv").click(function() {

	        var img = $(this).find("img")[0];
	        var par = $(this).parent();
	        var list = $(par).children(".expandContentDiv");

	        if ($(list).css("display") == "none") {

	            var ListStatus = $(list).css("display", "block");
	            img.src = img.src.replace("plus", "minus");
	            img.alt = img.alt.replace("Expand", "Collapse");
	        }
	        else {

	            var ListStatus = $(list).css("display", "none");
	            img.src = img.src.replace("minus", "plus");
	            img.alt = img.alt.replace("Collapse", "Expand");
	        }
	    });



	    //set the height for tabs
	    var wrapHeight = $(".tabsDivWrap").height();

	    if (wrapHeight == 30) {
	        $(".tabsDiv div").css("height", "13px");
	        $("span.leftRoundCorner, span.rightRoundCorner").css("height", "30px");
	    }
	    else if (wrapHeight >= 41 && wrapHeight < 53) {
	        $(".tabsDiv div").css("height", "26px");
	        $("span.leftRoundCorner, span.rightRoundCorner").css("height", "43px");
	    }
	    else if (wrapHeight >= 53) {
	        $(".tabsDiv div").css("height", "39px");
	        $("span.leftRoundCorner, span.rightRoundCorner").css("height", "56px");
	    }

	    //set styles for active tabs
	    $(".tabsDiv div").click(function() {

	        var id = $(this).attr("id").split('_')[1];

	        //switch tabs background
	        $(".tabsDiv div").removeClass("activeTab");
	        $(".tabsDiv div").removeClass("hoverTab");
	        $(".tabsDiv div").css("color", "#777");
	        $(".leftRoundCorner").removeClass("leftRoundCornerActive");
	        $(".rightRoundCorner").removeClass("rightRoundCornerActive");
	        $(this).addClass("activeTab");
	        $(this).css("color", "#fff");


	        //set the corners to active state
	        if ($(this).hasClass("firstTab")) {
	            $(".leftRoundCorner").addClass("leftRoundCornerActive");
	        }
	        else if ($(this).hasClass("lastTab")) {
	            $(".rightRoundCorner").addClass("rightRoundCornerActive");
	        };


	        //show/hide tabs content
	        $(".tabsContentDivHolder > div").hide();
	        $(".tabsContentDivHolder div#tab_" + id + "_content").show();

	    });

	    //hover event for tabs
	    $(".tabsDiv div").hover(
		function() {

		    if (!$(this).hasClass("activeTab")) {

		        $(this).css("color", "#006dea");
		    };
		},
		function() {

		    if (!$(this).hasClass("activeTab")) {

		        $(this).css("color", "#777");
		    };

		}
	);


	    // Around the home tabs

	    // initial set to active state - first item
	    $(".tabImgsWrap img").css({ 'opacity': '.50', 'filter': 'alpha(opacity=50)' });
	    $(".tabImgsWrap img.activeItem").css({ 'opacity': '1', 'filter': 'alpha(opacity=100)', 'background': 'url(/images/bg_greenShadow.gif)  no-repeat bottom center' });
	    $("div.activeItem").show();

	    // show/hide elements
	    $(".tabImgsWrap img").hover(

	function() {
	    $("img.activeItem").css({ 'opacity': '1', 'filter': 'alpha(opacity=100)' });
	    $("div.activeItem").hide();
	    var id = $(this).attr("id");
	    $("#" + id + "_desc").show();

	    $(".tabImgsWrap img").css({ 'opacity': '.50', 'filter': 'alpha(opacity=50)' });
	    $(this).css({ 'opacity': '1', 'filter': 'alpha(opacity=100)', 'background': 'url(/images/bg_greenShadow.gif)  no-repeat bottom center' });

	},

	function() {
	    var id = $(this).attr("id");
	    $("#" + id + "_desc").hide();
	    $(".tabImgsWrap img").css({ 'opacity': '1', 'filter': 'alpha(opacity=100)', 'background': 'none' });

	}
	);

	    $(".tabImgsWrap").bind("mouseleave", function() {

	        var imgNum = $(".tabImgsWrap img").length;
	        for (var i = 1; i <= imgNum; ) {

	            $(".descriptionDiv div#img_" + i + "_desc").show();
	            $(".tabImgsWrap img#img_" + i).css({ 'opacity': '1', 'filter': 'alpha(opacity=100)', 'background': 'url(/images/bg_greenShadow.gif)  no-repeat bottom center' });
	            i = i + 3;
	        }
	        /*

		var $curContent = $("#"+slideControl1.getCurrentContent());

		$curContent.find(".tabImgsWrap img:first, .descriptionDiv div:first").addClass("activeItem");
	        $curContent.find(".descriptionDiv div:first").show();
	        $curContent.find(".tabImgsWrap img:first").css({'opacity' : '1' , 'filter' : 'alpha(opacity=100)' , 'background' : 'url(/images/bg_greenShadow.gif)  no-repeat bottom center'});
	        */
	    }
	);


	    // popup links behavior
		$("a.popupLink").click(function(e) {
		
			e.preventDefault();
			var url = $(this).attr("href");
			window.open(url, '', 'width=600,height=650,scrollbars=yes,resizable=yes,status=yes');
			
			//pageTracker._trackPageview(url);
			return false;
		
		});

	    //__________________________
	    /**
	    *@author:Josh Bennett
	    **/
	    //__________________________

	    //defining tabs content width and left marging
	    if ($(".tabsSlideContentHolderDiv").length) {

	        var slideTabW = $(".tabsSlideContentHolderDiv > div").width();
	        var elemNum = $(".tabsSlideContentHolderDiv > div").length;
	        var slideHolderW = $(".tabsSlideContentHolderDiv").css("width", elemNum * slideTabW);
	        var position = Math.abs(parseInt($(".tabsSlideContentHolderDiv").css("margin-left")));

	    }

	    var tmpList = (function() {
	        var returnArray = [];
	        for (var i = 1; i <= elemNum; i++) {
	            returnArray.push({
	                tab: "#tab_" + i,
	                content: "#tab_" + i + "_content"
	            });
	        }
	        return returnArray;
	    })()

	    var slideControl1 = window.slideControl1 = new scjControls.SlideControlWithImageTabs({
	        leftSlider: ".arrowLeft",
	        rightSlider: ".arrowRight",
	        slideDiv: "#slideHolderDiv",
	        displayList: tmpList
	    });
	
// document ready ends
	
});
	var replyMax = 500;
	function charLimit(el) {
		if(el.value.length > replyMax) return false;
		return true;
	}
		
	function characterCount(el) {
		var charCount = document.getElementById('replyRemaining');
		if(el.value.length > replyMax) {
			el.value = el.value.substring(0, replyMax);
		};
		if (charCount) {
			charCount.innerHTML = replyMax - el.value.length;
		};
		return true;
	};

(function(){
	var scjControls = window.scjControls = {
	    slideSpeed : 300,

	    /**
	    *    SlideControlWithImageTabs( controls )
	    *    Use to construct a new slideControlWithImageTabs object
	    *
	    *    @param controls - a object containing the controls options
	    *
	    *    OPTIONS:(controls)
	    *    leftSlider - dom element representing the left slide functionality
	    *    rightSlider - dom element representing the left slide functionality
	    *    slideDiv - div that will be slid when clicking on tabs or sliders
	    *    displayList - object mapping tabs to the content it displays
	    *             
	    *             displayList OPTIONS:
	    *                   tab -     (optional) this will hold a pointer to a tab that relates to the content
	    *                             If not specified
	    *                   content - pointer to the content area that could relate to the optional tab list
	    *                             content will be slid in the order that it is defined, so be careful 
	    *                             how you define the display list aray
	    *    
	    *
	    *    EXAMPLE:
	    *        var slideControl1 = new scjControls.slideControlWithImageTabs({
	    *            leftSlider: document.getElementById("leftSlider"),
	    *            rightSlider: document.getElementById("rightSlider"),
	    *            slideDiv: "slideDiv",
	    *            displayList : [
	    *                {tab: "tab1" , 
        *                 content: "content1"},
        *                 
        *                {tab: "tab2" , 
        *                 content: "content2"}
	    *            ],
	    *        })
	    **/
	    
	    SlideControlWithImageTabs : function(controls){
            //___INSTANCE VARS___
            var c = controls;
            var t = this;
            var currLeft = 0;
            var currentContent = null;
            
            t.slideAmmount = 0;
            t.slideSpeed = scjControls.slideSpeed;
            t.leftSlider = c.leftSlider;
            t.rightSlider = c.rightSlider;
            t.slideDiv = c.slideDiv;
	        t.displayList = c.displayList;
	        t.slideMap = {};
	        t.numberOfSlides = 0;
	        t.currentLeftPos = 0;
	        t.hasPrevChils = false;
	        t.hasNextChild = false;
	        t.arrowFadeAmmount = '0.3';
	        t.firstSlide = null;
	        t.lastSlide = null;
                        
            
            //___INIT___
            var init = function(){
                
                if(t.displayList.length <= 0){
                    //throw "NO DISPLAY LIST OBJECTS!!!";
                    return;
                }

                currentContent = $(t.displayList[0].content).attr('id');

                for( var i=0; i< t.displayList.length; i++){
                    
                    t.numberOfSlides++;
                    
                    // IF NO CONTENT DIV EXIT LOOP
                    if( !$(t.displayList[i].content).length>0 ) 
                        break;
                    
                    //SET SLIDE MAP
                    t.slideMap[ (($(t.displayList[i].tab).length > 0) ? $(t.displayList[i].tab).attr('id') : "noTabs") ] = 
                    t.slideMap[$(t.displayList[i].content).attr('id')] = 
                    {
                        tab : t.displayList[i].tab,
                        content : t.displayList[i].content,
                        left : currLeft,
                        nextContent: (t.displayList[i+1] && t.displayList[i+1].content) ? t.displayList[i+1].content : null,
                        prevContent: (t.displayList[i-1] && t.displayList[i-1].content) ? t.displayList[i-1].content : null
                    }
                    
                    //ATTACH CLICK EVENT TO TAB IF TAB EXISTS
                    if( $(t.displayList[i].tab).length>0 )
                        $(t.displayList[i].tab).bind("click", t.handleTabClick);

                    currLeft += $(t.displayList[i].content).width();
                }
                
                if( $(t.leftSlider).length > 0 ){
                    if(t.numberOfSlides > 1)
                        $(t.leftSlider).bind('click', t.handleLeftSliderClick);
                    
                    $(t.leftSlider).css({'opacity' : t.arrowFadeAmmount ,'cursor' : 'default' });
                        
                }
                
                if( $(t.rightSlider).length > 0 ){
                    if(t.numberOfSlides > 1)
                        $(t.rightSlider).bind('click', t.handleRightSliderClick)
                    else
                        $(t.rightSlider).css({'opacity' : t.arrowFadeAmmount ,'cursor' : 'default' });
                }
	        }

	        //___EVENT HANDLERS___

            t.handleTabClick = function(e){
                
                var curTabContent = $(t.slideMap[$(this).attr('id')].content).attr('id');
                
                $(t.leftSlider).css({'opacity' : '1.0' ,'cursor' : 'pointer' });
                $(t.rightSlider).css({'opacity' : '1.0' ,'cursor' : 'pointer' });
                
                if( $(t.displayList[0].content).attr('id') == curTabContent )
                    $(t.leftSlider).css({'opacity' : t.arrowFadeAmmount ,'cursor' : 'default' });
                
                if( $(t.displayList[t.displayList.length - 1].content).attr('id') == curTabContent )
                    $(t.rightSlider).css({'opacity' : t.arrowFadeAmmount ,'cursor' : 'default' });
                    
                var left = t.slideMap[$(this).attr('id')].left;
                $(t.slideDiv).animate( {marginLeft : -left }, {duration : t.slideSpeed} );
                currentContent = $(t.slideMap[$(this).attr('id')].content).attr('id');
            }

	        t.handleLeftSliderClick = function(e){
                t.slide(false)
                $(t.rightSlider).css({'opacity' : '1.0' ,'cursor' : 'pointer' });
            }

	        t.handleRightSliderClick = function(e){
	            t.slide(true)
                $(t.leftSlider).css({'opacity' : '1.0' , 'cursor' : 'pointer' });
                
	        }

	        t.slide = function(slideToNext){
                var slideToEl = slideToNext ? $(t.slideMap[currentContent].nextContent).attr('id') : $(t.slideMap[currentContent].prevContent).attr('id');
                
                if(slideToEl){
                    if($(t.slideMap[slideToEl].tab).length > 0)
                        $(t.slideMap[slideToEl].tab).trigger('click');
                    else
                        t.slideTo( "#" + slideToEl );
                    
                    currentContent = $(t.slideMap[$("#" + slideToEl).attr('id')].content).attr('id');
                }else{
                    
                }
                
                if(!t.slideMap[slideToEl].nextContent)
                    $(t.rightSlider).css({'opacity' : t.arrowFadeAmmount ,'cursor' : 'default' });
                if(!t.slideMap[slideToEl].prevContent)
                    $(t.leftSlider).css({'opacity' : t.arrowFadeAmmount ,'cursor' : 'default' });
                
	        }
	        
	        t.slideTo = function(slideToThisEl){
	            var left = t.slideMap[$(slideToThisEl).attr('id')].left;
                $(t.slideDiv).animate( {marginLeft : -left }, {duration : t.slideSpeed} );
                currentContent = $(t.slideMap[$(slideToThisEl).attr('id')].content).attr('id');
	        }
			
/*			t.getCurrentContent = function () {
				
				return currentContent;
			}
*/
	        init();
	        
	    }

	}
	
})();
		
