


/**************************************************************************************
*                           COMPANION COMPUTERS LIMITED | CCL 
*           www.companioncomputers.co.uk | info@companioncomputers.co.uk
***************************************************************************************
*              www.compan.net | www.ccloe.co.uk | www.codebean.co.uk
***************************************************************************************
*   Application : ImagineGroupDB 
*        Author : Andrew Scott (andrew@compan.net) | km0|km0ti0n (km0ti0n@gmail.com)
*          Date : 01/03/2007
*       Version : 0.0.1
*   Description : Standard script for use with ImagineGroupDB web site
*     Copyright : Companion Computers Ltd. | CCL (c) 1987 / 2008 All rights Reserved.
***************************************************************************************
*       Licence : The duplication, distribution and modification for this code is  
*               : prohibited under international, and UK, law.  This code can only be 
*               : used with prior written persission and concent of CCL.  This header
*               : header must be retained, with the sole exception of compression,
*               : where any peer javascript libs / files too must be compressed.
***************************************************************************************
*    Dependancy : Core / Base / XAP
***************************************************************************************

***************************************************************************************
*         Class : ImagineGroupDB
*   Description : Class to wrap global references and application logic
***************************************************************************************/
function ImagineGroupDB(){}; _this = ImagineGroupDB.prototype = new Base();

/* Define Private variables */
_this.constructor		= ImagineGroupDB();
_this.ClassName			= "ImagineGroupDB";
_this.oPriceRef = null;

/**************************************************************************************
*        Method : Init
*        Params : n/a
*       Returns : n/a
*   Description : Standard Method to be called when the new Object of the
*               : class is instantiated.
***************************************************************************************/
_this.Init = function(){
    this.PreInit();
    this.referenceStaticElements();
    this.attachToAJAX();
    this.attachToPopupController();
    
    // stick non AJAX onload stuff here.
     if( bVista ){AddClass( document.body, "VistaStyle" );}

}



/**************************************************************************************
*        Method : attachToAJAX
*   Description : Attaches to the .net AJAX (equlivant to onload)
***************************************************************************************/ 
_this.attachToAJAX = function(){
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(
        function(){
            oImagineGroupDB.CCL_endRequestHandler();
        }
    );
}   

/**************************************************************************************
*        Method : attachToPopupController
*   Description : Attaches to Popup Controller
***************************************************************************************/ 
_this.attachToPopupController = function(){
    
    this.oPopupController = new PopupController();
    this.oPopupController.Parent = this;
    this.Controls.Add( this.oPopupController );
}



/**************************************************************************************
*        Method : referenceStaticElements
*        Params : n/a
*       Returns : n/a
*   Description : Load up custom HTML elements
***************************************************************************************/
_this.referenceStaticElements = function(){

}


/**************************************************************************************
*        Method : CCL_endRequestHandler
*   Description : The AJAX onload
***************************************************************************************/

_this.CCL_endRequestHandler = function(){
/*
if( typeof cPriceID != "undefined" ){
    this.oPriceRef = document.getElementById( cPriceID ); 
    this.flashPrice(); 
}*/

this.oPopupController.actionPopups();

}


/***************************************************************************************
*         Class : PopupController
*   Description : Class to wrap global references and application logic
***************************************************************************************/
function PopupController(){}; _this = PopupController.prototype = new Base();

/* Define Private variables */
_this.constructor		= PopupController();
_this.ClassName			= "PopupController";
_this.oPopupController  = null;

/**************************************************************************************
*        Method : Init
*   Description : Standard Method to be called when the new Object of the
*               : class is instantiated.
***************************************************************************************/
_this.Init = function(){
    this.referenceStaticElements();
}


/**************************************************************************************
*        Method : referenceStaticElements
*   Description : Load up custom HTML elements
***************************************************************************************/
_this.referenceStaticElements = function(){
    this.eBGPopup = document.getElementById( "CCL_bgOverlay" ); 
}

/**************************************************************************************
*        Method : actionPopups
*   Description : Checks for and shows any popups
***************************************************************************************/
_this.actionPopups = function(){
    if( this.hasPopups() ){
        this.showPopups();
    }else{
        this.hidePopups();
    }
}


/**************************************************************************************
*        Method : hidePopups
*   Description : Ensures that if no popups are in view none of 
*               : the supporting CSS is active
***************************************************************************************/
_this.hidePopups = function(){
    with( this.eBGPopup.style){
        display = "none";
        if( !bFF ){ document.body.style.overflow = ""; }
    }
}


/**************************************************************************************
*        Method : showPopups
*   Description : Displays and positions first found Popup and 
*               : the supporting CSS is set active
***************************************************************************************/
_this.showPopups = function(){
    if( this.aPopups.length <= 0 ){ return; }
    oPopup = this.aPopups[0]; 
    
    oPopup.style.left = "-1000px";
    oPopup.style.top = "-1000px";    
    oPopup.style.display = "block";
    
    var nPopupHeight = oPopup.offsetHeight;
    var nPopupWidth = oPopup.offsetWidth;

   
      /* IE7 or later uses .body all others use documentElement */
    var nScrollTop      =  document.body.scrollTop;
    var nClientHeight   =  document.body.clientHeight;
    var nOffsetWidth    =  document.body.offsetWidth;
    var nScrollHeight   =  document.body.scrollHeight;
    /*
    alert(nScrollTop);
    alert(nOffsetWidth);
    alert(nScrollHeight);
    alert(nClientHeight);
    
    
    
    /* Position the Popup in the center */    
    with( this.eBGPopup.style){
        top     = "0px";
        height  = nScrollHeight + "px"; 
        zIndex  = 980000;
        display = "block";
    }
    
    with( oPopup.style ){
        left    = ((nOffsetWidth - nPopupWidth)  / 2 ) + "px";
        top     = ( nScrollTop + ( ( nClientHeight - nPopupHeight )/ 2 ) + "px" );
        zIndex  = 990000;
        display = "block";
    }

}


/**************************************************************************************
*        Method : hasPopups
*   Description : Checks for and references any CCL_Popups
***************************************************************************************/
_this.hasPopups = function(){
    this.aPopups = document.getElementsByClassName( "CCL_popup" ); 
    if( this.aPopups.length > 0 ){ return true; }else {return false;}
    
}


/**************************************************************************************
*                           PUBLIC METHODS & VARIABLES
***************************************************************************************/
var oImagineGroupDB;

/**************************************************************************************
*      Function : __initImagineGroupDB
*        Params : n/a
*       Returns : n/a
*   Description : Creates a new docherty onload
***************************************************************************************/
function __initImagineGroupDB(){
    //__roundCorners();
    oImagineGroupDB                   = new ImagineGroupDB();
    oImagineGroupDB.Parent            = null;
    oImagineGroupDB.ParentElement     = null;
    oImagineGroupDB.Init();
}

/**************************************************************************************
*      Function : __initImagineGroupDB
*        Params : n/a
*       Returns : n/a
*   Description : Creates a new docherty onload
***************************************************************************************/
function __unloadPage(){
    if( typeof( stopMedia == "function" ) ){ stopMedia(); }
}

/**************************************************************************************/
AddEvent(window, "load", __initImagineGroupDB);     /* Start the application */
AddEvent(window, "unload", __unloadPage);              /* Handle Flash unloading */

/**************************************************************************************
                                    CCL FLASH SCRIPT
**************************************************************************************/

/* swfControl */
///////////////////// swfPlayerGobalFunctions /////////////////////

var swfFormFixStatus = false;
var swfFormFixDelay = 0;

swfPlayerSetFormFixStatus = function () {
	clearInterval(swfFormFixDelay);
	swfFormFixStatus = true;
}

swfPlayerCheckFormFixStatus = function () {
	return swfFormFixStatus;
}

/////////////////////////// end ////////////////////////


///////////////////// swfPlayerControl /////////////////////

function swfPlayerControl(){}

var _this = swfPlayerControl.prototype = new Object();

_this.constructor			= swfPlayerControl;

_this.className = "swfPlayerControl";

_this.browser = "";

_this.aSwfControls = [];
_this.aSwfPlayerName = [];
_this.aSwfControlStatus = [];

_this.init = function () {

	if (navigator.appName.indexOf("Microsoft") != -1) {
		// IE
		this.browser = "IE";
	} else {
		// FireFox
		this.browser = "FF";
	}
	
}

_this.addSwfControl = function (cControl, cPlayer) {
	this.aSwfControls.push(cControl);
	this.aSwfPlayerName.push(cPlayer);
	this.aSwfControlStatus.push(false);
}

_this.swfFormFixInit = function (cControl) {
	var lOk = true;	
	for (nIndex = 0; nIndex <= this.aSwfControls.length - 1; nIndex = nIndex + 1) {
		if (this.aSwfControls[nIndex] == cControl) {
			this.aSwfControlStatus[nIndex] = true;	
		}
	}
	for (nIndex = 0; nIndex <= this.aSwfControls.length - 1; nIndex = nIndex + 1) {
		if (!this.aSwfControlStatus[nIndex]) {
			lOk = false;
		}			
	}
	if (lOk) {
		//  All form fix requests received
		this.swfFormFixProcessing();
	}
}

_this.swfFormFixProcessing = function(aSwfPlayers) {
	swfFormFixDelay = setInterval( function () {swfPlayerSetFormFixStatus()}, 200);
	if (this.browser == "IE") {
		SWFFormFix(this.aSwfPlayerName[this.aSwfPlayerName.length - 1]);
	}
}			

_this.swfBrowser = function () {
	return this.browser;
}

/////////////////////////// end ////////////////////////



///////////////////// InstallSwf ///////////////

function InstallSwf(){}

var _this = InstallSwf.prototype = new Object();

_this.constructor	= InstallSwf;

_this.className = "InstallSwf";

_this.name;
_this.parent;
_this.version;

_this.playerVersion;
_this.majorVersion;
_this.minorVersion;
_this.releaseVersion;
_this.message;
_this.playerDiv;
_this.minimumMajor;
_this.requiredMajor;
_this.requiredMinor;
_this.requiredRelease;

_this.init = function (cName, cPlayerDiv, cPlayerRoot) {
	this.playerDiv = cPlayerDiv;
	this.version = true;
	this.playerVersion 		= swfobject.getFlashPlayerVersion(); 
	this.majorVersion 		= this.playerVersion.major;
	this.minorVersion 		= this.playerVersion.minor;
	this.releaseVersion 	= this.playerVersion.release;	
	this.minimumMajor     = "9";
	this.requiredMajor 		= "9";
	this.requiredMinor    = "0";
	this.requiredRelease  = "115";
	document.getElementById(this.playerDiv).style.display='none';
	if ( (this.majorVersion == "0") && (this.minorVersion == "0") && (this.releaseVersion == "0") ) {
		this.flashInstallMessage(cPlayerRoot);
		document.getElementById(this.playerDiv).style.display='block';
		document.getElementById(this.playerDiv).innerHTML  = this.message
		this.version = false;			
	} else {
		if (this.majorVersion < this.minimumMajor) {
			this.flashUpgradeMessage(cPlayerRoot);
			document.getElementById(this.playerDiv).style.display='block';
			document.getElementById(this.playerDiv).innerHTML  = this.message	
			this.version = false;
		} else {
			if (this.majorVersion == this.requiredMajor) {
				if (this.releaseVersion < this.requiredRelease) {
					this.flashUpgradeMessage(cPlayerRoot);
					document.getElementById(this.playerDiv).style.display='block';
					document.getElementById(this.playerDiv).innerHTML  = this.message
					this.version = false;
				}
			}
		}
	}
}

_this.flashInstallMessage = function (cPlayerRoot) {
	this.message = '<p>You do no have Adobe Flash Player installed.</p>'
	this.message = this.message + '<dl><dd>It is recommended that you install the latest version of Adobe Flash Player by clicking on the following button: - </dd>';
	this.message = this.message + '<dt><a  target="_blank" href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" style="border:0px;" alt="Get Adobe Flash player" /></a></dt>'	
	this.message = this.message + '<dd>If you wish to continue without updating, then please click on the following button: -</dd>'	
	this.message = this.message + '<dt><a onclick="bypassFlashUpdate()"  href="#"><img src=' + cPlayerRoot + '/enterbutton.gif style="border:0px;" alt="Enter Website" /></a></dt></dl>'
	this.message = this.message + '<p>If you find that aspects of the website do not function correctly, then please re-enter and download the Flash update.</p>'	
}

_this.flashUpgradeMessage = function (cPlayerRoot) {
	this.message = '<p>You have Adobe Flash Player Version ' + this.majorVersion + '.' + this.minorVersion + '.' + this.releaseVersion + '.0 installed.</p>'
	this.message = this.message + '<dl><dd>It is recommended that you upgrade to the latest version of Adobe Flash Player by clicking on the following button: - </dd>';
	this.message = this.message + '<dt><a  target="_blank" href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" style="border:0px;" alt="Get Adobe Flash player" /></a><dt>'	
	this.message = this.message + '<dd>If you wish to continue without updating, then please click on the following button: -</dd>'	
	this.message = this.message + '<dt><a onclick="bypassFlashUpdate()"  href="#"><img src=' + cPlayerRoot + '/enterbutton.gif style="border:0px;" alt="Enter Website" /></a></dt></dl>'
	this.message = this.message + '<p>If you find that aspects of the website do not function correctly, then please re-enter and download the Flash update.</p>'	
}

_this.hide = function () {
	document.getElementById(this.playerDiv).style.display='none';		
}

_this.loaded = function () {
	return this.version;	
}

///////////////////// end ////////////////////////




///////////////////// mapControl ///////////////

function mapControl(){}

var _this = mapControl.prototype = new swfPlayerControl();

_this.constructor	= mapControl;

_this.className = "mapControl";

_this.name;
_this.parent;
_this.oPlayer;
_this.playerName;
_this.playerElement;
_this.playerDiv; 
_this.playerRootUrl;
_this.playerUrl; 
_this.playerWidth; 
_this.playerHeight; 
_this.playerVersion; 
_this.playerBackground; 
_this.playerCustomer; 

_this.loaded;
_this.hidden;

_this.xmlData;
_this.xmlContent;
_this.xmlResorts;

_this.init = function (cName, aPlayer, cXmlData, cXmlContent, cXmlResorts) {
	
	swfPlayerControl.prototype.init.call(this, cName) 

	this.name = cName;
				
	this.loaded = false;

	if (aPlayer[1].substr(aPlayer[1].length - 1, 1) == "/") {
		this.playerRootUrl = aPlayer[1];	
	} else {
		this.playerRootUrl = aPlayer[1] + "/";		
	}

	this.setPlayer(aPlayer);

	this.xmlData 			= cXmlData;
	this.xmlContent 	= cXmlContent;
	this.xmlResorts 	= cXmlResorts;
	
	this.addSwfControl(this.name, this.playerName);
	
	this.instantiate();
	
}

_this.swfInit = function () {
	this.playerElement.swfInit(this.xmlData, this.xmlContent, this.xmlResorts);			
}

_this.swfStart = function (cInitData) {
	this.playerElement.swfStart(cInitData);	
}

_this.swfHideReveal = function () {
	if (this.hidden) {
		document.getElementById(this.playerDiv).style.display = "";
		this.hidden = false;
	} else{
		document.getElementById(this.playerDiv).style.display = "none";
		this.hidden = true;
	}
}

_this.swfReset = function () {
	this.playerElement.swfReset();			
}

_this.swfDeletePlayer = function () {	
	if(this.playerElement.swfReset != null){
		this.playerElement.swfReset();
	}
	if(swfobject != null){
		swfobject.removeSWF(this.playerDiv);
	}
	delete this.oPlayer;
}

_this.setPlayer = function (aPlayer) {
		
	this.playerDiv 					= aPlayer[0];
	this.playerUrl 					= this.playerRootUrl + aPlayer[2];
	this.playerWidth 				= aPlayer[3];
	this.playerHeight 			= aPlayer[4];
	this.playerVersion 			= aPlayer[5];
	this.playerBackground 	= aPlayer[6];
	this.playerCustomer	 		= aPlayer[7];
 			
	this.playerName = "";
	var cTemp = this.playerUrl.toLowerCase();

	var aParts = cTemp.split("/");
	var cName = aParts[aParts.length - 1].replace(".swf", "");
	if ( typeof top[cName] == "undefined") {
		top[cName] = 0;
	}
	top[cName] = top[cName] + 1;
	this.playerName = cName + top[cName];
		
}

_this.instantiate = function ( ) {
		
	var swfVariables 		= {swfCallBack:this.name + ".swfStatus", swfCustomer:this.playerCustomer}; 
	var swfParameters 	= {wmode:"transparent"};
	var swfAttributes 	= {id:this.playerName, name:this.playerName};
	var swfInstall			= "";

	swfobject.embedSWF(this.playerUrl + "?rnd=" + (new Date()).getTime().toString(), this.playerDiv, this.playerWidth, this.playerHeight, this.playerVersion, swfInstall, swfVariables, swfParameters, swfAttributes);

}

_this.swfStatus = function(cStatus) {

	var self = this;
	switch(cStatus) {
		case "Movie:Loaded":
 			this.playerElement = document.getElementById(this.playerName);		
 			this.swfFormFixInit();	
			break;
		case "Movie:Instantiated":
			// this.swfStart();			
			break;
		default:
			break;
	}
	if (cStatus.substring(0, 5) == "Save:") {
		this.parent.swfNewState(cStatus);
	} 
	this.parent.swfStatus(this.name, cStatus);
}

_this.swfMouseWheel = function (amount) {
	this.parent.swfMouseMove(amount);
}

_this.swfFormFixInit = function () { 
	var self = this;
	var formFix;	
	swfPlayerControl.prototype.swfFormFixInit.call(this, this.name);
	formFix = setInterval(function () {
		if (swfPlayerCheckFormFixStatus()) {
			clearInterval(formFix);
			self.loaded = true;
			self.swfInit();
		}		
	}, 50);
}

///////////////////// end ////////////////////////


///////////////////// slideshowControl /////////////////////

function slideshowControl(){}

var _this = slideshowControl.prototype = new swfPlayerControl();

_this.constructor = slideshowControl;

_this.className = "slideshowControl";

_this.name;
_this.parent;
_this.oPlayer;
_this.playerName;
_this.playerElement;
_this.playerDiv; 
_this.playerRootUrl;
_this.playerUrl; 
_this.playerWidth; 
_this.playerHeight; 
_this.playerVersion; 
_this.playerBackground; 
_this.playerCustomer; 

_this.slideshowStatus;

_this.loaded;
_this.formFix;

_this.delay;

_this.xmlData;
_this.xmlContent;

_this.init = function (cName, aPlayer, cXmlData, cXmlContent) {
		
	swfPlayerControl.prototype.init.call(this, cName) 
	
	this.name = cName;
			
	this.loaded = false;		
	
	this.slideshowStatus = "Initial";
		
	if (aPlayer[1].substr(aPlayer[1].length - 1, 1) == "/") {
		this.playerRootUrl = aPlayer[1];	
	} else {
		this.playerRootUrl = aPlayer[1] + "/";		
	}

	this.setPlayer(aPlayer);

	this.xmlData 		= cXmlData;
	this.xmlContent = cXmlContent;

	this.addSwfControl(this.name, this.playerName);	

	this.instantiate();
		
}	

_this.swfInit = function () {
	this.playerElement.swfInit(this.xmlData, this.xmlContent);			
}

_this.swfStart = function () {
	var self = this;
	if (this.loaded) {
		this.playerElement.swfStart();	
	} else {
		this.delay = setInterval( function () {self.delayedStart()}, 50); 
	}	
}

_this.delayedStart = function () {
	if (this.loaded) {
		clearInterval(this.delay);
		this.playerElement.swfStart();
	}
}

_this.swfDeletePlayer = function () {	
	if (this.playerElement) {
	    if( typeof this.playerElement.swfReset == "function" ){
		    this.playerElement.swfReset();
		}
	}
	if( swfobject != null ){swfobject.removeSWF(this.playerDiv);}
	delete this.oPlayer;
}

_this.swfStop = function () {	
	if (this.loaded) {
		this.playerElement.swfStop();
	}
}

_this.swfGotoImage = function (nImg) {
	this.playerElement.swfGoToImage(nImg);
}

_this.swfPauseResume	= function () {
	this.playerElement.swfPauseResume();
}

_this.swfPreviousImage	= function () {
	this.playerElement.swfPreviousImage();
}

_this.swfNextImage	= function () {
	this.playerElement.swfNextImage();
}

_this.setPlayer = function (aPlayer) {
		
	this.playerDiv 					= aPlayer[0];
	this.playerUrl 					= this.playerRootUrl + aPlayer[2];
	this.playerWidth 				= aPlayer[3];
	this.playerHeight 			= aPlayer[4];
	this.playerVersion 			= aPlayer[5];
	this.playerBackground 	= aPlayer[6];
	this.playerCustomer	 		= aPlayer[7];
	
	this.playerName = "";
	var cTemp = this.playerUrl.toLowerCase();

	var aParts = cTemp.split("/");
	var cName = aParts[aParts.length - 1].replace(".swf", "");
	if ( typeof top[cName] == "undefined") {
		top[cName] = 0;
	}
	top[cName] = top[cName] + 1;
	this.playerName = cName + top[cName];
		
}

_this.instantiate = function ( ) {
		
	var swfVariables 		= {swfCallBack:this.name + ".swfStatus", swfCustomer:this.playerCustomer};
	var swfParameters 	= {wmode:"transparent"};
	var swfAttributes 	= {id:this.playerName, name:this.playerName};
	var swfInstall			= "";
	swfobject.embedSWF(this.playerUrl + "?rnd=" + (new Date()).getTime().toString(), this.playerDiv, this.playerWidth, this.playerHeight, this.playerVersion, swfInstall, swfVariables, swfParameters, swfAttributes);
	
}

_this.swfStatus = function(cStatus) {
	
	var self = this;
	switch(cStatus) {
		case "Movie:Loaded":
 			this.playerElement = document.getElementById(this.playerName);		
 			this.swfFormFixInit();	
			break;
		case "Movie:Instantiated":
			this.swfStart();	
			break;
		case "Paused:Off":
			this.slideshowStatus = "Playing";
			break;
		case "Paused:On":
			this.slideshowStatus = "Paused";
			break;
		case "Play:Started":
			this.slideshowStatus = "Started";
			break;
		default:
			break;
	}
	this.parent.swfStatus(this.name, cStatus);
}

_this.swfFormFixInit = function () {
	var self = this; 	
	this.formFix = setInterval( function () {self.waitingFormFix()}, 50); 
	swfPlayerControl.prototype.swfFormFixInit.call(this, this.name);
}

_this.waitingFormFix = function () {
	if (swfPlayerCheckFormFixStatus()) {
		clearInterval(this.formFix);
		this.loaded = true;
		this.swfInit();
		// this.parent.swfStatus(this.name,"SwfFormFixed");
	}	
}

///////////////////// end ////////////////////////


/* main.js */
/////////////////////////// functions called by HTML ///////////////////

// These functions represent the external interface to the HTML page.

function slideshowStart() 							{main ? main.htmlSlideshowStart() 				: false;}
function slideshowStop() 				 				{main ? main.htmlSlideshowStop() 				: false;}

function stopMedia() 										{main ? main.htmlStopMedia() 								: false;}

function bypassFlashUpdate()						{main ? main.swfBypassUpdate() 							: false;}


/////////////////////////// end //////////////////////////////////


///////////////////////// main /////////////////////////////////

var main;



/* AMS Require /js/CoreLibs/CoreLib.js */
AddEvent( window, "load", function(){
	

	main = new mainControl(); 
	main.init( "main" ); 

} );

AddEvent( window, "unload", function(){

	stopMedia();

});

/////////////////////////// end //////////////////////////////////


//////////////////////// main control ////////////////////////////


function mainControl(){}

var _this = mainControl.prototype = new Object();

_this.constructor	= mainControl;

_this.className = "mainControl";

_this.name;

_this.swfInstall;
_this.swfSlideshowControl;
_this.swfMapControl;

_this.init = function (cName) {

	// passed from HTML
	this.name = cName;
    if (Boolean(typeof aSlideshowPlayer != 'undefined' && aSlideshowPlayer) || Boolean(typeof aMapPlayer != 'undefined' && aMapPlayer) ) {
	    this.swfInstall = new InstallSwf();
	    this.swfInstall.parent = this;
	    this.swfInstall.init(this.name + ".swfInstall", aInstallSwf[0], aSlideshowPlayer[1]);	 	
	    if (this.swfInstall.loaded()) {   	
		    this.swfInit();	
	    }
    }
}

_this.swfBypassUpdate = function () {
	this.swfInstall.hide();	
	this.swfInit();
}

_this.swfInit = function () {
	
  if ( Boolean(typeof aSlideshowPlayer != 'undefined' && aSlideshowPlayer) )  {
  	this.swfSlideshowControl = new slideshowControl();
	  this.swfSlideshowControl.parent = this;
	  this.swfSlideshowControl.init(this.name + ".swfSlideshowControl", aSlideshowPlayer, cXmlGenericContent, cXmlSlideshow);		  
	}	

  if ( Boolean(typeof aMapPlayer != 'undefined' && aMapPlayer) )  {
  	this.swfMapControl = new mapControl();
		this.swfMapControl.parent = this;
		this.swfMapControl.init(this.name + ".swfMapControl", aMapPlayer, cXmlGenericContent, cXmlMap, cXmlResorts);	
	}	
	
}

// Controls

_this.htmlSlideshowStopMedia	= function () {
	if(this.swfSlideshowControl) {
		this.swfSlideshowControl.swfDeletePlayer();
		delete this.swfSlideshowControl;
	}
}	

_this.htmlMapStopMedia	= function () {	
	if(this.swfMapControl) {
		this.swfMapControl.swfDeletePlayer();
		delete this.swfMapControl;
	}
}

_this.htmlSlideshowStart	= function () {
	this.swfSlideshowControl.swfStart();
}

_this.htmlSlideshowStop	= function () {
	this.swfSlideshowControl.swfStop();
}

// Common functions


_this.htmlStopMedia	= function () {
	if ( Boolean(typeof aSlideshowPlayer   		!= 'undefined' && aSlideshowPlayer) )   { this.htmlSlideshowStopMedia(); }	
	if ( Boolean(typeof aMapPlayer   					!= 'undefined' && aMapPlayer) )   			{ this.htmlMapStopMedia(); }	
}

_this.showMovieStatus = function(cStatus) {
	// document.getElementById("movieStatus").value = document.getElementById("movieStatus").value + cStatus + "\r\n"; 	
}


_this.swfStatus = function(cName, cStatus) {
	if (cStatus == "Movie:Instantiated") {
		lMovieLoaded = true;		
	}
	switch (cName) {
		case "main.swfSlideshowControl":	
			this.showMovieStatus(cStatus);
			break;
		case "main.swfMapControl":	
			this.showMovieStatus(cStatus);
			break
	}

}			


/////////////////////////// end //////////////////////////////////

/* swfObject */
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();

/* swfFormFixEMS */
/**
 * SWFFormFix v2.1.0: SWF ExternalInterface() Form Fix - http://http://www.teratechnologies.net/stevekamerman/
 *
 * SWFFormFix is (c) 2007 Steve Kamerman and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Project sponsored by Tera Technologies - http://www.teratechnologies.net/
 */
////////////////////////////////////////////////////
////////////  Configurable options  ////////////////
////////////////////////////////////////////////////
var EnableFullAuto	= true; // set this to true and all of your flash objects will be fixed automatically
var SWFFormFixDebug = false; // set this to true to be alerted whenever a flash object is found and fixed
var NotLoadedWarning = true; // set this to true to alert the users when they try to access a function from
							 // the ExternalInterface() that isn't loaded yet
var NotLoadedMsg = "Please wait for the page to load..."; // this is the warning they will see
////////////////////////////////////////////////////
//////////  END Configurable options  //////////////
////////////////////////////////////////////////////
/**
 * Usage:
 * ------------------------------------------------------------
 * There are three ways to use SWFFormFix, FULL AUTO, Auto and Manual mode.
 * To use either method you need to include this file in the 
 * HEAD section of your page like this: 

<script src="swfformfix.js" type="text/javascript"></script>

 * 
 * NOTE: If you want Javascript to call Flash, you need to make
 * a dummy object like follows:
 
window["myFlashObject"] = new Object();

 * Put this line directly above your call to SWFObject().
 * Replace "myFlashObject" with the ID of your object (the 2nd
 * parameter you give to SWFObject() ).  This will prevent your
 * page from dieing with an error like "myFlashObject is undefined".
 * 
 * --> FULL AUTO Mode:
 * This will attempt to find every Flash Movie that you have on
 * the page and apply the fix to each of them as the page loads.
 * It will poll the page for all the objects and determine if it
 * needs to apply the fix to them every 100ms until the page is
 * completely loaded.  All you need to do to use this mode is
 * include the script in the head of your document and set the
 * "EnableFullAuto" directive to true at the top of the script.
 *
 * --> Auto Mode:
 * This will attempt to find every Flash Movie that you have on
 * the page and apply the fix to each of them.  To use auto mode
 * put the following code before the </body> tag. More specifically
 * it needs to be AFTER your last Flash object.

<script type="text/javascript">
// <![CDATA[
	SWFFormFixAuto();
// ]]>
</script>

 * 
 * --> Manual Mode:
 * This lets you fix just a single Flash object if you don't want
 * the auto mode to try to fix every Flash object on the page.
 * This mode is faster than the auto mode and may work better in
 * some situations.  To use manual mode put the following code
 * after the Flash object you want to fix, where "myFlashObject"
 * is the ID of the Flash Object:

Example for normal EMBED style:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="200" height="100" id="myFlashObject" align="middle">
<param name="movie" value="myMovie.swf" />
<param name="quality" value="high" />
<embed src="myMovie.swf" quality="high" width="200" height="100" name="myFlashObject" type="application/x-shockwave-flash" />
</object>

<script type="text/javascript">
// <![CDATA[
SWFFormFix("myMovieObjectName");
// ]]>
</script>

Example for SWFObject style:

<div id="flashcontent" style="width:200px;height:100px;">This is replaced by the Flash movie.</div>
<script type="text/javascript">
// <![CDATA[
// Please note that the ID that you need to use for SWFFormFix() is the second argument in SWFObject().
var so = new SWFObject("myMovie.swf", "myFlashObject","200", "100", "6.0.0", "#ffffff");
so.addParam("quality", "high");
so.write("flashcontent");
SWFFormFix("myFlashObject");
// ]]>
</script>

 * 
 * Changelog:
 * ------------------------------------------------------------
 * v2.1
 *   Fixed IE cache bug that prevents JS -> Flash after refresh.  Now SWFFormFix
 *   rebuilds all the ExternalInterface() methods that were inadvertently destroyed.
 * v2.0
 *   Added FULL AUTO mode - just enable it below and include the script!
 *   Special thanks to Geoff Stearns from deconcept and onDOMload by Aaron Barker
 * 
 * v1.0
 *   Added the SWFFormFixAuto() function, very well optimized and fast.
 * 
 * v0.2
 *   Changed helper element from <input> element to hidden <div> element
 *
 * v0.1
 *   Initial release.
 */

finished = false; // this is set to true when the body's onload is called, to stop the script
timeout = 10; // seconds to wait before giving up
starttime = new Date().getTime();
flashObjectList = Array();
fixedList = Array();
makeFuncArr = Array();
SWFFormFixAuto2 = function(){
//alert("running...");
	if(navigator.appName.toLowerCase() != "microsoft internet explorer")return true;
	var flashObjectList = document.getElementsByTagName("object");
	for(var i=0;i<flashObjectList.length;i++){
		var obj = flashObjectList[i];
		// here's all the objects on the page, now lets find the flash objects
		if(obj.getAttribute('classid') == "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"){
			var id = obj.getAttribute('id');
			var alreadyfixed = false;
			for(var c=0;c<fixedList.length;c++){if(fixedList[i] == id)alreadyfixed=true;}
			// this is a flash movie, apply the fix (unless it's already been fixed)
			if(!alreadyfixed){
				var debugtxt = '';
				for(var b in window[id]){
					// ExternalInterface() tried to add some functions to the incorrect object
					if(typeof(window[id][b])=="function"){
						// this function will need to be rebuilt when the page is done loading.
						makeFuncArr.push(Array(obj,b));
						obj[b] = function(){
							if(NotLoadedWarning)alert(NotLoadedMsg);
							return("");
						}
/*
 * it seems like this would work to copy the function, but it doesn't:
 *
 * eval('obj[b]='+window[id][b].toString());
 * 
 * This is the actual function that we're trying to copy:

function () { 
  return eval(instance.CallFunction("<invoke name=\""+name+"\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) + "</invoke>"));
}

 * it will fail if you copy it to the new object though because "instance" and "name" are undefined
 * Here's how to see the actual function def: document.getElementById("txt_debug").value=window[id][b];
 */
					}
				}
				window[id]=obj;
				if(SWFFormFixDebug)alert("Fixed: "+id);
			}
		}
	}
	if(!finished){
		setTimeout("SWFFormFixAuto2()", 100);
	}else{
		for(var i=0;i<makeFuncArr.length;i++){
			// this is executed after the page is loaded - it rebuilds the custom
			// ExternalInterface() functions
			SWFFormFix_rebuildExtFunc(makeFuncArr[i][0],makeFuncArr[i][1]);
		}
	}
	return true;
}
SWFFormFix_rebuildExtFunc = function(obj,functionName){
	eval('obj[functionName] = function(){return eval(this.CallFunction("<invoke name=\\"'+functionName+'\\" returntype=\\"javascript\\">" + __flash__argumentsToXML(arguments,0) + "</invoke>"));}');
	if(SWFFormFixDebug)alert("Rebuilt ExternalInterface() function: "+functionName);
}
SWFFormFixOnloadAppend = function() {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = function(){
			finished=true;
		}
	} else {
		window.onload = function() {
			oldonload();
			finished=true;
		}
	}
}
SWFFormFixAuto = function(){
	if(navigator.appName.toLowerCase() != "microsoft internet explorer")return true;
	var objects = document.getElementsByTagName("object");
	if(objects.length == 0) return true;
	for(i=0;i<objects.length;i++){
		// here's all the objects on the page, now lets find the flash objects
		if(objects[i].classid == "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"){
			// this is a flash movie, apply the fix
			window[objects[i].id] = objects[i];
		}
	}
	var out = "";
	return true;
}
SWFFormFix = function(swfname){
	if(navigator.appName.toLowerCase() != "microsoft internet explorer")return false;
	var testnodename = "SWFFormFixTESTER";
	// document.write('<div id="'+testnodename+'" onclick="SWFFormFixCallback(this,\''+swfname+'\');return false;" style="display:none">&nbsp;</div>');
	// document.getElementById(testnodename).onclick();
	var oFixer = document.getElementById(testnodename);
	oFixer.onclick = function () {SWFFormFixCallback( this, swfname) };
	oFixer.click(); 
}

SWFFormFixCallback = function (obj,swfname){
	var path = document;
	var error = false;
	var testnode = obj;
	while(obj = obj.parentNode){
		if(obj.nodeName.toLowerCase() == "form"){
			if(obj.name != undefined && obj.name != null && obj.name.length > 0){
				path = path.forms[obj.name];
			}else{
				alert("Error: one of your forms does not have a name!");
				error = true;
			}
		}
	}
	testnode.parentNode.removeChild(testnode);
	if(error) return false;
	window[swfname]=path[swfname];
	return true;
}
function noCacheIE(url){
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	if(!isIE)return(url);
	var newUrl = '?';
	if(url.indexOf('?') != -1)newUrl = '&';
	var now = new Date();
	var rand = Math.random().toString().substring(2,4);
	newUrl = url+newUrl+"noCacheIE="+rand+'-'+now.getTime().toString();
	return(newUrl);
}
if(EnableFullAuto){
	SWFFormFixAuto2();
	SWFFormFixOnloadAppend();
}




/**************************************************************************************
*                                   END OF FILE
***************************************************************************************
***************************************************************************************
***************************************************************************************/
