﻿var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
var IE7 = false /*@cc_on || @_jscript_version == 5.7 @*/;

  $(document).ready(function(){
    if (!IE6 && !IE7) 
      $('.scroll-pane').jScrollPane();

    $("#centercontent").accordion({
			header: 'h3'
		});
	$('#s1').cycle({ 
		fx:     'scrollHorz', 
		prev:   '#prev1', 
		next:   '#next1', 
		timeout: 0
	});
    lastBlock = $("#a1");
    maxWidth = 685;
    minWidth = 21;

    if (IE6) {
    
      $(".box .click").click(
        function(){
	  if (lastBlock.id != this.id)
	  {
  	    if (lastBlock.length == 1)
	    {
	      lastBlock[0].childNodes[1].style.display='none';
	    } else {
              lastBlock.childNodes[1].style.display='none';
	    }
	  }
	  if (lastBlock.id == "a3") {
	    document.getElementById('flashbox').style.display='none';
	  }

          $(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
	  $(this).animate({width: maxWidth+"px"}, { queue:false, duration:400});

	  if (lastBlock.id != this.id)
	  {
	    lastBlock = this;
	    setTimeout('lastBlock.childNodes[1].style.display="block"', 400);
            if (lastBlock.id == "a5") {
	      $("#a5").click(function(){});
	      document.getElementById("scroll-pane").style.overflow="hidden";
              setTimeout('$(".scroll-pane").jScrollPane()', 501);
            }
	    if (lastBlock.id == "a3") {
	     setTimeout('document.getElementById("flashbox").style.display="block"', 400);
	    }
	  }
        }
      );

    } else {
    $(".box .label").click(
      function(){
	if (IE7  && lastBlock.id != this.parentNode.id)
	{
  	  if (lastBlock.length == 1)
	  {
	    lastBlock[0].childNodes[1].style.display='none';
	  } else {
           lastBlock.childNodes[1].style.display='none';
	  }
	}
	if (lastBlock.id == "a3") {
	  document.getElementById('flashbox').style.display='none';
	}

        $(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
	$(this.parentNode).animate({width: maxWidth+"px"}, { queue:false, duration:400});

	lastBlock = this.parentNode;
	if (IE7)
	{
	  setTimeout('lastBlock.childNodes[1].style.display="block"', 400);
          if (lastBlock.id == "a5") {
            setTimeout('$(".scroll-pane").jScrollPane()', 501);
          }
	} 

	if (lastBlock.id == "a3") {
	  setTimeout('document.getElementById("flashbox").style.display="block"', 400);
	}



      }
    );
    }

  });

function setWidth() { 
 if (IE6)
 {
   var windowWidth = document.body.clientWidth;
if (windowWidth < 1000)
   {
     windowWidth = 1000;
   }
screenwidth = windowWidth+'px';
document.getElementById('header').style.width=screenwidth;
 }
}
