function swfWrite(width, height, movie, id, flashvars){
	var html = '';
	html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+width+'" height="'+height+'" id="'+id+'" align="middle">';
	html += '<param name="movie" value="'+movie+'" />';
	html += '<param name="quality" value="high" />';
	html += '<param name="bgcolor" value="#ffffff" />';
	html += '<param name="play" value="true" />';
	html += '<param name="loop" value="true" />';
	html += '<param name="wmode" value="transparent" />';
	html += '<param name="scale" value="showall" />';
	html += '<param name="menu" value="true" />';
	html += '<param name="devicefont" value="false" />';
	html += '<param name="salign" value="" />';
	html += '<param name="allowScriptAccess" value="sameDomain" />';
	html += '<param name="flashvars" value="'+flashvars+'" />';
	html += '<!--[if !IE]>-->';
	html += '<object type="application/x-shockwave-flash" data="'+movie+'" width="'+width+'" height="'+height+'">';
	html += '<param name="movie" value="'+movie+'" />';
	html += '<param name="quality" value="high" />';
	html += '<param name="bgcolor" value="#ffffff" />';
	html += '<param name="play" value="true" />';
	html += '<param name="loop" value="true" />';
	html += '<param name="wmode" value="transparent" />';
	html += '<param name="scale" value="showall" />';
	html += '<param name="menu" value="true" />';
	html += '<param name="devicefont" value="false" />';
	html += '<param name="salign" value="" />';
	html += '<param name="allowScriptAccess" value="sameDomain" />';
	html += '<param name="flashvars" value="'+flashvars+'" />';
	html += '<!--<![endif]-->';
	html += '<a href="http://www.adobe.com/go/getflash">';
	html += '<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />';
	html += '</a>';
	html += '<!--[if !IE]>-->';
	html += '</object>';
	html += '<!--<![endif]-->';
	html += '</object>';
	return html;
}
function coverflowToJS(viewType){
	if(viewType){
		var flashvars = 'xmlUrl=/coverflow/'+coverflow_sitePath+'/xml/coverflow_'+viewType+'.xml';
		var mf = swfWrite('100%', '350', '/coverflow/swf/coverflow.swf', 'coverflow', flashvars);
		document.getElementById('coverflowContent').innerHTML = mf;
	}
}
function coverflowToJSURL(viewUrl){
	if(viewUrl){
		var imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i;
		if(viewUrl.match(imgRegExp)){
			$.fancybox.showActivity();
			$.fancybox({href:viewUrl, hideOnContentClick:true});
		}else{
			document.location.replace(viewUrl);
		}
	}
}
