/**
 * Copyright (c) 2006 Peter Goodman
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 */

var flash_obj, fid, curr_anchor;
var saf = navigator.userAgent.toLowerCase().indexOf('webkit') != -1;
var ie = typeof document.all != 'undefined';
function initFlashAnchors(id)
{
	fid = id+'_frame';
	document.writeln('<iframe src="blank.php" id="'+fid+'" name="'+fid+'" width="0" height="0" frameborder="no" style="width:0;height:0;padding:0;margin:0;border:0;"></iframe>');
	if(saf || ie)
	{
		document.writeln('<form method="get" action="blank.php" id="'+fid+'_form" target="'+fid+'" style="display:none;"><span><input type="hidden" name="a" value="" id="'+fid+'_input" /></span></form>');
	}
	if(ie)
	{
		flash_obj = window[id];
	}
	else
	{
		flash_obj = document[id];
	}
}
function toggleAnchor(anchor)
{
	if(anchor != curr_anchor)
	{
		if(!saf && !ie)
		{
			(document.frames ? document.frames[fid] : document.getElementById(fid)).src = 'blank.php?a='+anchor;
		}
		else
		{
			document.getElementById(fid+'_input').value = anchor;
			document.getElementById(fid+'_form').submit();
		}
		curr_anchor = anchor;
	}
}
document.getAnchor = function(anchor)
{
	try 
	{
		flash_obj.getAnchor(anchor);
	} 
	catch(e) { }
};