function showPoster(url,width,height,preview)
{
	var so = new SWFObject("/img/poster.swf", "mymovie", width, height, "5", "#000000");
	so.addVariable("u",url);
	//so.addVariable("b",'/img/widget-button.jpg');
	//so.addVariable("c",'http://poster.myespnhighlights.com/?clean')
	so.addParam("wmode","opaque");
	if(preview)
	{
		so.write("posterFrame",'<div id="posterPreview"></div>');
		$('posterPreview').style.width = width+'px';
		$('posterPreview').style.height = height+'px';
		$('posterPreview').style.position = 'absolute';
		$('posterPreview').style.top = '0px';
		$('posterPreview').style.left = '0px';
	}//end if
	else
		so.write("posterFrame");
}//end showPoster

function startVideo(video, width, height,auto){
	var so = new SWFObject('/img/mediaplayer.swf','mpl',width,height,'9.0.115');
	so.addParam('allowfullscreen','false');
	so.addParam('allowscriptaccess','true');
	so.addParam("wmode","opaque");
	so.addVariable('displayheight',height);
	so.addVariable('file','' + video);
	so.addVariable('image','/img/screen-cap.jpg');
	if(auto)
		so.addVariable('autostart','true');
	so.addVariable('height',height);
	so.addVariable('width',width);
	so.useExpressInstall('/img/expressinstall.swf');
	so.setAttribute('xiRedirectUrl', 'http://poster.myespnhighlights.com/'); // must be the absolute URL to your site
	so.write('marketPlayer');
}
function shareProjectE(id,session)
{
	var oldHTML = $('btnWrapper').innerHTML;
	$('btnWrapper').innerHTML = '<b>sending emails, please wait...</b>';
	new Ajax.Updater({success:'shareEmailContent'},'/do/control.Project.php',
		{
			method: 'post',
			parameters: 'id='+id+'&key='+session+'&do=share&aj=1&shareEmail='+$('shareEmail').value+'&shareReply='+$('shareReply').value+'&shareMessage='+$('shareMessage').value,
			onFailure: function(transport){
				alert(transport.responseText);
				$('btnWrapper').innerHTML = oldHTML;
			}//end failure function
		})
	return false;
}//end shareProjectE

function submitPromo()
{
	$('applyBtn').disabled = true;
	var oldBtnValue = $('applyBtn').value;
	$('applyBtn').value = '...';
	new Ajax.Updater({success:'orderBox'},'/do/control.Cart.php',
		{
			method: 'post',
			parameters: 'do=addPromo&aj=1&promoCode='+$('promoCode').value,
			onFailure: function(transport){
				alert(transport.responseText);
				$('applyBtn').disabled = false;
				$('applyBtn').value = oldBtnValue;
			}//end failure function
		})
	return false;
}//end submitPromo

/**
* Returns the value of the selected radio button in the radio group, null if
* none are selected, and false if the button group doesn't exist
*
* @param {radio Object} or {radio id} el
* OR
* @param {form Object} or {form id} el
* @param {radio group name} radioGroup
*/
function $RF(el, radioGroup) {
    if($(el).type && $(el).type.toLowerCase() == 'radio') {
        var radioGroup = $(el).name;
        var el = $(el).form;
    } else if ($(el).tagName.toLowerCase() != 'form') {
        return false;
    }

    var checked = $(el).getInputs('radio', radioGroup).find(
        function(re) {return re.checked;}
    );
    return (checked) ? $F(checked) : null;
}