	//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 = 'SC Johnson';
		addthis_options = 'email, favorites, facebook, digg, delicious, twitter';
		
		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);		
	}	
	

$(document).ready(function() {

	//Assign Google Analytics tracking code to library downloads
	$("a").each(function() {
		var $a = $(this);
		var href = $a.attr("href");				  
		if (href != "" && href != null && href != undefined) {				    					
			if (href.match(/\.(?:sflb.ashx|pdf|doc|xls|zip|rar)($|\&|\?)/)) {											
				$a.click(function() {				
				    pageTracker._trackPageview('/DOWNLOAD/' + href);
				});					
			}
		}				 
	});

	//news feed rotation (home page)
	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");
	$(".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() {
			$(".left", this).css("background", "url(/images/bg_btn_left_on.gif) no-repeat left top");
			$(".center", this).css("background", "url(/images/bg_btn_center_on.gif) repeat-x left top");			
			$(".right", this).css("background", "url(/images/bg_btn_right_on.gif) no-repeat left top");
		},
		function() {			
			$(".left", this).css("background", "url(/images/bg_btn_left.gif) no-repeat left top");
			$(".center", this).css("background", "url(/images/bg_btn_center.gif) repeat-x left top");			
			$(".right", this).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() {
		
		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
    })
    
});

(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();
	        
	    }

	}
	
})();