var ssWidgetURL='http://webwidget.songstall.com';
var str_ssWidgetLoadError = '<div style="border:1px solid black;margin:10px;padding:5px;background-color:white;">Unable to load Songstall web widget.  Please ensure you have copied and pasted the widget code unmodified and in full.</div>';
function callSongStallWebWidget(str_Serial, int_Width, int_Height) {
	document.write(' \
		<style type="text/css"> \
			a#a_SongStallWidgetLink_'+str_Serial+' { \
				color: white; \
				text-decoration: none; \
				font-family: arial; \
				font-size: 11px; \
			} \
			div#div_SongStallWidgetLink_'+str_Serial+' { \
				background-color: black; \
				color: white; \
				margin: 0 0 0 12px; \
				text-decoration: none; \
				font-family: arial; \
				font-size: 11px; \
				padding: 2px 2px 2px 2px; \
				text-align: center; \
				width: '+(int_Width-28)+'px; \
			} \
		</style> \
		<div id="div_SongStallWidget_'+str_Serial+'"></div> \
	');
	var ssLink = document.getElementById('a_SongStallWidgetLink_'+str_Serial);
	var ssLinkDiv = document.getElementById('div_SongStallWidgetLink_'+str_Serial);
	var ssDiv = document.getElementById('div_SongStallWidget_'+str_Serial);
	//alert(ssLink);
	var bol_Loaded=false;
	if (ssLink && ssDiv && ssLinkDiv) {
		//if (ssLink.innerHTML.indexOf('Songstall') >= 0 && ssLink.href.indexOf('.songstall.') >= 0) {
		if (ssLink.href.indexOf('.songstall.') >= 0) {
			bol_Loaded=true;
			ssDiv.innerHTML = '<iframe src="'+ssWidgetURL+'/webwidget.php?s='+str_Serial+'&w='+int_Width+'&h='+int_Height+'" style="border:0;width:'+int_Width+'px;height:'+int_Height+'px;" allowtransparency="true" frameborder="0"></iframe>';
			ssLinkDiv.parentNode.insertBefore(ssDiv, ssLinkDiv);
		}
	}
	if (!bol_Loaded) {
		document.write(str_ssWidgetLoadError);
	}
}
