function embedHolCredential(orgId,userId,badgeConfiguration){
	if(window.holLoaderIndexer==null){
		window.holLoaderIndexer=0;
	}
	var loaderId="holClientCredential"+window.holLoaderIndexer;
	window.holLoaderIndexer=window.holLoaderIndexer+1;
	var dims=getBadgeDimensions(badgeConfiguration);
	document.write('<object ');
	document.write(' title="Honesty Online Identity Credential" '); 
	document.write(' codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=9,0,115" ');
	document.write(' id="' + loaderId + '"  ');
	document.write(' height="' + dims.h + '"  ');
	document.write(' width="' + dims.w + '"  ');
	document.write(' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> ');
	document.write(' <param value="http://resources.honestyonline.com/webservices/flash/loader.swf" name="movie"\/> ');
	document.write(' <param value="high" name="quality"\/> ');
	document.write(' <param value="#000000" name="bgcolor"\/> '); 
	document.write(' <param value="always" name="allowScriptAccess"\/> ');	
	document.write(' <param value="orgId=' + orgId + '&userId=' + userId + '&widget=badge&badgeConfiguration='+badgeConfiguration + '" name="flashVars"\/> ');			
	document.write(' <embed ');
	document.write(' pluginspage="http://www.adobe.com/go/getflashplayer"  ');
	document.write(' play="true" ');
	document.write(' quality="high" ');
	document.write(' allowscriptaccess="always" ');
	document.write(' align="middle" ');
	document.write(' loop="false" ');
	document.write(' flashvars="orgId=' + orgId + '&userId=' + userId + '&widget=badge&badgeConfiguration='+badgeConfiguration + '" ');
	document.write(' src="http://resources.honestyonline.com/webservices/flash/loader.swf" ');
	document.write(' type="application/x-shockwave-flash" ');
	document.write(' bgcolor="#00000" ');
	document.write(' height="' + dims.h + '" ');
	document.write(' width="' + dims.w + '" ');
	document.write(' name="' + loaderId + '"\/> ');
	document.write(' <\/object>');

}


function embedHolPrimaryCredential(orgId,userId){
	embedHolCredential(orgId,userId,'primary');
}

function embedHolSmallCredential(orgId,userId){
	embedHolCredential(orgId,userId,'small');
}
function embedHolLargeIconCredential(orgId,userId){
	embedHolCredential(orgId,userId,'iconLarge');
}
function embedHolMediumIconCredential(orgId,userId){
	embedHolCredential(orgId,userId,'iconMedium');
}
function embedHolSmallIconCredential(orgId,userId){
	embedHolCredential(orgId,userId,'iconSmall');
}
function getBadgeDimensions(badgeConfiguration){
	if(badgeConfiguration=="primary"){
		return {h:50,w:190};
	}
	if(badgeConfiguration=="small"){
		return {h:30,w:114};
	}
	if(badgeConfiguration=="iconLarge"){
		return {h:40,w:50};
	}
	if(badgeConfiguration=="iconMedium"){
		return {h:30,w:40};
	}
	if(badgeConfiguration=="iconSmall"){
		return {h:22,w:22};
	}
}
