$(document).ready(function(){
	$("#gallery a").lightBox();

	$("#menu ul li").hover(function(){
		$(this).fadeTo(300, 0.5);
	},function(){
		$(this).fadeTo(300, 1);
	});

	$("#prevbtn").hover(function(){
		$(this).attr("src", "images/prev_hover.png");
	},function(){
		$(this).attr("src", "images/prev.png");
	});
	$("#nextbtn").hover(function(){
		$(this).attr("src", "images/next_hover.png");
	},function(){
		$(this).attr("src", "images/next.png");
	});

	$("#header").hover(function(){
		$(".btn").fadeIn(200);
	},function(){
		$(".btn").fadeOut(400);
	});

	var vimgs = Array("uno.png", "dos.png");
	
	//var crt = Math.floor(Math.random()*(vimgs.length));
	var crt = 0;
	
	$(".himg").attr("src", "images/"+vimgs[crt]);
	function next(){
		crt += 1;
		if(crt >= vimgs.length){
			crt = 0;
		}
		return vimgs[crt];
	}
	function prev(){
		crt -= 1;
		if(crt < 0){
			crt = vimgs.length - 1;
		}
		return vimgs[crt];
	}

	$("#prevbtn").click(function(){
		$(".himg").attr("src", "images/"+prev());
	});
	$("#nextbtn").click(function(){
		$(".himg").attr("src", "images/"+next());
	});

	$(".list img").mouseover(function(){
		$(this).fadeTo(400, 0.8, function(){
			$(this).fadeTo(300, 1);
		});
	});
	$("#one ul li img").fadeTo(400, 0.6);
	$("#one ul li img").hover(function(){
		$(this).fadeTo(400, 1);
	},function(){
		$(this).fadeTo(400, 0.6);
	});

	$(".input_wrap .name").css("color", "#AAA").attr("value", "Name");
	$(".input_wrap .email").css("color", "#AAA").attr("value", "E-mail");
	$(".textarea_wrap .message").css("color", "#AAA").attr("value", "Your message here...");
	$(".input_wrap input").focusin(function(){
		$(this).attr("value", "").css("color", "#000");
	});
	$(".textarea_wrap .message").focusin(function(){
		$(this).attr("value", "").css("color", "#000");;
	});
});
