/*  BRUMMELLS SPECIFIC CODE */
/***************************/
/* used to emulate :hover for ie6 for the home and brand page product slectors with roll over image swapping */
var preserveStyles = new Array();
preserveStyles[0] = 'featProdItem';
preserveStyles[1] = 'featProdItem firstChild';
preserveStyles[2] = 'featProdItem lastChild';
preserveStyles[3] = 'featuredProductsList';

preserveStyles[4] = 'rangeItem';
preserveStyles[5] = 'rangeItem firstChild';
preserveStyles[6] = 'rangeItem lastChild';
preserveStyles[7] = 'rangeList';

var ieClassName="iehover";
/*IE6 Hover emulation functions */
function on(which) {
	if(isIE == true) {
		var i;
		for (i=0; i<preserveStyles.length; ++i) {
			if(which.className == preserveStyles[i]){
				which.className= preserveStyles[i] + ' ' + ieClassName;
			}//if
		} // for

		if(which.className == ''){
			which.className=ieClassName;
		}//if
	}
	}

function off(which) {
	if(isIE == true) {
		var i;

		for (i=0; i<preserveStyles.length; ++i) {
			if(which.className == preserveStyles[i] + ' ' + ieClassName){
				which.className= preserveStyles[i];
			}//if
		} // for

		if(which.className == ieClassName){
			which.className='';
		}//if
	}
	}
/* END BRUMMELLS SPECIFIC */
/*************************/

//the purpose of this function is to allow the enter key to 
//point to the correct button to click.
 function doGoFilterClick(buttonName,e)
    {

        var key;

         if(window.event)
              key = window.event.keyCode;     //IE
         else
              key = e.which;     //firefox
    
        if (key == 13)
        {
            //Get the button the user wants to have clicked
               __doPostBack(buttonName,'');
                event.keyCode = 0
        }
   }

//link back to the product page
function linkToProduct(link){
	url = link.href;
	if (window.opener && !window.opener.closed) {
		window.opener.location=url;
		window.close();
	}
}
function popup(mylink, windowname, width, height, scroll)
{
        if (! window.focus)return true;
        var href;
        if (typeof(mylink) == 'string')
        href=mylink;
        else
        href=mylink.href;
        if (scroll==1)
        window.open(href, windowname, 'scrollbars=yes,status=no,width='+width+',height='+height);
        else
        window.open(href, windowname, 'scrollbars=no,status=no,width='+width+',height='+height);
        return false;
} 
// Add bookmark for both browser engines...
function addBookmark(object) {
  if (window.sidebar) {
    window.sidebar.addPanel(object.title, object.href,"");
  } else if( document.all ) {
    window.external.AddFavorite( object.href, object.title);
  } else if( window.opera && window.print ) {
    return true;
  }
} 

//declare the last var and set an initial state (to stop errors), used for faqs
last = '1';

function activateTip(which){
        //remove any existing highlight
        toTheTop();
        
        //apply the new highlight
		document.getElementById('faqDiv'+which).className = 'active';   
		
		//apply the new highlight on the faq menu
		document.getElementById('faqMenu'+which).className = 'active';   

        //set the last tag so we know which to remove next time
        last = which;
}

function toTheTop(){
        //reset the background image on the faq
		document.getElementById('faqDiv'+last).className = '';   

        //reset the background image on the faq menu
		document.getElementById('faqMenu'+last).className = '';      
        }
