// JavaScript Document
	function displaySubNav(){
			clearInterval(navCountdown);			
			if(document.getElementById(el).style.opacity<0.7){
				var browseTop = (document.getElementById('productbrowsercont').style.top).replace("px","");
				if(browseTop==''){
					browseTop = 115;	
				}
				var time = ((275-browseTop)/275)*1.2;
				//alert(document.getElementById('productbrowser2').style.top);
				document.getElementById('productbrowsercont').style.top = maxTop;
				document.getElementById('productbrowsercont').style.visibility = 'visible';
				if(document.getElementById('surround')!==null){
				document.getElementById('surround').style.visibility='hidden';
				}
				
				changeOpac(70, el);
			}
		}
		
		
		function removeSubNav(){
			//alert(AC.ProductBrowser2.isSlideDet);
			clearInterval(navCountdown);
			//alert(AC.ProductBrowser2.dif);
			if(AC.ProductBrowser2.stopped==true && AC.ProductBrowser.stopped==true){
				//fadeOutW('white-over');
				//var queue = Effect.Queues.get('movescope');
				//queue.each(function(effect) { effect.cancel(); });
				//var queue = Effect.Queues.get('fadescope');
				//queue.each(function(effect) { effect.cancel(); });
				
				//new Effect.Opacity('white-over', { from: document.getElementById(el).style.opacity, to: 0.0, duration: 1, queue: { position: 'end', scope: 'fadescope', limit: 2}, duration:0.5 });
				minbrowserHide();
				AC.ProductBrowser2.animateSlide(0);
				//go to 117
				document.getElementById('productbrowsercont').style.top = minTop;
				document.getElementById('productbrowsercont').style.visibility = 'hidden';
				
				if(document.getElementById('surround')!==null){
				document.getElementById('surround').style.visibility='visible';
				}
				
				document.getElementById('pb-productsliderhandleimage2').style.visibility='hidden';
				document.getElementById('pb-productsliderhandle2').style.visibility='hidden';
				
				document.getElementById('pb-productslidertrack2').style.visibility = 'hidden';
				
				changeOpac(0, el);
				subShowing = false;
				subSetAs = 0;
				document.getElementById('pb-productslider2').innerHTML = '';
				//new Effect.Move('productbrowsercont', { x: 0, y: 115, mode: 'absolute', queue: { position: 'end', scope: 'movescope', limit: 2}, duration:0.5 });
				//alert(navCountdown);
			}else{
				hideSubNav();
			}
		}
		function hideSubNav(){
			clearInterval(minInt);
			clearInterval(navCountdown);
			navCountdown = setInterval(removeSubNav,1000);
			
		}
		
		String.prototype.count=function(s1) { 
			return (this.length - this.replace(new RegExp(s1,"g"), '').length) / s1.length;
		}

		var subContent = new Array();
		var subBrand = new Array();
		var subBrandHeight = new Array();
		var subBrandWidth = new Array();
		var subJava = new Array();
		var subPosition = new Array();
		var subSetAs = -1;
		function setSubJava(arNum){
			//alert('content - '+subContent[1]);
			if(arNum!==subSetAs){
				
				subPosition[subSetAs] = AC.ProductBrowser2.sliderVal;
				subSetAs=arNum;
				document.getElementById('pb-productslider2').innerHTML = subContent[arNum];
				loadBG_que = new Array();
				running_img = false;
				eval(subJava[arNum]);
				if(!subBrand[arNum] || subBrand[arNum].count('<div')<1){
					document.getElementById('brand-nav').style.display = 'none';
					document.getElementById('productbrowsercont').style.height = '156px';
				}else{
					document.getElementById('brand-nav').style.display = 'block';
					document.getElementById('brand-title').style.height = subBrandHeight[arNum]+'px';
					
					document.getElementById('productbrowsercont').style.height = (156+parseFloat(subBrandHeight[arNum])+20)+'px';
					
					document.getElementById('brand-list').innerHTML = subBrand[arNum];
				}
				totalSubProds = subContent[arNum].count('<li');
				
				if(totalSubProds>7){
				
					document.getElementById('pb-productslidertrack2').style.visibility='visible';
					document.getElementById('pb-leftarrow2').style.visibility='visible';
					document.getElementById('pb-rightarrow2').style.visibility='visible';	
					document.getElementById('pb-productsliderhandleimage2').style.visibility='visible';	
					document.getElementById('pb-productsliderhandle2').style.visibility='visible';	
					
					
					
					init();
				}else{	
					init();		
					
					document.getElementById('pb-productslidertrack2').style.visibility='hidden';
					document.getElementById('pb-leftarrow2').style.visibility='hidden';
					document.getElementById('pb-rightarrow2').style.visibility='hidden';
					document.getElementById('pb-productsliderhandleimage2').style.visibility='hidden';
					document.getElementById('pb-productsliderhandle2').style.visibility='hidden';
					
					document.getElementById('pb-productslider2').style.left = '0px';
					
				}
				
				
				displaySubNav();
					var moveToSlide = subPosition[arNum];
					//alert('cur set: '+subPosition[subSetAs]+' ar num: '+arNum+' move to: '+moveToSlide);
					if(moveToSlide/1>0 && AC.ProductBrowser2.sliderVal!==moveToSlide){
						AC.ProductBrowser2.animateSlide(parseFloat(moveToSlide));
					}else{
						AC.ProductBrowser2.animateSlide(0);
					}
				
			}
		}
		
		var minInt;
		var subShowing = false;
		function minbrowserShow(){
			clearInterval(minInt);
			minInt = setInterval(showmin,150);
		}
		function showmin(){
			clearInterval(minInt);
			document.getElementById('minbrowser').className='minbrowserOver';
			document.getElementById('productbrowser').style.marginTop='0px';
			subShowing=true;
			$j("#nav-fade").hide();
		}
