/*
Copyright (c) 2007-2009, AOL LLC
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the AOL LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// Flash XOXO
// http://dev.aol.com/axs
// Version 1.2
// March 10, 2009
// C. Blouch

axs.debug=1;

var test={
	init:function(){
		var d=document,e;
		//Create first link
		e=d.createElement("a");
		e.href="#";
		e.innerHTML="Change first HTML to Flash";
		e.onclick=test.first;
		d.body.insertBefore(e,d.body.firstChild);
		//Create second link
		e=d.createElement("a");
		e.href="#";
		e.innerHTML="Change second HTML to Flash";
		e.onclick=test.second;
		d.body.insertBefore(e,d.body.firstChild);
		//Create third link
		e=d.createElement("a");
		e.href="#";
		e.innerHTML="Change both HTMLs to Flash";
		e.onclick=test.both;
		d.body.insertBefore(e,d.body.firstChild);
		//Create fourth link
		e=d.createElement("a");
		e.href="#";
		e.innerHTML="Change axs_flash_xoxo into flash";
		e.onclick=test.axs_flash_xoxo;
		d.body.insertBefore(e,d.body.firstChild);
	},
	first:function(){
		//Use classname to pick out the area to convert
		//Specify DOM node to put flash into
		axs.flash_xoxo({c:"first",p:1});
		return false;
	},
	second:function(){
		//Specify DOM node to search in for xoxo list
		//and specify DOM node to put flash into
		var spot=axs.id("moreFlashStuff");
		axs.flash_xoxo({o:spot,c:"xoxo",r:spot});
		return false;
	},
	both:function(){
		//Search entire document for xoxo lists to convert
		//and put the flash in the parent node
		axs.flash_xoxo({c:"xoxo",p:1});
		return false;
	},
	axs_flash_xoxo:function(){
		//Convert any axs_flash_xoxo list
		axs.flash_xoxo();
		return false;
	}
}
//When the window fires an onload event, call the function init()
axs.ae(window,'load',test.init);