//aliases
var Dom = YAHOO.util.Dom;
var $$ = Dom.get;


function CreateSwfControl(container, width, height, src)
{
	if (typeof(container) == 'string')
	{
		var c = $$(container);
	}
	else
	{
		var c = container;
	}
	if (c != null)
	{
		var widthStr = '';
		var heightStr = '';
		if(width != '' && width != null)
		{
			widthStr = ' width=' + width;
		}
		if(height != '' && height != null)
		{
			heightStr = ' height=' + height;
		}
		c.innerHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + widthStr + heightStr + '"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"><param name="src" value="' + src + '"/><param name="quality" value="high"/><param name="wmode" value="transparent"/><embed src="' + src + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"' + widthStr + heightStr + '" wmode="transparent" bgcolor="#000000"></embed></object>';
	}
}
function CreateSwfControl11(container, width, height, src)
{
	if (typeof(container) == 'string')
	{
		var c = $$(container);
	}
	else
	{
		var c = container;
	}
	if (c != null)
	{
		var widthStr = '';
		var heightStr = '';
		if(width != '' && width != null)
		{
			widthStr = ' width=' + width;
		}
		if(height != '' && height != null)
		{
			heightStr = ' height=' + height;
		}
		c.innerHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + widthStr + heightStr + '"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"><param name="src" value="' + src + '"/><param name="quality" value="high"/><param name="wmode" value="direct"/><embed src="' + src + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"' + widthStr + heightStr + '" wmode="direct" bgcolor="#000000"></embed></object>';
	}
}
function urlencode (str)
{
    str = (str+'').toString();
    return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28'). replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
}

function checkSubmit(e, submitButton)
{
	var formName = $$( submitButton ).form.id;
	var resultForm = Db.Validations.Submit(formName);
	YAHOO.util.Event.stopPropagation(e);
	if ( resultForm )
	{
		$$( submitButton ).style.display = 'none';
		$$( "sending" ).style.display = 'block';		
	}

	
	return resultForm;
}


