// JavaScript Document

function blogShow(i){
	if (i != "all"){
		var test="blog"+i;
		var title = document.getElementById(test);
		$(title).addClass('selected');
		//$title.addClass('blogged');
		$('.selected').siblings().css('display', 'none');
		$('.showall').css('display', 'none');
		$('.selected').css('display', 'block');
		$('.selected p.showall').css('display', 'block');
		$(title).removeClass('selected');
		//$(title).siblings('post').css('display', 'none');
	} else {
		$('div.blogged').siblings().css('display', 'block');
		$('.showall').css('display', 'none');
	}
}


alert("1");

$(document).ready(function() {

	$("div.link_title").click(function()
	{
		$(this).next("div.link.show").slideToggle(400).siblings("div.link").slideUp("slow");
		$(this).next("div.link.hide").slideUp(400).siblings("div.link").slideUp("slow");
	});  

	
	var pic = document.getElementById("bg");
		var h = pic.offsetHeight;
		var w = pic.offsetWidth;
		var ratio = h/w;

scaler();
		window.setInterval(scaler, 200);

		function scaler() {
		
		 var myWidth = 0, myHeight = 0;
		  if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		  }
		
			if (ratio>(myHeight/myWidth)){
				$('#bg').removeClass('high');
				$('#bg').addClass('wide');
			} else {
				$('#bg').addClass('high');
				$('#bg').removeClass('wide');
			}
		
		}alert("2");
		});	

	
	
	
});  

	
		
