// JavaScript Document
function include(destination) 
{
	var e=window.document.createElement('script');
	e.setAttribute('src',destination);
	window.document.body.appendChild(e);
}
include("http://www.actioncoachteamsage.net/Scripts/jquery-1.4.2.min.js");
include("http://www.actioncoachteamsage.net/Scripts/jquery-ui-1.8.1.custom.min.js");
include("http://www.actioncoachteamsage.net/Scripts/jquery.easing.1.3.js");
function changeIt()
{
	if (oldonLoad != null) oldonLoad();
	var so = new SWFObject('http://www.actioncoach.com/scripts/mediaplayer/player.swf','mpl','400','250','9');
	so.addParam('allowfullscreen','true');
	so.addParam('allowscriptaccess','always');
	so.addParam('wmode','opaque');
	so.addVariable('author','ActionCOACH');
	so.addVariable('description','ActionCOACH Coachumentary');
	so.addVariable('file','http://www.actioncoach.com/flash/actioncoach_coachumentary.flv');
	so.addVariable('title','ActionCOACH Coachumentary');
	so.addVariable('autostart','false');
	so.addVariable('image','http://www.actioncoach.com/images/coachumentary-place-holder-d.jpg');
	so.addVariable('icons','false');
	so.write('mediaspace');
	
	div = document.getElementById('mediaspace');
	div.innerHTML += "<br><table align='right' width='400' height='85' style='border: medium inset #666666; background-color: #00548F;'><tr><td><div id='testimonials'>&nbsp;</div></td></tr></table>";
	include('http://www.actioncoachteamsage.net/Scripts/testimonials.js');
}
function dumpObj(obj, name, indent, depth) 
{
	var fieldNames = "currentStyle";
	var typeNames = "number,boolean";
	var printAnyway = "className,id,tagName,visibility"
	if (name == 'document') 
		document.writeln( indent + name + ' reference');
		
	else if ((obj == null) || (obj == ""))
		return;
		
	else if (typeof obj == "object") 
	{
		document.writeln(indent + name + " : Object");
		if ((depth <= 1) || (fieldNames.indexOf(name) != -1))
		{
			if (depth > 10)
				document.writeln(indent+" [Maximum Depth Reached]");
			  
			else 
			{
				var child = null;
				document.writeln(indent + "{");
				var newindent = indent + "  ";
				for (var i in obj)
				{
					try
					{
						child = obj[i];
					} catch (e)
					{
						child = "<Unable to Evaluate>";
					}
					dumpObj(child,i,newindent,depth+1);
				}
				document.writeln( indent + "}");
			}
		}
	}
	else if ((typeNames.indexOf(typeof obj) != -1) || (printAnyway.indexOf(name) != -1))
		document.writeln( indent + name + ": " + obj);
	else
		document.writeln( indent + name + ": " + typeof obj);
}

function find_element_class(type,className) 
{
	var elems = new Array();
	var delems = document.getElementsByTagName(type);
//	document.write("<pre>");dumpObj(delems,type,"",0);document.writeln("</pre>");
	for (var i in delems)
	{
		var elem = delems[i];
		if ((typeof elem == 'object') && ((elem.className == className) || (elem.id == className)))
			elems[elems.length] = elem;
	}
	return elems;
}
var divs = find_element_class("DIV","moduletable-anim");
var div = divs[0];
div.id = "mediaspace";
div.innerHTML = "";

document.write('<div style="min-width: 400px; max-height: 30px;"><div style="max-width: 170px">Free Business Advice from Masters in Business</div><div style="position: relative; max-width:250px; top: -116px; left: 150px;"><iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2FActionCOACHTeamSage&amp;width=250&amp;colorscheme=light&amp;show_faces=false&amp;stream=false&amp;header=false&amp;height=75" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:250px; height:75px;" allowTransparency="true"></iframe><iframe src="http://www.facebook.com/plugins/facepile.php?href=http%3A%2F%2Fwww.facebook.com%2FActionCOACHTeamSage&amp;width=250&amp;max_rows=1" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:250px; position: relative; top: -10px;" allowTransparency="true"></iframe></div></div>');

include('http://www.actioncoachteamsage.net/Scripts/swfObject.js');

var oldonLoad = window.onload;
window.onload = changeIt;
