$(function(){
	function pageScroll() {
		$('html, body').animate({
			scrollTop: 0
			},'500',"easeInOutCirc");
	}
	$(".pagetop").click(function(){
		pageScroll();
		return false;
	});
	
	$(".login").qBox({
		href:'/mypage/login.php'
	});
	

    // Global menu
    $('#searchFreelance').click(function() {
			if($(this).next("ul").css("display")=="none"){
				$(this).next("ul").show();
			}else{
				$(this).next("ul").hide();
			}
			return false;
		});

	$("body").click(function(){
		$('#searchFreelance').next("ul").hide();
	});
	
	$("img").each(function(){
		var t=$(this),src=t.attr("src");
		if(src.match("-off.")){
			t.hover(function(){
				t.attr("src",src.replace("-off.", "-on."));
			},function(){
				t.attr("src",src.replace("-on.", "-off."));
			});
		}
	});
	
});


