function csprtContainer() {
	//for future use
}
var newDiv;
function getCsprtCompanionBridgeHtml() {
	var f = document.getElementById('csprt');
	var id = '';
	var parts = f.src.split('?');
	if (parts.length > 1) {
		var params = parts[1].split('&');
		for (p in params) {
			if (typeof(params[p]) == "string") {
				var prts = params[p].split('=');
				if (prts[0] == 'id')
					id = prts[1];
			}
		}
	} 
	if (id == '') {
		var mparts = parts[0].split('/');
		var lastpart = mparts[mparts.length-1];
		id = lastpart.split('.')[0];
	}
	var litePlyrStr = '<div style="position:absolute;left:-256px;width:64px;height:64px;"><object id="csprtAdBridge" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="1" HEIGHT="1">' +
	'<param name="bgcolor" value="#ffffff" /><param name="wmode" value="transparent" />' +
	'<param name="allowScriptAccess" value="always" />' + 
	'<param name="movie" value="http://s3.cinesport.com/app_v2/CsprtCompanionAdBridge.swf?mode=recipient&id='+id+'">' +
	'<embed src="http://s3.cinesport.com/app_v2/CsprtCompanionAdBridge.swf?mode=recipient&id='+id+'" name="csprtAdBridge" width="1" height="1" allowScriptAccess="always" bgcolor="#ffffff" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>' +
	'</object></div>';
	return litePlyrStr;
}

function enableCsprtCompanionBridge() {
	document.write(getCsprtCompanionBridgeHtml());
}

function insertCsprtCompanion(adHtml) {
	var ifrmHtml = '<iframe id="csprt_companion_ad_iframe" frameborder="0" align="top,left" marginheight="0" marginwidth="0" scrolling="no" width="300" height="250" style="margin-top:5px;"></iframe>';
	
	var csprtCompanionDiv = document.getElementById('csprtcompanion');
	csprtCompanionDiv.innerHTML = ifrmHtml;
	
	var ifrm = document.getElementById('csprt_companion_ad_iframe');
	ifrm = (ifrm.contentWindow) ? ifrm.contentWindow : (ifrm.contentDocument.document) ? ifrm.contentDocument.document : ifrm.contentDocument;
	ifrm.document.open();
	ifrm.document.write(adHtml);
	ifrm.document.close();
	if (typeof(csprt_onAdStart) != 'undefined') csprt_onAdStart();
}

function removeCsprtCompanion() {
	var csprtCompanionDiv = document.getElementById('csprtcompanion');
	csprtCompanionDiv.innerHTML = '';
	if (typeof(csprt_onAdComplete) != 'undefined') csprt_onAdComplete();
}
