function clearSearch(el) {
	if (el.value == "Search for...") {
		el.value = "";
	}
}

function checkSearch(el) {
	if (el.value == "") {
		el.value = "Search for...";
	};
}

function addInlineClassToImgP(el) {
	if (document.getElementById(el) != null) {
		var el_array = document.getElementById('post_content').getElementsByTagName('img');
		
		for (var i=0, len=el_array.length; i<len; ++i) {
			// var _width = el_array[i].offsetWidth;
			// var _height = el_array[i].offsetHeight;
			var _width = el_array[i].width;
			var _height = el_array[i].height;
			
			var _class;
			
			if (_width == _height) {
				_class = "square";
			} else if (_width < _height) {
				_class = "portrait";
			} else {
				_class = "landscape";
			}

			addClass(el_array[i], _class);
			
			// Put 'inline' on <p> that contains an <img> in a post,
			// so we can wrap text around the image.
			addClass(el_array[i].parentNode.parentNode, "inline");
		}
	}
}

function addClass (el, _class) {
	if (el.className) {
		el.className = el.className + " " + _class;
	} else {
		el.className = _class;
	}
}