
if(document.all && !document.getElementById) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}



function swap(d)
{
   var x = eval("document.getElementById('container_"+d+"')")
   if(x.style.display!=='block')
      {
      x.style.display = 'block';

      }
   else
      {
      x.style.display = 'none';

      }
   setStatus()
   return false
}



function getStatus()
   {
   var n, i, s = '', c=0
   s = getCookie('status')

   if (s)
      {
      for (n=0;n < s.length+1;n++)
         {
         i = eval("document.getElementById('container_"+n+"')")
         if (i) {
            i.className = 'container'
            if (s.substring(c,c+1)==1)
               {i.style.display = 'block'}
            else
               {i.style.display = ''}
            c++
            }
         }
      }
   }



function setStatus()
   {
   var n, i, s = ''
   var y
   y = document.getElementsByTagName('*')


   for (n=0;n<y.length;n++)
      {
      i = y[n]
      if(i.tagName  == 'DIV')
         {
         if (i.id.substring(0,9) == 'container')
            {
            if (y[n].style.display == 'block')
               {s = s + '1'}
            else
               {s = s + '0'}
            }
         }
      }
   setCookie('status',s,30)
   }




function getCookie(NameOfCookie)
   {
   if (document.cookie.length > 0)
      {
      begin = document.cookie.indexOf(NameOfCookie+"=");
      if (begin != -1)   // Note: != means "is not equal to"
         {
         begin += NameOfCookie.length+1;
         end = document.cookie.indexOf(";", begin);
         if (end == -1) end = document.cookie.length;
         return unescape(document.cookie.substring(begin, end));
         }
      }
   return null;
   }



function setCookie(NameOfCookie, value, expiredays)
   {
   var ExpireDate = new Date ();
   ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
   document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
   }



function collapseAll()
   {
   var n, i, s = ''
   var y
   y = document.getElementsByTagName('*')
   for (n=0;n<y.length;n++)
      {
      i = y[n]
      if(i.tagName  == 'DIV')
         {
         if (i.id.substring(0,9) == 'container')
            {
            if (y[n].style.display == 'block')
               {y[n].style.display = ''}
            s = s + '0'
            }

         }
      }
   setCookie('status',s,30)
   }


function expandAll()
   {
   var n, i, s = ''
   var y
   y = document.getElementsByTagName('*')
   for (n=0;n<y.length;n++)
      {
      i = y[n]
      if(i.tagName  == 'DIV')
         {
         if (i.id.substring(0,9) == 'container')
            {
            y[n].style.display = 'block'
            s = s + '1'
            }

         }
      }
   setCookie('status',s,30)
   }






// FROM METASITE


function doLoadStuff()
   { size_main_content() }

window.onresize = function()
               {
               //alert('resized')
               //alert(document.images.sizeX.width)
               size_main_content()
               //size_logo_main()
               }

function size_main_content()
{
   //document.all.main_content.style.pixelWidth = document.images.sizeX.width - (document.all.menuOuter.style.pixelWidth+204)
}

// function size_logo_main()
// {
//    document.all.logo_main.style.pixelWidth = document.images.sizeX.width-50
// }


