function rgb2hex(rgb) {
	function hex(x) {
		hexDigits = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F");
		return isNaN(x) ? "00" : hexDigits[(x - x % 16) / 16] + hexDigits[x% 16];
	}
	return hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
}

$(document).ready(function(){

	$('h1, .product-category .category-description, .sort strong').sifr({ 
		font: baseUrl + '/template-resources/flash/americantypewriter.swf',
		textAlign: 'left'
		
	});
	$('.product-grid .product-group h2 a').sifr({ 
		font: baseUrl + '/template-resources/flash/americantypewriter.swf',
		textAlign: 'left',
		width:150
		
	});
/*
    $('.product h2, .sort strong').each(function(){
        var color = rgb2hex($(this).css('color'));
        var text = encodeURIComponent($(this).text());
        var genUrl = "http://www.sonyericsson.com/cws/generatedimages?text=" + text + "&color=" + color + "&size=24&fontid=key.FontFile.AmericanTypewriter&rtl=false";
        // antingen wrappa eller köra text-indent direkt på h1
        $(this).wrapInner('<span style="text-indent: -9999px;float: left;"></span>').append('<img src="' + genUrl +'" alt="' + $(this).text() + '" />');
    });
*/
});