/* sorting project */
$(function(){
    $("ul.sort_project li a.sort_01").each(function(){
	$(this).hover(function(){
		$(this).animate({width: "110px"}, {queue:false, duration:450, easing:'easeOutBack'});
      },function() {
		  $(this).animate({width: "24px"}, {queue:false, duration:450, easing:'easeInBack'});
	  });
    });
	
    $("ul.sort_project li a.sort_02").each(function(){
	$(this).hover(function(){
		$(this).animate({width: "95px"}, {queue:false, duration:450, easing:'easeOutBack'});
      },function() {
		  $(this).animate({width: "24px"}, {queue:false, duration:450, easing:'easeInBack'});
	  });
    });
	
    $("ul.sort_project li a.sort_03").each(function(){
	$(this).hover(function(){
		$(this).animate({width: "102px"}, {queue:false, duration:450, easing:'easeOutBack'});
      },function() {
		  $(this).animate({width: "24px"}, {queue:false, duration:450, easing:'easeInBack'});
	  });
    });

    $("ul.sort_project li a.sort_04").each(function(){
	$(this).hover(function(){
		$(this).animate({width: "130px"}, {queue:false, duration:450, easing:'easeOutBack'});
      },function() {
		  $(this).animate({width: "24px"}, {queue:false, duration:450, easing:'easeInBack'});
	  });
    });
});


/* portfolio align
$(function(){
	var hsort_flg = false;

	var vg = $("#grid-content").vgrid({
		easeing: "easeOutQuint",
		useLoadImageEvent: true,
		useFontSizeListener: true,
		time: 400,
		delay: 20,
		fadeIn: {
			time: 500,
			delay: 50
		}
	});

});
 */

$(function(){
    $("input[type=file]").filestyle({
        image:"./images/btn/btn_search_file.gif",
        imageheight:24,
        imagewidth:70,
        width:94
    }); 


	$("#star1").click(function(){
		$("#portfolio_layer").show("fade");			
	});

	$(".close_project").click(function(){
		$("#portfolio_layer").hide("slow");			
	});

	$(".wrap_drop_about").click(function () {
		$(".drop_about").slideDown("slow");
	});



    $(".wrap_drop_about .about, .overview, .vision, .business,.contact, .request, .recruit").click(function(){   // ޴Ŭ ù   
            $("#abouteluo").html(""); //파이어폭스에서 자꾸 충돌나서 없앰
            $(".wrap_drop_about").animate({height: "80px"}, {queue:false, duration:450});
            $(".wrap_drop_portfolio").animate({height: "25px"}, {queue:false, duration:450});
            if($(this).text() == "overview" || $(this).text() == "vision" || $(this).text() == "contact" ||$(this).text() == "business" ){
                $(".overview, .vision, .contact, .business").removeClass("on");
               $(this).addClass("on");
            }
            $("div#abouteluo, div#request, div#recruit").css("display","none");
            $("div#overview, div#vision, div#business, div#contactus").fadeIn("slow");
        });
    $(".recruit, .request").click(function(){
        $(".wrap_drop_about").animate({height: "25px"}, {queue:false, duration:450});   
        $(".wrap_drop_portfolio").animate({height: "25px"}, {queue:false, duration:450});        
        $(".overview, .vision, .contact, .business").removeClass("on");
    });
	
    $(".wrap_drop_portfolio .portfolio, .portfolio2011, .portfolio2010, .portfolio2009, .portfolio2008").click(function(){   // ޴Ŭ ù  
        $(".wrap_drop_about").animate({height: "25px"}, {queue:false, duration:450});           
        $(".wrap_drop_portfolio").animate({height: "80px"}, {queue:false, duration:450});
        if($(this).text() == "2011" || $(this).text() == "2010" || $(this).text() == "2009" || $(this).text() == "2008"){
               $(".portfolio2011, .portfolio2010, .portfolio2009, .portfolio2008").removeClass("on"); 
               $(this).addClass("on");
        }

    });
	
});


/* eluo images rolling */
$(document).ready(function() {
/*
	//Set Default State of each portfolio piece
	$(".eluo_paging").show();
	$(".eluo_paging a:first").addClass("active");

	//Get size of images, how many there are, then determin the size of the image reel.
	var imageWidth = $(".eluo_window").width();
	var imageSum = $(".eluo_image_reel img").size();
	var imageReelWidth = imageWidth * imageSum;

	//Adjust the image reel to its new size
	$(".eluo_image_reel").css({'width' : imageReelWidth});

	//Paging + Slider Function
	rotate = function(){
		var triggerID = $active.attr("rel") - 1; //Get number of times to slide
		var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide

		$(".eluo_paging a").removeClass('active'); //Remove all active class
		$active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)

		//Slider Animation
		$(".eluo_image_reel").animate({
			left: -image_reelPosition
		}, 500 );

	};

	//Rotation + Timing Event
	rotateSwitch = function(){
		play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
			$active = $('.eluo_paging a.active').next();
			if ( $active.length === 0) { //If paging reaches the end...
				$active = $('.eluo_paging a:first'); //go back to first
			}
			rotate(); //Trigger the paging and slider function
		}, 7000); //Timer speed in milliseconds (3 seconds)
	};

	rotateSwitch(); //Run function on launch

	//On Hover
	$(".eluo_image_reel a").hover(function() {
		clearInterval(play); //Stop the rotation
	}, function() {
		rotateSwitch(); //Resume rotation
	});

	//On Click
	$(".eluo_paging a").click(function() {
		$active = $(this); //Activate the clicked paging
		//Reset Timer
		clearInterval(play); //Stop the rotation
		rotate(); //Trigger rotation immediately
		rotateSwitch(); // Resume rotation
		return false; //Prevent browser jump to link anchor
	}); */

});


//recurite open
function openLayer(IdName){
	var pop = document.getElementById(IdName);
	pop.style.display = "block";
}
//recurite close
function closeLayer(IdName){
	var pop = document.getElementById(IdName);
	pop.style.display = "none";
}

