//addLoadEvent(hideAttributes);

function toggleExtraOptions(showLink, resetLink) {
	nodeTraverse(document.getElementById('attribute-list'));
	showLink.style.display = 'none';
	resetLink.style.display = 'inline';
}

function nodeTraverse(node) {
	if(node) {
		if(node.nodeType==1) {
			if(node.nodeName=='LI') {
				if(node.className=='extraHidden')
					node.className='extraShown';
				else if(node.className=='extraShown')
					node.className='extraHidden';
			} else if(node.childNodes && node.childNodes.length>0) {
				var next = node.firstChild;
				while (next) {
 					nodeTraverse(next);
					next = next.nextSibling;
				}
			}
		}
	}
}

function hideAttributes(){
	if(document.getElementById('attribute-list')){
	
		var queryString = window.location.search.substring(1);
		if(queryString.indexOf('attributes') == -1){
			document.getElementById('attribute-list').style.display = 'none';
			document.getElementById('attributeShowHideButton').src='/siteimages/buttons/attribute_show.png';			
		} else {
			document.getElementById('attributeShowHideButton').src='/siteimages/buttons/attribute_hide.png';			
		}
	}
}


function toggleAttributes(){
	if(document.getElementById('attribute-list')){
		if(document.getElementById('attribute-list').style.display == 'none'){
			document.getElementById('attribute-list').style.display = 'block';
			document.getElementById('attributeShowHideButton').src='/siteimages/buttons/attribute_hide.png';			
		}else{
			document.getElementById('attribute-list').style.display = 'none';
			document.getElementById('attributeShowHideButton').src='/siteimages/buttons/attribute_show.png';			
		}
	}
	
}

