﻿   function showCategories(mode) 
    {
        //polldown=document.getElementById("polldown");
        
     //   if (mode==undefined) fadeIn(polldown.id,0.1);
        polldown.style.display="";
    
    }
    
     function hideCategories() 
    {
        //polldown=document.getElementById("polldown");
        
        //fadeOut(polldown.id,0.1);
        polldown.style.display="none";
    }




function fadeOut(id,d) {
	var oDiv=document.all(id);
	//if (d=='') d=0.2;
	
    oDiv.style.filter="blendTrans(duration=" + d + ")";
  // Make sure the filter is not playing.
   	   
    if (oDiv.filters.blendTrans.status != 2) {
   
  	
    	oDiv.filters.blendTrans.apply();
        oDiv.style.visibility="hidden";
        oDiv.filters.blendTrans.play();
        
    }
}
function fadeIn(id,d) {
	var oDiv=document.all(id);
	
	
	
    oDiv.style.filter="blendTrans(duration=" + d + ")";
    // Make sure the filter is not playing.
    if (oDiv.filters.blendTrans.status != 2) {
    	
        oDiv.filters.blendTrans.apply();
        oDiv.style.visibility="visible";
       // oDiv.style.display='';
        oDiv.filters.blendTrans.play();
    }
}


function toggle(id)

{

    src=window.event.srcElement;
   

//save current state
    var div=document.getElementById("_subcategory_" + id);
    currentState=div.style.display;
    navTable=document.getElementById("rightNavTable");
    
    divColl=navTable.getElementsByTagName("DIV");
    
//collapse all
    for (i=0;i<divColl.length;i++)
    {
        divColl[i].style.display='none';
    
    }
    
    if (src.tagName=='TD') 
         img=window.event.srcElement.getElementsByTagName("IMG")[0];
    else if (src.tagName=='IMG') 
         img=src;   
    else
        alert('img not found');
   // alert(img.src);
    
//toggle current    

//absolute url?
path=window.location.href;
path=path.substring(0,path.lastIndexOf('/'));

    if (currentState=='none') {
        div.style.display='';
        img.src=path +'/images/arr_down.gif';
    } else {
        div.style.display='none';
        img.src= path + '/images/arr_right.gif';
    }    

   // alert(img.src);
}
