// ----------------------------------------------------------------------
// CNP CDA Search
// JavaScript commands for view actions.
// ----------------------------------------------------------------------


// Force a page reload with the active URI...
function updateQuery(inputElement) {
	var uri = inputElement.value;
	if(uri != null && uri.length > 0) window.location = uri;
}

// Toggle 'Show Details' data...
function toggleDetails(blockID) {
	jQuery("#more-"+blockID).slideToggle("slow");
	var viewLink = jQuery("#action-more-"+blockID);
	var text1 = 'Show Details';
	var text2 = 'Hide Details';
	setTimeout("toggleText('action-more-"+blockID+"','"+text1+"','"+text2+"')", 700);
	if(viewLink.text() == text1) viewLink.attr("title", 'Hide Details');
	else viewLink.attr("title", 'Show Details');
}

// Toggle text of an HTML element...
function toggleText(elementName, text1, text2) {
	var theElement = jQuery("#"+elementName);
	if(theElement.text() == text1) theElement.text(text2);
	else theElement.text(text1);
}


