//---------------------------------------------------------------------------
//
//  flashBridge
//	v1.1
//
//  Created by: Bob Corporaal - reefscape.net on 23-09-2006.
//	Contact: bob@reefscape.net
//
//
//	Description:
//	
//	Functions as a bridge between actionscript and the javascript.
//	Provides some general functionality
//
//	Changes:
//
//	v1.1	2-10-06
//	- added MIT license
//
//	v1		27-9-06
//	- initial release
//
//
//	MIT / X11 License
//
//	Copyright (c) 2006 Bob Corporaal - reefscape.net
//	
//	Permission is hereby granted, free of charge, to any person obtaining a copy of 
//	this software and associated documentation files (the "Software"), to deal in 
//	the Software without restriction, including without limitation the rights to 
//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
//	of the Software, and to permit persons to whom the Software is furnished to do 
//	so, subject to the following conditions:
//	
//	The above copyright notice and this permission notice shall be included in all 
//	copies or substantial portions of the Software.
//	
//	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.
//---------------------------------------------------------------------------
//
//
var flashBridge;
//
//	getFlashID - get the reference to the swf
//
//	this needs to be called before any other bridge functionality can be used
//	but after the document is fully loaded
//
function flashBridgeInit(swfID)
{
	if (navigator.appName.indexOf("Microsoft") > -1) {
		flashBridge = window[swfID];
	} else {
		flashBridge = document[swfID];
	}
}
//
//	setDocumentTitle - to set document title
//
function setDocumentTitle(str)
{
	document.title = str;
}
//
//	set div sizes
//
//	based on work by Mustardlab
//	for more info see: http://www.mustardlab.com/developer/flash/objectresize/
//
//	setDivWidth
//
function setDivWidth(divid, newW)
{
	document.getElementById(divid).style.width = newW+"px";
}
//
//	setDivHeight
//
function setDivHeight(divid, newH)
{
	document.getElementById(divid).style.height = newH+"px";
}
//
//	setDivSize
//
function setDivSize(divid, newW, newH)
{
	setDivWidth(divid, newW);
	setDivHeight(divid, newH);
}
