$(document).ready(function() {

	$("pre > code").each(function() {
		//var pre = $(this).parent();
		//pre.snippet("javascript", {"style":"ide-msvcpp"});


		//$("ol.snippet-num").each(function() {
		//	$(this).children("li:even").css({"background":"#f4f4f4"});
		//});

		$(this).addClass("prettyprint");
	});

	if (!$.browser.msie || $.browser.version >= 9)
	{
		prettyPrint();
	}

//	$("pre > code").each(function() {
//		var pre = $(this).parent();
//		pre.addClass("code");
//
//		var button = $("<a href='#'>Show Code</a>");
//		button.insertAfter(pre);
//
//		var closeButton = $("<a href='#'>X</a>");
//		
//		pre.detach();
//		pre.insertBefore("#main");
//
//		pre.snippet("javascript", {"style":"ide-msvcpp"});
//
//		closeButton.prependTo(pre);
//		closeButton.css({"float": "right", "color":"#666", "text-decoration":"none", "font-family":"Verdana", "margin-top":"-5px"});
//
//		button.click( function () {
//			
//			$("#backgroundPopup").css({  
//				"opacity": "0.5"  
//			}); 
//
//			var windowWidth = document.documentElement.clientWidth;  
//			var windowHeight = document.documentElement.clientHeight;  
//			var popupHeight = Math.min((windowHeight * 0.8), pre.height() + 32);  
//			var popupWidth = pre.width() + 32;  
//			var offset = $(document).scrollTop();
//					
//			pre.css({  
//				"position": "absolute",  
//				"top": (windowHeight / 2  - popupHeight / 2 + offset - 30) + "px",  
//				"height": Math.min((windowHeight * 0.8) - 32, pre.height()),
//				"overflow": "auto",
//				"left": (windowWidth/2-popupWidth/2) + "px",
//			});
//			$("#backgroundPopup").fadeIn("slow");
//			pre.fadeIn("slow");
//
//			return false;
//		});
//
//		closeButton.click(function() {
//			pre.fadeOut("slow");
//			$("#backgroundPopup").fadeOut("slow");
//			return false;
//		});
//
//		$("ol.snippet-num").each(function() {
//			$(this).children("li:odd").css({"background":"#f8f8f8"});
//		});
//	});
//
//	$("#backgroundPopup").click(function() {
//		$(this).fadeOut("slow");
//		$("pre.code").each(function() {
//			$(this).fadeOut("slow");
//		});
//	});
});
