dw.effects = {
		//loading a pid for the first time
		loadingPid: function(ele){
			if(!Global.ie){
				Element.setStyle(ele,{opacity:0})
				Opacity.full(ele,{timerVar:new String().uId()});
			}
		},
		
		//display and hide filters
		toggleFilterDisplay: function(obj,key,opp){
			var timer = 'filterTimer_'+key
			if(parseInt(obj.offsetHeight)>26 && opp != 'all'){
				obj.getElementsByTagName('h3')[0].className = ''
				Size.Y(obj,{Y:26, timerVar:timer})
				dw.config.filters[key].loadState = 'closed'
			}else if(opp != 'none'){
				Size.Y(obj,{Y:'child', timerVar:timer})
				obj.getElementsByTagName('h3')[0].className = 'open'
				dw.config.filters[key].loadState = 'open'
			}
		},
		
		//animating count
		incrementNumber: function(){
			var start = parseInt($('pidCount').innerHTML)
			var delta = start - dw.vars.pidList.length
			var skip = Math.ceil(Math.abs(delta)/10)
			var suff = '<span> matches</span>'
			if(dw.vars.pidList.length ==1)suff = '<span> match</span>'
			if(delta < 0){
				var numberTimer = setInterval(incUp,40)
			}else if(delta > 0){
				var numberTimer = setInterval(incDown,40)
			}
			
			function incUp(){
				if(start < dw.vars.pidList.length){
					$('pidCount').innerHTML = start + suff
					start = start + skip 
				}else{
					$('pidCount').innerHTML = dw.vars.pidList.length + suff
					clearInterval(numberTimer)
				}
			}
			
			function incDown(){
				if(start > dw.vars.pidList.length){
					$('pidCount').innerHTML = start + suff
					start = start - skip 
				}else{
					$('pidCount').innerHTML = dw.vars.pidList.length + suff
					clearInterval(numberTimer)
				}
			}
		},
		
		//hiding the comparision grid
		hideCompGrid: function(obj){
			Opacity.none(obj,{skip:.2,onComplete: function(){
				obj.style.display = 'none'
			}});
		},
		
		//showing the comparision grid
		showCompGrid: function(obj){
			Opacity.full(obj,{skip:.2});
		},
		
		//move comp grid to see products to the right
		moveCompGridRight: function(moveto){
			dw.effects.turnOffAll()
			
			Move.X($('cgTR'),{X:moveto});
			Move.X($('cgBR'),{X:moveto,onComplete: function(){
				var left = parseInt($('cgBR').style.left)
				var next = $('compGridNextButton')
				var prev = $('compGridPreviousButton')
				if(left<= -1*(dw.compChart.width-(dw.compChart.recWidth*3))){
					next.className = 'rightArrowOff';
					next.onclick = null;
					prev.className = 'leftArrowOn';
					prev.onclick = dw.previousButtonOnclick;
					
				}else{
					prev.className = 'leftArrowOn';
					prev.onclick = dw.previousButtonOnclick;
					next.className = 'rightArrowOn';
					next.onclick = dw.nextButtonOnclick;
				}
			}});
		},
		
		//move comp grid to see products to the left
		moveCompGridLeft: function(moveto){
			dw.effects.turnOffAll()
			
			Move.X($('cgTR'),{X:moveto});
			Move.X($('cgBR'),{X:moveto,onComplete: function(){
				var left = parseInt($('cgBR').style.left)
				var next = $('compGridNextButton')
				var prev = $('compGridPreviousButton')
				if(left==0){
					prev.className = 'leftArrowOff'
					prev.onclick = null
					next.className = 'rightArrowOn'
					next.onclick = dw.nextButtonOnclick;
				}else{
					next.className = 'rightArrowOn'
					next.onclick = dw.nextButtonOnclick;
					prev.className = 'leftArrowOn';
					prev.onclick = dw.previousButtonOnclick;
				}
			}});
		},
		
		turnOffAll: function(){
			var next = $('compGridNextButton')
			next.onclick = null
			next.className = 'rightArrowOff'
			var prev = $('compGridPreviousButton')
			prev.onclick = null
			prev.className = 'leftArrowOff'
		},
		
		//close promo
		closePromo: function(){
			var promo = $('promo')
			Opacity.none(promo,{skip:.3, onComplete:function(){
				promo.style.display = 'none'								
			}});
			
			if ($('drpCustomTagProductSize_0'))
			{
				$('drpCustomTagProductSize_0').style.visibility = 'visible';
			}
			
			if ($('drpCustomTagProductColor_0'))
			{
				$('drpCustomTagProductColor_0').style.visibility = 'visible';
			}
			
		},
		
		openPromo: function(){
			$('promoTitle').innerHTML = ''
			$('promoContent').innerHTML = ''
			
			if ($('drpCustomTagProductSize_0'))
			{
				$('drpCustomTagProductSize_0').style.visibility = 'hidden';
			}
			
			if ($('drpCustomTagProductColor_0'))
			{
				$('drpCustomTagProductColor_0').style.visibility = 'hidden';
			}
		
			$('promo').style.display = 'block'
			Opacity.full($('promo'),{skip:.3})	
		}
	}