﻿<!--
// 捕捉键盘事件
function keyEvent (e)
{
	var evt = e ? e : window.event;
	var keyCode = parseInt ( evt.keyCode );

	if ( keyCode == 27 )
	{
		dialogs = document.getElementsByTagName ( 'div' );
		for ( var i = 0; i < dialogs.length; i ++ )
		{
			if ( dialogs[i].className == 'dialog_box' )
			{
				dialog.close ( dialogs[i] );
				return true;
			}
		}
	}
}

// 获取网站域名
function getRootURL ()
{
	var str = window.location.host.split ( '.' );
	var domain = '';
	if ( ( str[1] == 'my' || str[1] == 'game' ) && ( str[0] == 'ctc' || str[0] == 'cnc' ) )
	{
		domain = str[0] + '.';
		return 'http://' + domain + str[2] + '.' + str[3];
	}
	else if ( str.length == 3 )
	{
		return 'http://www.' + str[1] + '.' + str[2];
	}
	else
	{
		return '/';
	}
}

// 获取帮助路径
function getHelp ( page, helpId )
{
	// var rootURL = getRootURL ();
	var rootURL = '';
	var urlHelp = rootURL + '/help/' + page + '.htm' + helpId;
	showHelpBox ( "<iframe id='helpContentFrame' width='800' height='350' style='border:0' frameborder='0'></iframe>" );
	$('helpContentFrame').src = urlHelp;
	return urlHelp;
}

function getWebIM ()
{
	// var rootURL = getRootURL ();
	var rootURL = '';
	var urlHelp = '/WebIM/WebIM.aspx';
	var strMsg="<table width='444' border='0' cellspacing='0' cellpadding='0' style='text-align:left; margin:0 auto;'>"
          +"<tr>"
          +"  <td height='357' colspan='2' valign='top'>"
          +"      <div id='mainIM' >"
          +"          <div id='dynamicUpdateArea' style='width:440px;height:357px;word-break: break-all;overflow-y:hidden;overflow-x:hidden;' >"
          +"          </div>"
          //+"          <script></script>"
          +"      </div>"
          +"  </td>"
          +"  </tr>"
          +"<tr>"
          +"  <td width='399' height='30' style='padding-left:10px;'>"
          +"      <input type='text' style='border:0px; background: url(Images/Normal/dinputbg.gif); height:19px; line-height:19px; width:386px;color:#744119;' onkeypress='javascrip:if(event.keyCode==13){submitMes();}' maxlength='50' id='textIN' /></td><!--onkeypress='javascrip:if(event.keyCode==13){submitMes();}'-->"
          +"  <td width='45'><a href='javascript:;' style='display:block; width:30px; height:20px;' onclick='submitMes();'></a><input type='hidden' id='hiddenCounter' style='width:158px;height:20px;z-index:-55;'/></td>"
          +"</tr>"
          +"</table>";
	//showIMBox ( "<iframe id='helpContentFrame' width='460' height='392' scrolling='none' style='border:0' frameborder='0'></iframe>" );
	showIMBox ( strMsg );
	//$('helpContentFrame').src = urlHelp;
	return urlHelp;
}

// 载入 loadUrl 页面内容到 targetObj 物件
function load_page ( loadUrl, targetObj, refresh )
{
	if ( refresh == null ) refresh = false;
	if ( refresh )
	{
		loader.refreshCache ();
	}
	loader.get ( loadUrl, targetObj );
}

// 载入页面 ( 带判断, 若 targetObj 不存在则不执行载入 )
function load_page_with_chk ( loadUrl, targetObj, refresh )
{
	if ( typeof ( targetObj ) == 'string' )
	{
		targetObj = $ ( targetObj );
	}
	if ( targetObj )
	{
		load_page ( loadUrl, targetObj, refresh );
	}
}

// 显示对话框
function show_alert ( message, scriptCode, scriptText )
{
	process.finish ();

	if ( scriptCode == null ) scriptCode = '';
	if ( scriptText == null ) scriptText = '确定';

	scriptCode = htmlchars ( scriptCode );

	var html = '';
	html += '<div style="width:400px; text-align:center">';
	html += message;
	html += '<br><input onclick="this.blur();dialog.close(this);" class="button50" type="button" value="确定"/>'
	html += '</div>';
	

	showDialogBox ( html );
	setFocus ( 'alert_button' );
}


// 显示确认框
function show_confirm ( message, scriptCodeConfirm, scriptCodeCancel, scriptTextConfirm, scriptTextCancel )
{

	if ( scriptCodeConfirm == null ) scriptCodeConfirm = '';
	if ( scriptCodeCancel == null ) scriptCodeCancel = '';
	if ( scriptTextConfirm == null ) scriptTextConfirm = '确定';
	if ( scriptTextCancel == null ) scriptTextCancel = '取消';

	scriptCodeConfirm = htmlchars ( scriptCodeConfirm );
	scriptCodeCancel = htmlchars ( scriptCodeCancel );

	var html = '';
	html += '<div style="width:300px; height:30px; line-height:30px; text-align:center;">';
	html += message;
	html += '</div><div style="width:300px; text-align:center">';
	html += "<input class=\"button50\" name=\"confirm_button\" type=\"button\" onclick=\"this.blur(); dialog.close(this);" + scriptCodeConfirm + "\" value=\"" + scriptTextConfirm + "\" />";
	html += '&nbsp;&nbsp;';
	html += '<input class="button50" name="cancel_button" type="button" onclick="this.blur(); dialog.close(this); ' + scriptCodeCancel + '" value="' + scriptTextCancel + '" />';
	html += '</div>';

	showDialogBox ( html );
	setFocus ( 'confirm_button' );
}

// 载入子菜单
function load_menu ( menuName, defaultIndex, refresh )
{
	var objMenuItem = $ ( menuName );
	if ( !objMenuItem ) return false;

	var objMenu = $('tabmenu');
	var tags = objMenu.getElementsByTagName ( 'ul' );
	for ( var i in tags )
	{
		if ( tags[i].style )
			tags[i].style.visibility = 'hidden';
	}
	objMenuItem.style.visibility = 'visible';
	
	if ( defaultIndex != null )
	{
		try
		{
			var objItem = getTag ( menuName, 'a', defaultIndex );
			objItem.onclick ();
		}
		catch ( e ) {}
	}
}

// 载入子页面内容
var last_content_url; // 最后子页面 url
function load_content ( loadUrl, targetObj, queryString, objHighlight, refresh, hideProcess )
{
	if ( refresh == null ) refresh = false;
	if ( hideProcess == null ) hideProcess = false;

	if ( refresh )
		loader.refreshCache ();

	last_content_url = loadUrl;
	if ( !hideProcess )
	    process.start ( '载入中，请稍候...' );
	
	if ( typeof ( targetObj ) == 'string' ) targetObj = $(targetObj);
	if(targetObj ==null )
	    targetObj = $('content');
	//alert(targetObj.id);
	loader.get ( loadUrl, targetObj, queryString, null, callback_load_content );
	
	
	if ( typeof ( objHighlight ) == 'string' ) objHighlight = $(objHighlight);
	if ( objHighlight != null )
		highlight ( objHighlight );
}

function callback_load_content ( ret, obj )
{
	ajaxCallback ( ret, obj );
	
	// 自动打开页面提示
	try
	{
		var objBody = $ ( 'body' );
		objBody.scrollTop = 0;
		var showTipsSwitch = getCookie ( 'showTipsSwitch' );
		if ( showTipsSwitch == null || showTipsSwitch != 'close' )
		{
			var objTip = $ ( 'tips' );
			objTip.onclick ();
		}
	}
	catch ( e ) 	{}
}

// 刷新子页面内容
function refresh_content ()
{
	load_page ( last_content_url, 'content', true );
}

// 对话框操作类
function clsDialog ( dialogName )
{
	this.dialogIndex = 0;
	this.dialogName = dialogName;

	if ( this.dialogName == null ) this.dialogName = 'dialog';

	// 载入至浮动对话框
	this.open = function ( loadUrl, dialogName, procMsg )
	{
		if ( dialogName == null ) dialogName = this.dialogName + ( ++this.dialogIndex );
		var objDialog = $ ( dialogName );

        if ( procMsg == null )
            procMsg = '载入中，请稍候...';
            
		process.start ( procMsg );
		load_page ( loadUrl, dialogName );
	}

	// 载入至当前浮动对话框
	this.load = function ( loadUrl )
	{
		var obj = getSrcElement ();
		var pObj = getParentDialog ( obj );
		if ( pObj )
		{
			dialogName = pObj.id;
			pObj.style.zIndex = gzIndex;
		}
		if ( dialogName == null ) dialogName = this.dialogName + this.dialogIndex;
		process.start ( '载入中，请稍候...' );
		load_page ( loadUrl, dialogName );
	}

	// 提交表单至浮动对话框
	this.post = function ( loadUrl, form, procMsg, callbackFunc)
	{
		var pObj = getParentDialog ( form );
		if ( pObj ) dialogName = pObj.id;
		if ( dialogName == null ) dialogName = this.dialogName + this.dialogIndex;
		if ( typeof ( form ) == 'string' )
		{
			form = $ ( form );
		}
		process.start ( procMsg );
		loader.refreshCache ();
		loader.post ( loadUrl, dialogName, form , null, callbackFunc);
	}

	// 关闭浮动对话框
	this.close = function ( obj, hideMask )
	{
		if ( obj == null ) var obj = getSrcElement ();
		var pObj = getParentDialog ( obj );
		if ( pObj ) dialogName = pObj.id;
		if ( dialogName == null ) dialogName = this.dialogName + this.dialogIndex;
		if ( dialogName.indexOf ( this.dialogName ) == 0 )
		{
			this.dialogIndex --;
		}
		window.onErrorMsg = false;
		if ( hideMask == null ) hideMask = true;
		//alert(dialogName);
		removeDialogBox ( dialogName, hideMask );
//		location.href = 'Default_2.aspx';
	}
}

var dialog = new clsDialog ( 'dialog' );

/*---- 倒计时 ----/

	使用示例 ( 10 分钟倒计时 ):
	var counter = new clsCounter ( 'counter' );
	counter.init ( 'divCounter', 600 );
 
	参数说明: objId = 层ID, offsetTime = 剩余秒数, callback = 倒计时完成时回调函数(可缺省)

/------------------ */

function clsCounter ( clsName, mode, category )
{
	this.clsName = clsName;
	this.mode = mode == null ? 1 : 2; // 计时模式 ( 1: 同步客户端时间, 2: 秒数递减 )
	this.expireTime = 0;
	this.offsetTime = 0;
	this.interval = null;
	this.callback = null;
	this.delay = 1000;
	this.syncTime = 600000;
	this.finishText = '比赛结束'; // 到时显示文字
	if(category==null || category=='')
	{
	    this.textDay = ':';
	    this.textHour = ':';
	    this.textMinute = ':';
	    this.textSecond = '';
	}
	else
	{
	    this.textDay = ' 天 '; // 例: '%02s 天'
	    this.textHour = ' 小时 '; // 例: '%02s 时'
	    this.textMinute = ' 分 '; // 例: '%02s 分'
	    this.textSecond = ' 秒 '; // 例: '%02s 秒'
	}
	this.tempDay=0;
	this.tempHour=0;
	this.tempMinute=0;
	this.tempSecond=0;
	
	this.textNoDetail = {
		1 : ' 1 分钟内 ',
		2 : ' 1 小时内 ',
		3 : ' 1 天内 '
		};

	this.showDetailDays = 0; // 小于该天数时开始显示 ( 0 表示无视该参数 )
	this.showLevel = 0; // 显示级别 ( 0: 秒, 1: 分, 2: 小时, 3: 天 )

	this.init = function ( objId, offsetTime, callback )
	{
		this.callback = callback;

		if ( this.interval == null )
		{
			offsetTime = Math.round ( offsetTime );
			var now = new Date ();
			this.offsetTime = offsetTime * 1000;
			this.expireTime = now.getTime () + this.offsetTime; // 记录到期时间
			//alert(this.expireTime);
			this.update ( objId );
		}
	}

	this.update = function ( objId )
	{
		if ( obj = $ ( objId ) )
		{
			this.offsetTime -= this.delay;
			if ( this.mode == 1 ) // 同步客户端时间模式
			{
				var now = new Date ();
				var nowTime = now.getTime ();
				if ( Math.abs ( this.expireTime - nowTime - this.offsetTime ) > this.syncTime )
				{
					this.expireTime = nowTime + this.offsetTime;
				}
				var offsetTime = Math.round ( ( this.expireTime - now.getTime () ) / 1000 );
			}
			else // 秒数递减模式
			{
				var offsetTime = Math.round ( this.offsetTime / 1000 );
			}

			if ( offsetTime < 0 )
			{
				this.clear ();
				if ( this.callback ) eval(this.callback);
				if ( this.finishText ) obj.innerHTML = this.finishText;
				return;
			}

			days = Math.floor ( offsetTime / 86400 );
			offsetTime -= days * 86400;
			hours = Math.floor ( offsetTime / 3600 );
			offsetTime -= hours * 3600;
			minutes = Math.floor ( offsetTime / 60 );
			offsetTime -= minutes * 60;
			seconds = offsetTime;
            
            this.tempDay=days;
	        this.tempHour=hours;
	        this.tempMinute=minutes;
	        this.tempSecond=seconds;
	
			var showDays = this.showLevel > 3 ? '' : this.sprintf ( this.textDay, days );
			var showHours = this.showLevel > 2 ? '' : this.sprintf ( this.textHour, hours );
			var showMinutes = this.showLevel > 1 ? '' : this.sprintf ( this.textMinute, minutes );
			var showSeconds = this.showLevel > 0 ? '' : this.sprintf ( this.textSecond, seconds );
			var showText = showDays + showHours + showMinutes + showSeconds;

			if ( showText == '' )
			{
			    //alert(this.textNoDetail[this.showLevel]);
				if ( this.showLevel > 0 ) showText = this.textNoDetail[this.showLevel];
				else showText = this.finishText;
			}
            //alert(obj.innerHTML);
			obj.innerHTML = showText;
			//alert(obj.innerHTML);
		}

		this.interval = setTimeout ( this.clsName + ".update('" + objId + "')", this.delay );
		//alert(this.clsName);
	}

	this.sprintf = function ( format, data )
	{
		var re = /%([0-9]{1,2})s/g
		var r = format.match ( re );
		data = parseInt ( data );
		if ( isNaN ( data ) ) data = 0;

		if ( r != null )
		{
			var charFill = ' ';
			r = r.toString().replace ( re, "$1" );
			if ( r.length > 1 )
			{
				charFill = r.substr ( 0, 1 );
				r = r.substr ( 1, 1 );
			}

			var dataLength = data.toString().length;
			for ( i = dataLength; i < parseInt ( r ); i ++ )
			{
				data = charFill + data;
			}
			data = format.replace ( re, data );
			return data;
		}
		else if ( data > 0 )
		{
		    if(data<10)
		        data="0"+data;
			data = data.toString() + format;
			return data;
		}
		else
		{
		    if(format==this.textDay)
		        return "";
		    else
		    {
		        if(format==this.textHour)
		        {
		            if(this.tempDay>0)
		                return "00"+format;
		            else
		                return "";
		        }
		        else
		        {
		            if(format==this.textMinute)
		            {
		                if(this.tempDay>0 || this.tempHour>0)
		                    return "00"+format;
		                else
		                    return "";
		            }
		            else
		            {
		                if(format==this.textSecond)
		                {
		                    if(this.tempDay>0 || this.tempHour>0 || this.tempMinute>0)
		                        return "00"+format;//+format
		                    else
		                        return "";
		                }
		            }
		        }
		    }
		}
	}

	this.clear = function ()
	{
		if ( this.interval != null )
		{
			clearTimeout ( this.interval );
			this.interval = null;
		}
	}
}

// 执行自定刷新
var autoRefreshInterval = null;
var chkMessageInterval = null;
var chkMessageOpend = false;

function auto_refresh ( interval )
{
	if ( interval == 0 ) return;
	autoRefreshInterval = setTimeout ( 'auto_refresh(' + interval + ')', interval );
}

// 检查俱乐部新消息
function check_message ( interval )
{
	if ( interval == 0 ) return;

	// 检查俱乐部新消息
	if ( !chkMessageOpend )
	{
		var d = new Date ();
		loader.get ( '/Message/CheckMessage.aspx', null, null, null, callbackCheckMessage );
	}

	chkMessageInterval = setTimeout ( 'check_message(' + interval + ')', interval );
}

// 新消息回调
function callbackCheckMessage ( ret )
{
	var objMsgTip = $ ( 'liInfo' );
	if ( !objMsgTip ) return false;

	if ( Math.round ( ret ) > 0 )
	{
	    //alert(ret);
	    objMsgTip.innerHTML = '<a href=\"javascript:;\" onclick=\"load_content(\'/Message/MessageCenter.aspx\' , \'mc_divMainContent\');highlight(this.parentNode);\" title=\"短信\"><img border=\"0\" title=\"新短信\" height=\"49px\" width=\"49px\" src=\"/Images/Normal/Nav/333.gif\"/></a>';
	}
	else
	{
	    //alert(ret);
		objMsgTip.innerHTML = '<a href=\"javascript:;\" onclick=\"load_content(\'/Message/MessageCenter.aspx\' , \'mc_divMainContent\');highlight(this.parentNode);\" title=\"短信\"></a>';
	}
}

var counterStadiumBuilder = new clsCounter ( 'counterStadiumBuilder' ); // 建设球场倒计时

// 获取上级对话框
function getParentDialog ( obj, className )
{
	if ( typeof ( obj ) == 'string' )
	{
		obj = $ ( obj );
	}
	if ( className == null ) className = 'dialog_box';
	if ( typeof ( obj ) == 'object' && obj.className && obj.className.indexOf ( className ) == 0 ) return obj;
	var pObj = obj.parentNode;
	if ( pObj == null ) return null;
	if ( pObj.className == className ) return pObj;
	else return getParentDialog ( pObj );
}

// 显示页面提示
function show_tips ( act, target )
{
	if ( target == null ) target = 'tips';
	if ( typeof ( target ) == 'string' )
	{
		target = $ ( target );
	}
	if ( !target ) return false;

	if ( target.className == 'highlight' )
	{
		target.className = '';
		target.innerHTML = '';
		setCookie ( 'showTipsSwitch', 'close' );
	}
	else
	{
		target.className = 'highlight';
		load_page ( '/modules/help?act=' + act + '&show_type=4', target );
		setCookie ( 'showTipsSwitch', 'open' );
	}
}

// 球员选择
playerSelector = function ( selectorId, selectLimit, defaultSelectedIds, defaultSelectedNames, errorMsg, selectScript )
{
	this.selectorId = selectorId;

	this.selectedIds = new Array (); // 已选择 ID 数组
	this.selectedNames = new Array (); // 已选择球员名称数组

	this.selectLimit = selectLimit; // 最大选择数
	this.objSelector = $ ( 'selectPlayerList_' + this.selectorId );
	this.itemPrefix = 'player_item_' + this.selectorId + '_';
	this.errorMsg = errorMsg == null ? '' : errorMsg;
	this.selectScript = selectScript == null ? null : selectScript;

	// 判定选择
	this.selectSwitch = function ( playerId, playerName )
	{
		if ( in_array ( playerId, this.selectedIds ) )
		{
			this.unSelect ( playerId, playerName );
		}
		else
		{
			this.select ( playerId, playerName );
		}
	}

	// 选定项目
	this.select = function ( playerId, playerName )
	{
		if ( this.selectedIds.length >= this.selectLimit )
		{
			var errorMsg;
			if ( this.selectLimit <= 0 )
			{
				errorMsg = this.errorMsg == '' ? '您暂时不能选择球员！' : this.errorMsg;
			}
			else
			{
				errorMsg = '您最多只能选择 ' + this.selectLimit + ' 名球员！';
			}
			show_alert ( errorMsg );
			return false;
		}
		var objItem = $ ( this.itemPrefix + playerId );
		objItem.className = 'check_box_checked';
		setBg ( objItem, '#F8FDEE' );

		if ( !in_array ( playerId, this.selectedIds ) )
		{
			this.selectedIds.push ( playerId );
			this.selectedNames.push ( playerName );
		}

		this.makeValue ();

		if ( this.selectScript != null )
		{
			eval ( this.selectScript );
		}
	}

	// 全选
	this.selectAll = function ()
	{
		var objList = this.objSelector.getElementsByTagName ( 'TR' );
		for ( var i in objList )
		{
			if ( this.selectedIds.length >= this.selectLimit ) break;

			var objItem = objList[i];
			if ( typeof ( objItem ) == 'object' )
			{
				if ( objItem.id.indexOf ( this.itemPrefix ) > -1 )
				{
					playerId = objItem.id.replace ( this.itemPrefix, '' );
					var nameObjs = getObjects ( 'player_name_' + playerId );
					var nameObj = nameObjs.shift ();
					var playerName = nameObj.innerHTML;
					this.select ( playerId, playerName );
				}
			}
		}
	}

	// 生成列表值
	this.makeValue = function ()
	{
		var obj = $ ( 'selectedPlayerId_' + this.selectorId );
		obj.value = this.selectedIds.join ( ',' );
		if ( this.selectedNames.length > 0 )
		{
			var playerNames = this.selectedNames.join ( ',&nbsp;' );
		}
		else
		{
			var playerNames = '&lt; 未选择 &gt;';
		}
		setValue ( 'selectedPlayerName_' + this.selectorId, playerNames );
		setValue ( 'selectedPlayerCount_' + this.selectorId, this.selectedIds.length );

	}

	// 去除选择
	this.unSelect = function ( playerId, playerName )
	{
		var objItem = $ ( this.itemPrefix + playerId );
		objItem.className = 'check_box';
		setBg ( objItem, '' );

		var newSelectedIds = new Array ();
		var newPlayerNames = new Array ();

		for ( var i in this.selectedIds )
		{
			if ( this.selectedIds[i] != playerId )
			{
				newSelectedIds.push ( this.selectedIds[i] );
			}
		}

		for ( var i in this.selectedNames )
		{
			if ( this.selectedNames[i] != playerName )
			{
				newPlayerNames.push ( this.selectedNames[i] );
			}
		}

		this.selectedIds = newSelectedIds;
		this.selectedNames = newPlayerNames;
		this.makeValue ();
	}

	// 选择一项
	this.selectOne = function ( playerId, playerName )
	{
		var objList = this.objSelector.getElementsByTagName ( 'TR' );
		for ( var i in objList )
		{
			var objItem = objList[i];
			if ( typeof ( objItem ) == 'object' )
			{
				if ( objItem.id.indexOf ( this.itemPrefix ) > -1 )
				{
					objItem.className = 'check_box';
					setBg ( objItem, '' );
				}
			}
		}
		this.selectedIds = new Array ();
		this.selectedNames = new Array ();
		this.select ( playerId, playerName );
	}

	this.mouseOver = function ( playerId )
	{
		if ( !in_array ( playerId, this.selectedIds ) )
		{
			var objItem = $ ( this.itemPrefix + playerId );
			setBg ( objItem, '#F0F8E6' );
		}
	}

	this.mouseOut = function ( playerId )
	{
		if ( !in_array ( playerId, this.selectedIds ) )
		{
			var objItem = $ ( this.itemPrefix + playerId );
			setBg ( objItem, '' );
		}
	}

	this.reset = function ()
	{
		for ( var i in this.selectedIds )
		{
			var objItem = $ ( this.itemPrefix + this.selectedIds[i] );
			objItem.className = 'check_box';
			setBg ( objItem, '' );
		}
		this.selectedIds = new Array ();
		this.selectedNames = new Array ();
		this.makeValue ();
	}

	// 改变最大选择数
	this.setLimit = function ( number )
	{
		this.selectLimit = number;
		setValue ( "selectPlayersLimit_" + this.selectorId, number );

		if ( number < this.selectedIds.length )
		{
			var newSelectedIds = new Array ();
			var newPlayerNames = new Array ();
			for ( var i = 0; i < this.selectedIds.length; i ++ )
			{
				if ( i < number )
				{
					newSelectedIds.push ( this.selectedIds[i] );
					newPlayerNames.push ( this.selectedNames[i] );
				}
				else
				{
					var objItem = $ ( this.itemPrefix + this.selectedIds[i] );
					objItem.className = 'check_box';
					setBg ( objItem, '' );
				}
			}
			this.selectedIds = newSelectedIds;
			this.selectedNames = newPlayerNames;
			this.makeValue ();
		}
	}

	if ( defaultSelectedIds != null && defaultSelectedIds != '' )
	{
		var arrSelectedIds = defaultSelectedIds.split ( ',' );
		var arrSelectedNames = defaultSelectedNames.split ( ',&nbsp;' );

		for ( var i in arrSelectedIds )
		{
			if ( i >= this.selectLimit ) break;
			this.select ( arrSelectedIds[i], arrSelectedNames[i] );
		}
	}
}

function playSound ( soundFile )
{
	var soundObjectId = 'soundObject';
	var sound = document.getElementById ( soundObjectId );
	if ( sound == null || typeof ( sound ) != 'object' )
	{
		sound = document.createElement ( 'div' );
		sound.id = soundObjectId;
		$('wrapper').appendChild ( sound );
	}
	sound.innerHTML = show_object ( soundFile );
}