$().ready(function(){
      /*    MENU    */
      $("#menu_list > li:last-child").css("border-right", "none");
      $('#menu_list > li').bind('mouseover', menu_open);
	$('#menu_list > li').bind('mouseout',  menu_timer);


      /*    SLIDER    */
      var timeSlide = 400;
      $(".hover_content").css("top", "150px");
      $(this).find(".hover_content").find(".hover_description").hide();
      $(this).find(".hover_content").find(".hover_description").animate({"opacity":"0"},0);

      $(".wrap").hover(function(){
          //$(this).find(".hover_content").find(".hover_description").stop().slideDown(700);
          $(this).find(".hover_content").find(".hover_description").show();
          $(this).children(".hover_content").stop().animate({"top" : "28"}, timeSlide);
          $(this).find(".hover_content").find(".hover_description").stop().animate({"opacity":"1"},timeSlide);
      }, function(){
          $(this).children(".hover_content").stop().animate({"top" : "150"}, timeSlide);
          $(this).find(".hover_content").find(".hover_description").stop().animate({"opacity":"0"},timeSlide, function(){
              $(this).hide();
          });
      });


      /* BLIND LINK and INTERNAL ANCHOR FIX */
     
      $("a").click(function(){
          var href = $(this).attr("href")
          var reg = new RegExp("#.*");
          if(href == "#") return false;
          else if(href.match(reg)){
              var anchor = href.match(reg);
              //alert(thisPageName+anchor);
              document.location = thisPageName+anchor;
              return false;

          }else return true;
      });

});



var timeout = 300;
var closetimer = 0;
var ddmenuitem = 0;

function menu_open()
{	menu_canceltimer();
	menu_close();
	ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');}

function menu_close(){	if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function menu_timer(){	closetimer = window.setTimeout(menu_close, timeout);}

function menu_canceltimer(){
    if(closetimer){
        window.clearTimeout(closetimer);
        closetimer = null;
    }
}
document.onclick = menu_close;

