// -----------------------------------------------------------------------------------
//
//	flash2javascript
//	by Aaron Bassett - http://www.foobr.co.uk
//	10th July 2006
//
//	Quick demonstration file showing communication between
//  flash & Javascript (and back again)
//
//  For further details visit:
//  http://www.foobr.co.uk
//
//	Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License
//     - http://creativecommons.org/licenses/by-nc-sa/2.5/
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
//  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
//  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
//  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
//  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
//  OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//	
//
// -----------------------------------------------------------------------------------

/* ----------------------------- [ VARIABLES ] */
var playing = true;

/* ----------------------------- [ FUNCTIONS ] */
function swapImage() {
	var img = document.getElementById("imgSrc");
	if(img.getAttribute("alt") == "Image1") {
		img.setAttribute("src", "./images/image2.jpg");
		img.setAttribute("alt", "Image2");
	} else {
		img.setAttribute("src", "./images/image1.jpg");
		img.setAttribute("alt", "Image1");
	}
}
function addText(msg) {
	var p = document.createElement("p");
	var text = document.createTextNode(msg);
	p.appendChild(text);
	var div = document.getElementById("addTextDiv");
	div.appendChild(p);
}
function toggleHide(div_id) {
	var div = document.getElementById(div_id);
	if(div.className == "hide") {
		div.className = "";
	} else {
		div.className = "hide";
	}
}
function numStep(value) {
	alert("Current number: " + value);
}
function toggleStart() {
	var flash = document.getElementById("flashAnimation");
	if(playing == false) {
		flash.Play();
		playing = true;
	} else {
		flash.StopPlay();
		playing = false;
	}
}
