/**
	Started: 29th February 2008
	Rights: Unless noted, code is copyright Darren Burnhill, 2008
*/

/**
	Modification of Macromedia function (v4.01) to fix for Firefox, etc., remove support for Netscape Navigator and format to an understandable state.
	Copyright: Macromedia/Adobe
*/
function DBfindObjDaz(n, d)
{ 
	var p,i,x;
	if ( !d )
	{
		d = document;
	}
	if ( (p = n.indexOf('?')) > 0 && parent.frames.length )
	{
		d = parent.frames[n.substring(p+1)].document;
		n = n.substring(0,p);
	}
	if ( !(x = d[n]) && d.all )
	{
		x = d.all[n];
	}
	for (i = 0; !x && i < d.forms.length; i++)
	{
		x = d.forms[i][n];
	}
	if ( !x && d.getElementById )
	{
		x = d.getElementById(n);
	}	
	return x;
}

/**
	Modification of Macromedia function (v3.0) to fix support for Firefox et al and format to an understandable state.
	See http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15431
	Copyright: Macromedia/Adobe
*/
function DBcontrolFlashMM(objStr, x, cmdName, frameNum)
{
  var obj = DBfindObjDaz(objStr);
  if (obj && obj[1])
	{
		obj = obj[1];
	}
	if (obj)
	{
		eval('obj.' + cmdName + '(' + ((cmdName=='GotoFrame') ? frameNum : '') + ')');
	}
}

function DBcontrolFlash(objStr, cmdName, frameNum)
{
  var obj = document.getElementById(objStr);
	if (obj)
	{
		eval('obj.' + cmdName + '(' + ((cmdName=='GotoFrame') ? frameNum : '') + ')');
	}
}

/**
	Copyright Darren Burnhill, 2008
	http://www.darrenburnhill.com/
	Rights: Leave this notice in place for free usage
	This function generates the title and description primarily for image maps.
	Make sure NOT to use a <p> tag as the parent element if your are using block level elements (not even line breaks) - IE will complain with an 'Unknown runtime error' 
	I would rather have used firstChild to get title, but Mozilla inserts text nodes for whitespace between tags.
**/
function DBFillInnerHTML(elTargetStr, IDPrefix, elSourceObj)
{
	var elTarget = document.getElementById(elTargetStr);
	if ( elSourceObj == null )
	{
		elTarget.innerHTML = elTarget.title;
		return;
	}
	var fillStr = '<div class="jstitle">'+elSourceObj.title+'</div>';//
	elSourceObj = document.getElementById(IDPrefix+elSourceObj.id.replace(/\d+$/, ''));//////
	elTarget.innerHTML = fillStr+'<p>'+elSourceObj.innerHTML+'</p>';
}


