// (c) Windmill - (r) ded 20071022 1545 //

// layer control

if (document.getElementById && !document.all) { // NS6+
   layerRef=".getElementById";
   styleRef=".style";
   leftbrac  = "('";
   rightbrac = "')";
// document.getElementById('one').style.visibility='hidden'
}

else if (document.layers) { // NS4+
   layerRef  = ".layers";
   styleRef  = "";
   leftbrac  = "['";
   rightbrac = "']";
// document.layers['one'].visibility='hidden'
}

else if (document.images) { // IE4+
   layerRef  = ".all";
   styleRef  = ".style";
   leftbrac  = "['";
   rightbrac = "']";
// document.all['one'].style.visibility='hidden'
}

function makeBlock(myItem) {
   eval("document"+layerRef+leftbrac+myItem+rightbrac+styleRef+".display='block'");
}
function makeNone(myItem) {
   eval("document"+layerRef+leftbrac+myItem+rightbrac+styleRef+".display='none'");
}

function toggleItem(myItem) {
   if (eval("document"+layerRef+leftbrac+myItem+"_whole"+rightbrac+styleRef+".display") == 'none') {
//    safari 2 fix part one
      if (currentOption) {
         makeNone(currentOption)
         makeNone(currentItem+"_options")
      }
      makeNone(myItem+"_title");
      makeNone(myItem+"_opener");
      makeBlock(myItem+"_closer");
      makeBlock(myItem+"_whole");
//    safari 2 fix part two
      if (currentOption) {
         setTimeout('makeBlock(currentOption)',0);
         setTimeout('makeBlock(currentItem+"_options")',0);
      }

   }
   else {
      if (eval("document"+layerRef+leftbrac+myItem+"_options"+rightbrac+styleRef+".display") == 'block') {
         makeNone(currentOption)
         makeNone(currentItem+"_options")
         currentItem = "";
         currentOption = "";
      }
      makeNone(myItem+"_options");
      makeNone(myItem+"_whole");
      makeNone(myItem+"_closer");
      makeBlock(myItem+"_opener");
      makeBlock(myItem+"_title");
      if (eval("document"+layerRef+leftbrac+myItem+"_details"+rightbrac+styleRef+".display") == 'block') {
         makeNone(myItem+"_details");
         makeBlock(myItem+"_more");
      }
   }
}

function readMore(myItem) {
// safari 2 fix part one
   if (currentOption) {
      makeNone(currentOption)
      makeNone(currentItem+"_options")
   }
   makeNone(myItem+"_more");
   makeBlock(myItem+"_details");
// safari 2 fix part two
   if (currentOption) {
      setTimeout('makeBlock(currentOption)',0);
      setTimeout('makeBlock(currentItem+"_options")',0);
   }
}

currentItem = "";
currentOption = "";
function toggleOption(myItem,myOption,thisImage) {
   if (currentItem == "") {
      document[thisImage].src = "pjx/"+thisImage+".jpg";
      makeBlock(myOption);
      makeBlock(myItem+"_options");
      currentItem = myItem;
      currentOption = myOption;
   }

   else if (currentItem == myItem) {
      if (currentOption == myOption) {
         makeNone(currentOption);
         makeNone(currentItem+"_options");
         currentItem = "";
         currentOption = "";
      }
      else {
         makeNone(currentOption);
         makeNone(currentItem+"_options");
         document[thisImage].src = "pjx/"+thisImage+".jpg";
         makeBlock(myOption);
         makeBlock(myItem+"_options");
         currentItem = myItem;
         currentOption = myOption;
      }
   }

   else {
      makeNone(currentOption);
      makeNone(currentItem+"_options");
      document[thisImage].src = "pjx/"+thisImage+".jpg";
      makeBlock(myOption);
      makeBlock(myItem+"_options");
      currentItem = myItem;
      currentOption = myOption;
   }

}


function swapPic(myItem,thisImage) {
   document[myItem].src = "gfx/loading.gif";
   document[myItem].src = "pjx/"+thisImage+".jpg";
}

function toggleCategory(myItem) {
   if (eval("document"+layerRef+leftbrac+myItem+rightbrac+styleRef+".display") == 'none') {
      makeNone(myItem+"_closed");
      makeBlock(myItem+"_open");
      makeBlock(myItem);
   }
   else {
      makeNone(myItem+"_open");
      makeBlock(myItem+"_closed");
      makeNone(myItem);
   }
}

function toggleAbout(myItem) {
   if (eval("document"+layerRef+leftbrac+myItem+"_more"+rightbrac+styleRef+".display") == 'none') {
      makeNone(myItem+"_details");
      makeBlock(myItem+"_more");
   }
   toggleCategory(myItem);
}

