
var _animTypeList = ["liquid","liquid"];
var _animType = _animTypeList[ Math.floor(Math.random()*_animTypeList.length) ];

$(document).ready(function(){				   
	$("h1").css("display","none");
	setMouseFunc();	
	
});

$(window).load(function(){
						
	eval(_animType+"Anim")();			
})


function slideAnim()
{
		
	$("h1").css("display","none");
	$("#logoAnim").css("display","block");
	
	$('#l_t').css("background-position","0px 132px");
	$('#l_n').css("background-position","0px 62px");
	$('#l_g').css("background-position","0px 77px");
	$('#l_r').css("background-position","0px 126px");
		
	if(!jQuery.support.opacity){
		
		$('#l_t').delay(500).animate( { backgroundPositionY:"-1188px" },1000,"easeOutSine" );
		$('#l_n').delay(600).animate( { backgroundPositionY:"-558px" },1000,"easeOutSine" );
		$('#l_g').delay(700).animate( { backgroundPositionY:"-694px" },1000,"easeOutSine" );
		$('#l_r').delay(800).animate( { backgroundPositionY:"-1134px" },1000,"easeOutSine" );
	}
	else{
		
		$('#l_t').delay(500).animate( { backgroundPosition:"(0px -1188px)" },1000,"easeOutSine" );
		$('#l_n').delay(600).animate( { backgroundPosition:"(0px -558px)" },1000,"easeOutSine" );
		$('#l_g').delay(700).animate( { backgroundPosition:"(0px -694px)" },1000,"easeOutSine" );
		$('#l_r').delay(800).animate( { backgroundPosition:"(0px -1134px)" },1000,"easeOutSine" );
		
	}
}

function liquidAnim()
{	
	$("h1 img").remove();
	$("h1").css("display","block");
	setTimeout(liquid , 100);
}

function liquid()
{
	Liquid({
	
		src:"./img/logo.gif",
		target:$("h1")[0],
		direction:"left",
		speed:70
	})
}


function setMouseFunc()
{
	$('.popup').CreateBubblePopup();
						   		
	$("a").mouseover(function(){
		
		if(!jQuery.support.opacity) $(this).parent().stop().animate( { backgroundPositionY:"-38px" },300,"easeOutSine" );
		else $(this).parent().stop().animate( { backgroundPosition:"(0px -38px)" },300,"easeOutSine" );
		
		
		var ballonText;
		var uid =  $(this).parent().attr("id");
		
		switch(uid){
			
			case "twitter" : ballonText = "To twitter";
			break;
			
			case "portfolio" : ballonText = "To portfolio 'Go to portflio is necessary for ID,PW' ";
			break;
			
			case "mail" : ballonText = "To contact";
			
			break;
		}
		
				
		$(this).ShowBubblePopup({
								
			innerHtml:ballonText,
	
			innerHtmlStyle:
			{
				color:'#333', 
				'text-align':'center'
			},
			
			themeName: 	'grey',	
			themePath: './img/jquerybubblepopup-theme'

		});
		
	});
	
	$("a").mouseout(function(){
				
		if(!jQuery.support.opacity) $(this).parent().stop().animate( { backgroundPositionY:"0px" },300,"easeOutSine" );
		else $(this).parent().stop().animate( { backgroundPosition:"(0px 0px)" },300,"easeOutSine" );
	});
}
