var html = "";
if( colors && imagepath && paintpath )
{
	if( colors.length > 0 )
	{
		for( i=0; i<colors.length;i++ )
		{
			html += "<a name='color"+i+"'><div style='float: left; width: 45px; height: 45px; margin: 0px 5px 5px 0px;  border: solid 1px #cccccc; background-color: " + colors[ i ].color + ";' title='" + colors[ i ].title + "' ><!-- --></div></a>";
		}
		html = "<div style='width: 326px; margin: 20px;'>" + html + "</div>";
		if( document.all )
		{
			document.all['colorpicker'].innerHTML = html;
		}
		else if( document.getElementById )
		{
			document.getElementById('colorpicker').innerHTML = html;
		}
		if( ! swfheight )
		{
			swfheight = 300;
		}
		var so = new SWFObject("/graphics/Synkron-Library/Honda-Sverige/Files/Flash/Colorpicker/colorpicker.swf", "flash", "326", swfheight+"", "9", "#ffffff");
		so.addVariable( "image", imagepath );
		so.addVariable( "paint", paintpath );
		so.addVariable( "margin", ( swfmargin ? swfmargin : 15 ) );
		so.addVariable( "center", ( swfcenter ? swfcenter : false ) );
		so.addVariable( "numcolors", colors.length );
		so.addVariable( "pageURL", escape( window.location ) );
		for( i=0; i<colors.length;i++ )
		{
			so.addVariable( "color"+i, colors[ i ].color.replace("#","") );
			so.addVariable( "tint"+i, colors[ i ].tint.replace("#","") );
			so.addVariable( "title"+i, colors[ i ].title );
		}
		if( window.location.search.indexOf( 'noflash=1' ) <= -1 )
		{
			so.write("colorpicker");
		}
	}
}
