function account_hide ()
{
	$ ('#account_panel').css ('display', 'none');
	return false;
}

function account_tab (idx)
{
	$ ('#account_panel').css ('display', 'block');
	tabswitch ('loggedin', idx);
	return false;
}

function edition_select (edition)
{
	$ ('#edition_bar').slideUp ();
	if (edition)
	{
		var now = new Date ();
		var expires = new Date (now.getTime () + (10 * 365 * 24 * 3600 * 1000));
		document.cookie = 'edition=' + edition + ';domain=.africareport.com;expires=' + expires.toGMTString ();
	}
}

function other_captcha ()
{
	var e = document.getElementById ('captcha_img');
	var s = e.src.replace (/\?ts=\d+/, '');
	e.src = s + '?ts=' + new Date ().getTime ();
}

function populate_industries (from)
{
	document.getElementById ('ind').innerHTML = document.getElementById (from).innerHTML;
}

function reply_to (id)
{
	$ ('#comment_parent').attr ('value', id);
	if (!document.getElementById ('comment_label'))
	{
		$ ('#commentform h3').text ('Replying to comment');
		$ ('<label id="commentlabel"></label>').insertAfter ('#commentform h3');
		$ ('<div id="commentoriginal"></div>').insertAfter ('#commentlabel');
	}
	
	$ ('#commentlabel').text (
		'In reply to a comment by ' +
		$ ('#comment-' + id + ' span.author').text () +
		' dated ' + $ ('#comment-' + id + ' span.date').text ()
	);
	$ ('#commentoriginal').text ($ ('#comment-' + id + ' .text').text ());
}

function tabswitch (id, idx)
{
	$ ('#' + id + ' .tabs li').removeClass ('current').eq (idx).addClass ('current');
	$ ('#' + id + ' .tab').addClass ('inactive').eq (idx).removeClass ('inactive');
	return false;
}
