var img_path=self.location.href;
img_path=img_path.substring(0,img_path.lastIndexOf("/"))+"/gfx/";
var toggles,allState=2;

function toggleContent(id){
 if(document.all){
  if(allState==1 || (document.all[id].style.display=='none' && allState!=0))
   document.all[id].style.display='';
  else document.all[id].style.display='none';
  return false;
 }
 else if(document.getElementById){
  if(allState==1 || (document.getElementById(id).style.display=='none' && allState!=0))
   document.getElementById(id).style.display='inline';
  else document.getElementById(id).style.display='none';
  return false;
 }
}
function toggleImage(img,src1,src2){
 if(document.images){
  myImage=document.images[img];
  if(allState==1 || (myImage.src.indexOf(src1)!=-1 && allState!=0)){
   myImage.src=img_path+src2+".png";
   myImage.alt=src2;
  }
  else{
   myImage.src=img_path+src1+".png";
   myImage.alt=src1;
  }
 }
}
function toggleN(n){toggle(id.target.name.substring(2,id.target.name.length));}
function toggle(id){
 toggleContent('all'+id);
 toggleImage('ai'+id,'more','less')
 return false;
}
function toggleAll(){
 allState=(readCookie('show_all')==1?0:1);
 for(i=1;i<toggles;i++) toggle(i);
 createCookie('show_all',allState);
 allState=2;
 return false;
}
function initToggles(n){toggles=n;}

