﻿// JScript File

/*Setting the collapse\expand state of the filters.  
	The function is called from each filter object but appears once in the search page*/
	function SwitchStyle(imgObj, refObj, divObj)
	{
		//alert("imgObj = " + imgObj);
		//alert("refObj = " + refObj);
		//alert("divObj = " + divObj);
		if (document.getElementById(refObj).style.display == 'none')
		{   
			//alert("if = " + document.getElementById(imgObj).innerHTML);
			document.getElementById(imgObj).innerHTML = "<img src='http://images.paulfredrick.com/csimages/common/arrow_up.gif' border='0'>";
            document.getElementById(refObj).style.display = 'block';
            document.getElementById(divObj).style.display = 'block';
        }
        else
		{        
			//alert("else = " + document.getElementById(imgObj).innerHTML);
			document.getElementById(imgObj).innerHTML = "<img src='http://images.paulfredrick.com/csimages/common/arrow_down.gif' border='0'>";
            document.getElementById(refObj).style.display = 'none';
            document.getElementById(divObj).style.display = 'none';
        }
        
        // SiteCatalyst: track refinement click
		var s = s_gi(s_account);
		s.tl(false,'o','Refinement Click'); 
	}

	function newSwitchStyle(imgObj)
	{
		if (imgObj.title=='Expand') 
		{
			//img.td.tr.tbody.table.siblingTable = children table
			imgObj.parentElement.parentElement.parentElement.parentElement.nextSibling.style.display='';	
			imgObj.title = 'Collapse';
			imgObj.src = './Images/arrow_up.gif';
		}
		else
		{
			//img.td.tr.tbody.table.siblingTable = children table
			imgObj.parentElement.parentElement.parentElement.parentElement.nextSibling.style.display='none';
			imgObj.title = 'Expand';
			imgObj.src = './Images/arrow_down.gif';				
		}
	}
