$(document).ready(function(){
	
	var optheight = $('.skinOptions').innerHeight();
	
	$('.skinOptions').css("top", "-" + optheight + "px");
	$('.hideOptions').hide();

	$('.showOptions').click(function() {
		$(".skinOptions").show().animate({"top": "+=" + optheight + "px"}, "slow");
	 	$(this).hide();
	 	$('.hideOptions').show();
	});
	$('.hideOptions').click(function() {
		$(".skinOptions").show().animate({"top": "-=" + optheight + "px"}, "slow");
	 	$(this).hide();
	 	$('.showOptions').show();
	});
	
	
	$("#projects li a").mouseover(function(){
		$(this).addClass("hover");
	}).mouseleave(function(){
		$(this).removeClass("hover");
	});
	
	$("#projects li a").click(function(){
		$(this).addClass("clicked");
	});
	
	
	$("#css-black").click(function() {
	$("link[rel=stylesheet]").attr({href : "css/black.css"});
	});

	// blue
	$("#css-white").click(function() {
	$("link[rel=stylesheet]").attr({href : "css/white.css"});
	});

	// green
	$("#css-gray").click(function() {
	$("link[rel=stylesheet]").attr({href : "css/gray.css"});
	});
	
	// no css
	$("#css-no").click(function() {
	$("link[rel=stylesheet]").attr({href : "css/no.css"});
	});
	

});




window.onorientationchange = function(){
	
	var contentType = "show_";
	switch(window.orientation){
		case 0:
		document.getElementById('projects-head').style.display = 'block';
		document.getElementById('aboutme').style.display = 'none';
		document.getElementById('projects').style.display = 'block';
		
		break;

		case -90:
		document.getElementById('projects-head').style.display = 'none';
		document.getElementById('projects').style.display = 'none';
		document.getElementById('aboutme').style.display = 'block';
		break;

		case 90:
		document.getElementById('projects-head').style.display = 'none';
		document.getElementById('projects').style.display = 'none';
		document.getElementById('aboutme').style.display = 'block';
		break;

		case 180:
		document.getElementById('projects-head').style.display = 'block';
		document.getElementById('projects').style.display = 'block';
		document.getElementById('aboutme').style.display = 'none';
		break;
	}
}
