﻿flashContents = null;
var contentsName  = null;

function getFlashObject( divId , filePath , name , width , height , version , mode )
{	
	insertFlashObject(document.getElementById(divId), filePath, name, width, height, version , mode);
}

function insertFlashObject(div, filePath, name, width, height, version , mode)
{	
	if(unloadWheel != null)
	{
		unloadWheel();
		unloadWheel = null;
	}
	
	if(mode == null)
	{
		mode = "transparent";					
	}
	var flahname = div.id+"_swf";	
	var srcSum = "";
	srcSum  += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="'+version+'" width="'+width+'" height="'+height+'" id="'+flahname+'" name="'+flahname+'" align="middle">'+
	'<param name="allowScriptAccess" value="always" />'+
	'<param name="allowFullScreen" value="false" />'+
	'<param name="movie" value="'+filePath+'" />'+
	'<param name="quality" value="high" />'+
	'<param name="scale" value="noscale" />'+
	'<param name="bgcolor" value="#ffffff" />'+
	'<param name="wmode" value="'+mode+'" />'+
	'<embed src="'+filePath+'" wmode="'+mode+'" quality="high" scale="noscale" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+flahname+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />'+
	'</object>';
	div.innerHTML = srcSum;
}
function flashClose(id)
{

	var flashId = id+"_swf";
    var obj = document.getElementById(flashId);
	if(unloadWheel != null)
	{
		unloadWheel();
		unloadWheel = null;
	}
    if(obj != null)
    {		
	   if (obj)
	    {
	        for (var i in obj)
	        {
				
	            if (typeof obj[i] == "function")
	            {
	            	obj[i] = null;
	            } 
	        }	        
	        obj.parentNode.removeChild(obj);
	    } 	
    }

}


function purge(divName)
{    
	var div = document.getElementById(divName);
	if(div != null)
	{
		var a = div.attributes;
		var i, l, n;
		if (a) 
		{        
			l = a.length;
			for (i = 0; i < l; i += 1) 
			{            
				n = a[i].name;
				if (typeof div[n] == 'function') 
				{              		
					div[n] = null;            
				}
			}    
		}	
		a = div.childNodes;    
		if (a) 
		{			
			l = a.length;
			for (i = 0; i < l; i += 1) 
			{            
				purge(div.childNodes[i]);        
			}    
		}
	}	
}

function thisMovie(movieName) 
{	
	if (navigator.appName.indexOf("Microsoft") != -1) 
	{
		return window[movieName];
	} 
	else 
	{
		return document[movieName];
	}
}

function msg(_msg)
{
	alert(_msg);
}

