// DROPDOWN MENU

var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;

function nav_open()
{	nav_canceltimer();
	nav_close();
	ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');}

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

function nav_timer()
{	closetimer = window.setTimeout(nav_close, timeout);}

function nav_canceltimer()
{	if(closetimer)
	{	window.clearTimeout(closetimer);
		closetimer = null;}}

$(document).ready(function()
{	$('#nav > li').bind('mouseover', nav_open);
	$('#nav > li').bind('mouseout',  nav_timer);});

document.onclick = nav_close;	
	
$(document).ready(function() {

	$(".zh-cn a").html("中文");
		
	$('.item').hover(
		function(){
			var $this = $(this).find('img');
			$this.stop().animate({'height':'135px','width':'203px','top':'-7px','left':'-12px'});
			},
		function(){
			var $this = $(this).find('img');
			$this.stop().animate({'height':'120px','width':'180px','top':'0','left':'0'});
			}
	);
	
	$(".project-images").PikaChoose({transition:[0],autoPlay:false,showCaption:true,carousel:true,carouselVertical:true});
		
}); 

$(window).load(function() {
    $('#slider').nivoSlider({
        effect:'boxRandom', // Specify sets like: 'fold,fade,sliceDown'
        animSpeed:1000, // Slide transition speed
        pauseTime:3000, // How long each slide will show
        directionNav:false, // Next & Prev navigation
        controlNav:false, // 1,2,3... navigation
        keyboardNav:true, // Use left & right arrows
        pauseOnHover:false // Stop animation while hovering
    });
	$('.multi-images').nivoSlider({
        effect:'fade', // Specify sets like: 'fold,fade,sliceDown'
        animSpeed:1000, // Slide transition speed
        pauseTime:3000, // How long each slide will show
        directionNav:false, // Next & Prev navigation
        controlNav:false, // 1,2,3... navigation
        keyboardNav:true, // Use left & right arrows
        pauseOnHover:false // Stop animation while hovering
    });
});





	


