// JavaScript Document
// =============改变产品图片选择状态==========================
function show_propic(showid,thumbid,picurl,src){
	// var img_count = {:count($propic)};//产品图片
	document.getElementById(showid).innerHTML = "<a href="+src+" target='_blank'><img src='"+picurl+"' title='点击查看大图'/></a>";
	for(var i=0; i< 4;i++){
		if("thumb_"+i != thumbid){			
			document.getElementById("thumb_"+i).className="hand";
		}else{
			document.getElementById("thumb_"+i).className="hand now";
		}
	}
}


$(document).ready(function(){

$("#selectcate").click(function(){
$("#selectcatelist").show();
});

$("#selectcatelist").mouseover(function(){
$("#selectcatelist").show();
});

$("#selectcatelist").click(function(){
$("#selectcatelist").hide();
});

$("#selectcatelist").mouseout(function(){
$("#selectcatelist").hide();
});


$("#friend_link_arrow").click(function(){
	if($("#friend_link").css('display')=="none"){
		$("#friend_link").css('display','block');
		$("#friend_link").animate({height:80},"normal");
		$("#friend_linkbox").animate({top:"-80px"},"normal");
	}
});
$("body").click(function(){
	if($("#friend_link").css('height')=="80px"){		
		$("#friend_link").css('height','0px');
		$("#friend_linkbox").css('top','0px');
		$("#friend_link").hide();
	}
});

/*-------下拉选择-----*/
$('.dragbox').mousemove(function(){
	$(this).find('.sublist').show();
	$(this).find('h1').addClass('hover');
	});
$('.dragbox').mouseleave(function(){
	$(this).find('.sublist').hide();
	$(this).find('h1').removeClass('hover');
});

	
	$("ul.topnav .parent").mousemove(function() { //When trigger is clicked...
		
		//Following events are applied to the alixixi_com itself (moving alixixi_com up and down)
		$(this).find(".sub").slideDown('fast').show(); //Drop down the alixixi_com on click

		$(this).hover(function() {
		}, function(){	
			$(this).find(".sub").slideUp('fast'); //When the mouse hovers out of the alixixi_com, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});


  
  $('li.mainlevel').mousemove(function(){
  $(this).find('.sublist').slideDown("falt");//you can give it a speed
  });
  $('li.mainlevel').mouseleave(function(){
  $(this).find('.sublist').slideUp("fast");

  
});
});
