$(function(){
    var li_len = $('#procon').find('.p_image').length;
    for(var i=0;i<li_len;i++){
       $('#procon').find('.p_image').eq(i).bind('mousemove',{li_index:i},show_big_pic);
       $('#procon').find('.p_image').eq(i).bind('mouseout',{li_index:i},hide_big_pic);
    }
});


function show_big_pic(event){
   var index = event.data.li_index;
   var mouse_x = event.pageX;
   var mouse_y = event.pageY;
   $('.fimg_frame').eq(index).show();
   if((mouse_x + $('.fimg_frame').eq(index).width()) > $(window).width()){
       $('.fimg_frame').eq(index).css('left',(mouse_x-$('.fimg_frame').eq(index).width()-15) + 'px');
       $('.fimg_frame').eq(index).css('top',mouse_y+'px');
   }
   else if((mouse_y + $('.fimg_frame').eq(index).height()) > $(window).height()){
       $('.fimg_frame').eq(index).css('left',mouse_x+15+'px');
       $('.fimg_frame').eq(index).css('top',(mouse_y-$('.fimg_frame').eq(index).height()) +'px');
   }
   else{
        $('.fimg_frame').eq(index).css('left',mouse_x+15+'px');
        $('.fimg_frame').eq(index).css('top',mouse_y+'px');
   }
}

function hide_big_pic(event){
  var index = event.data.li_index;
  $('.fimg_frame').hide();
}



$(document).ready(function() {
    $('#menu2').find('dd').hide().end().find('dt').click(function() {
   
        $("#menu2").find("dd").each(function(i) {
            if ($(this).is(':visible')) {
                $(this).slideUp();
            }
        });
        //var answer = $(this).next();//dt
        $(this).parent().children("dd").each(function(i){
            if ($(this).is(':visible')) {
                $(this).slideUp();
            } else {
                $(this).slideDown();
            }
        });
     });//end click
    //根据当前选择的类，查找顶级目录
    $('#selected').parent().parent().attr('id',"showclass");
     
    if($('#showclass')){
        $('#showclass').children("dd").each(function(i){
            $(this).show();
        });
    }
});

