/**
 *
 *product
 *
 */
 var childmenu = document.getElementsByName('childmenu');
 function showMenu(m_id){
	 for(i=0;i<childmenu.length;i++){
		childmenu[i].className = "";
	 }
	 
	 $('productbrowser').className = "productPageHeader"+m_id;
	 for(i=2;i<6;i++){
		$('menu'+i).className= i==m_id ? "active" : "" ;
	 }
	 $('banner').className = "hide";
	 $('lightingImg').className = "hide";
	 var _html;
	 switch(parseInt(m_id)){
	 	case 2:_html = $('trees').innerHTML;
		$('bannerHref').href = "product_support.htm?cid=4#fourTitle";
		$('banner').src = "img/product/banner1.jpg"; $('banner').className = "";
		break;
	 
		case 3:_html = $('pools').innerHTML;
		$('bannerHref').href = "product_support.htm?cid=3#fourTitle";
		$('banner').src = "img/product/banner2.jpg"; $('banner').className = "";
		break;
	 
	 	case 4:_html = $('lightings').innerHTML;
		$('lightingImg').className = "fan";
		$('bannerHref').href = "product_support.htm?cid=4#fourTitle";
		$('banner').src = "img/product/banner1.jpg"; $('banner').className = "";
		$('banner').style.top = 40+"px";
		break;
		
		case 5:_html = $('airbedsDiv').innerHTML;
		$('bannerHref').href = "product_support.htm?cid=5#fourTitle";
		break;
		
		case 6:_html = $('wallDiv').innerHTML;break;
	 }
	 
	 $('childContent').innerHTML = _html;	 
		
	 var flag = false;
	 
	 if (m_id != 6){
		 if ($('child'+m_id).className=="")
			flag = true;		 
		 for(i=2;i<6;i++){
			 $('child'+i).className = i==m_id ? "" : "hide";
		 }
		 if (flag){
			 $('child'+m_id).className = "hide";
		 }
	 }else{
	 	for(i=2;i<6;i++){
			$('child'+i).className = "hide";
		}
	 }
	 
	 
/*	 if (m_id != 5 && m_id != 6){
		 if ($('child'+m_id).className=="")
			flag = true;		 
		 for(i=2;i<5;i++){
			 $('child'+i).className = i==m_id ? "" : "hide";
		 }
		 if (flag){
			 $('child'+m_id).className = "hide";
		 }
	 }else{
	 	for(i=2;i<5;i++){
			$('child'+i).className = "hide";
		}
	 } */
	 
 }
 
 function showChild(x){
	for(i=0;i<childmenu.length;i++){
		childmenu[i].className = x == i+1 ? "active" : "";
	}
	
	if(x < 7){
		$('productbrowser').className = "productPageHeader2";
		$('child2').className = "";
		$('bannerHref').href = "product_support.htm?cid=4#fourTitle";
		$('banner').src = "img/product/banner1.jpg"; 
		$('banner').className = "";
	}
	if(x > 6 && x < 19){
		$('productbrowser').className = "productPageHeader3";
		$('child3').className = "";
		$('bannerHref').href = "product_support.htm?cid=3#fourTitle";
		$('banner').src = "img/product/banner2.jpg"; 
		$('banner').className = "";
	}
	if(x > 18 && x<25){
		$('productbrowser').className = "productPageHeader4";
		$('child4').className = "";
		$('lightingImg').className = "fan";
		$('bannerHref').href = "product_support.htm?cid=4#fourTitle";
		$('banner').src = "img/product/banner1.jpg"; $('banner').className = "";
		$('banner').style.top = 40+"px";
	}
	if(x > 24 && x<31){
		$('productbrowser').className = "productPageHeader5";
		$('child5').className = "";		
	}
	
	var _html;
	
	switch (parseInt(x)){
		case 1:_html = $('tree_child1').innerHTML;break;
		case 2:_html = $('tree_child2').innerHTML;break;
		case 3:_html = $('tree_child3').innerHTML;break;
		case 4:_html = $('tree_child4').innerHTML;break;
		case 5:_html = $('tree_child5').innerHTML;break;
		case 6:_html = $('tree_child6').innerHTML;break;
		
		case 7:_html = $('pool_child1').innerHTML;break;
		case 8:_html = $('pool_child2').innerHTML;break;
		case 9:_html = $('pool_child3').innerHTML;break;
		case 10:_html = $('pool_child4').innerHTML;break;
		case 11:_html = $('pool_child5').innerHTML;break;
		case 12:_html = $('pool_child6').innerHTML;break;
		case 13:_html = $('pool_child7').innerHTML;break;
		case 14:_html = $('pool_child8').innerHTML;break;
		case 15:_html = $('pool_child9').innerHTML;break;
		case 16:_html = $('pool_child10').innerHTML;break;
		case 17:_html = $('pool_child11').innerHTML;break;
		case 18:_html = $('pool_child12').innerHTML;break;		
		
		case 19:_html = $('light_child1').innerHTML;break;			
		case 20:_html = $('light_child2').innerHTML;break;		
		case 21:_html = $('light_child3').innerHTML;break;		
		case 22:_html = $('light_child4').innerHTML;break;				
		case 23:_html = $('light_child5').innerHTML;break;	
		case 24:_html = $('light_child6').innerHTML;break;
				
		case 25:_html = $('airbedsDiv_child1').innerHTML;break;			
		case 26:_html = $('airbedsDiv_child2').innerHTML;break;		
		case 27:_html = $('airbedsDiv_child3').innerHTML;break;		
		case 28:_html = $('airbedsDiv_child4').innerHTML;break;				
		case 29:_html = $('airbedsDiv_child5').innerHTML;break;	
		case 30:_html = $('airbedsDiv_child6').innerHTML;break;
	}
	
	if(x < 7){
		_html += "<p>Please visit your local retailer or <span id='contact_us'><a href='contact_us.htm'>Contact Us</a></span> to view entire collection of Polygroup Christmas trees and other holiday products</p>";
		_html += "<p style='font-size:10px;'>Polygroup tree and light components are covered under one or more US and international patents.</p>";
	}
	if(x > 6 && x < 19){
		_html += "Please visit your local retailer or <span id='contact_us'><a href='contact_us.htm'>Contact Us</a></span> to view entire collection of Polygroup pools and other summer products";	
		if(x == 7 || x == 8 || x == 18)
			_html += "<p style='font-size:10px;'>Polygroup pool and accessory components are covered under one or more US and international patents.</p>";
	}
	if(x > 18 && x<25){
		_html += "Please visit your local retailer or <span id='contact_us'><a href='contact_us.htm'>Contact Us</a></span> to view entire collection of Polygroup lights and other holiday products";
		_html += "<p style='font-size:10px;'>Polygroup tree and light components are covered under one or more US and international patents.</p>";
	}
	if(x > 24 && x<31){
		_html += "Please visit your local retailer or <span id='contact_us'><a href='contact_us.htm'>Contact Us</a></span> to view entire collection of Polygroup Nordic Peak™ airbeds and other holiday products";		
	}
 	$('childContent').innerHTML = _html;
 }
