//aliases
var Dom = YAHOO.util.Dom;
var $ = Dom.get;

function CreateSwfControl(container, width, height, src)
{
	if (typeof(container) == 'string')
	{
		var c = document.getElementById(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"></embed></object>';
	}
}

function GetSEO(text)
{
	return text
		.toLowerCase() // change everything to lowercase
		.replace(/^\s+|\s+$/g, "") // trim leading and trailing spaces		
		.replace(/[_|\s]+/g, "-") // change all spaces and underscores to a hyphen
		.replace(/[^a-z0-9-]+/g, "") // remove all non-alphanumeric characters except the hyphen
		.replace(/[-]+/g, "-") // replace multiple instances of the hyphen with a single instance
		.replace(/^-+|-+$/g, "") // trim leading and trailing hyphens				
		;
}