$(function() {
	if(typeof sIFR == "function") {
		//sIFR.replaceElement("#nav #pages li ul li", named({sFlashSrc: "http://tangibleresult.nl/wp-content/themes/tangible/monitorbold.swf", sColor: "#3c3c3c", sHoverColor: "#2aace2", sWmode: "transparent"}));
		sIFR.replaceElement("#nav #pages li", named({sFlashSrc: "/wp-content/themes/tangible/monitorbold.swf", sColor: "#3c3c3c", sHoverColor: "#2aace2", sWmode: "transparent"}));
		sIFR.replaceElement("#nav #footer li", named({sFlashSrc: "/wp-content/themes/tangible/monitorbold.swf", sColor: "#2aace2", sHoverColor: "#3c3c3c3"}));
		sIFR.replaceElement("#main #content h1", named({sFlashSrc: "/wp-content/themes/tangible/monitorbold.swf", sColor: "#3c3c3c"}));
	}

	$("#search input[type=text]").defaultValue("search (type here)");

	$(window).resize(function() {
		$("#main").height( $(window).height() - 120 - 74 + 40);
		$("#main #sidebar").height( $(window).height() - 120 - 74 - 82  + 40);
		$("#content").width( $(window).width() - 320);
		$("#border1").width( $(window).width() - 270 - 26);
		$("#border2").width( $(window).width() - 270 - 26);

		if ($(window).height()-120+40 < $("#pages").height() + $("#pages").position().top) $("#footer").css({top: $("#pages").height() + $("#pages").position().top + "px", bottom: "auto"});
		else {
			$("#footer").css({bottom: "0", top: "auto"});
		}
	}).resize();

	/*$("#nav div ul li").click(function(event) {
		alert($(event.target).parent().next().tag());

		event.preventDefault();
	});*/

	$('input').keydown(function(e){
		if (e.keyCode == 13) {
			$(this).parents('form').submit();
			return false;
		}
	});
	
});

