// allow the YAHOO logger to log to console, and firebug

function initializePurlPage(){
	YAHOO.widget.Logger.enableBrowserConsole();
}
YAHOO.util.Event.onDOMReady( initializePurlPage );


function switchSearchExpand(el) {
	var parent = el.parentNode;
	var searchExpand;
	var children = parent.getElementsByTagName('div');
	if (children && children.length) {
		for (var i = 0; i < children.length; i ++) {
			var div = children[i];
			if (div.className.indexOf('searchExpand') >= 0) {
				searchExpand = div;
				break;
			}
		}
	}
	if (el.className.indexOf(' expand') >= 0) {
		el.className = el.className.replace(' expand', '');
		searchExpand.style.display = 'none';
	} else {
		el.className = el.className + ' expand';
		searchExpand.style.display = 'block';
	}
}

// check the search box for input
function checkSearchBox(formobj) {
	if (formobj.keyword.value == '') {
		alert("Please input a keyword!");
		return false;
	}
	return true;
}