function getIdFromUrl(url)
{
  t = url.substring(url.indexOf('id=') + 3, url.length);
  return t;
}

function fetchTextForSearch(postId, id) 
{
	postBox = document.getElementById('postbox-' + id);
        //new Effect.BlindDown('postbox-' + id);
        if (postId.indexOf('id=') > -1) {
	  new Ajax.Updater( 'postbox-' + id,  'http://www.brickboard.com/common/FetchPostTextSimple.htm?id=' + getIdFromUrl(postId) + '&fromsearch', { asynchronous:1, success:highlighter.highlight(postBox)} ) ;
	} else {
	  new Ajax.Updater( 'postbox-' + id, postId, { asynchronous:1, success:highlighter.highlight(postBox)} ) ;
	}
	postBox.style.visibility = 'visible';
	postBox.style.display = 'inline';

	document.getElementById('postbox-up-' + id).style.visibility = 'hidden';
	document.getElementById('postbox-up-' + id).style.display = 'none';

	document.getElementById('postbox-down-' + id).style.visibility = 'visible';
	document.getElementById('postbox-down-' + id).style.display = 'inline';
}

function fetchText(id, forum) 
{
        //new Effect.BlindDown('postbox-' + id);
	new Ajax.Updater( 'postbox-' + id,  'http://www.brickboard.com/common/FetchPostTextSimple.htm?id=' + id + '&forum=' + forum, { asynchronous:1} ) ;

	document.getElementById('postbox-' + id).style.visibility = 'visible';
	document.getElementById('postbox-' + id).style.display = 'inline';

	document.getElementById('postbox-up-' + id).style.visibility = 'hidden';
	document.getElementById('postbox-up-' + id).style.display = 'none';

	document.getElementById('postbox-down-' + id).style.visibility = 'visible';
	document.getElementById('postbox-down-' + id).style.display = 'inline';
}
function hideText(id) 
{
	//document.getElementById('postbox-' + id).style.visibility = 'hidden';
	//document.getElementById('postbox-' + id).style.display = 'none';
	new Effect.Squish(document.getElementById('postbox-' + id));

	document.getElementById('postbox-down-' + id).style.visibility = 'hidden';
	document.getElementById('postbox-down-' + id).style.display = 'none';

	document.getElementById('postbox-up-' + id).style.visibility = 'visible';
	document.getElementById('postbox-up-' + id).style.display = 'inline';
}

