window.addEvent('domready', function() {

	$$('.lavishmenu ul').lavishmenu();
	$$('.partners ul,.quicklinks ul').lavishmenu({
		'backgroundColor': '#fff',
		'opacity': 1
	});
	
	$$('.scripts ul').lavishmenu({
		'backgroundColor': '#FFF',
		'backgroundColorActive': '#FFF',
		'opacity': 1
	});
	
	$$('.roundit').each(function(el) {
		var round = new Element('div').inject(el, 'before').adopt(
			new Element('b', {'class': 'round1'}).adopt(
				new Element('b', {'class': 'round11', 'html': '<b></b>'}),
				new Element('b', {'class': 'round12', 'html': '<b></b>'}),
				new Element('b', {'class': 'round13'}),
				new Element('b', {'class': 'round14'}),
				new Element('b', {'class': 'round15'})
			),
			new Element('div', {'class': 'round1fg'}).wraps(el),
			new Element('b', {'class': 'round1'}).adopt(
				new Element('b', {'class': 'round15'}),
				new Element('b', {'class': 'round14'}),
				new Element('b', {'class': 'round13'}),
				new Element('b', {'class': 'round12', 'html': '<b></b>'}),
				new Element('b', {'class': 'round11', 'html': '<b></b>'})
			)
		);
/*
<div>
	<b class="round1">
		<b class="round11"><b></b></b>
		<b class="round12"><b></b></b>
		<b class="round13"></b>
		<b class="round14"></b>
		<b class="round15"></b>
	</b>
	<div class="round1fg">


	</div>
	<b class="round1">
		<b class="round15"></b>
		<b class="round14"></b>
		<b class="round13"></b>
		<b class="round12"><b></b></b>
		<b class="round11"><b></b></b>
	</b>
</div>
*/
	});
});

/*
function Blend(a, b, alpha) {
  var ca = Array(
    parseInt('0x' + a.substring(1, 3)),
    parseInt('0x' + a.substring(3, 5)),
    parseInt('0x' + a.substring(5, 7))
  );
  var cb = Array(
    parseInt('0x' + b.substring(1, 3)),
    parseInt('0x' + b.substring(3, 5)),
    parseInt('0x' + b.substring(5, 7))
  );
  r = '0' + Math.round(ca[0] + (cb[0] - ca[0])*alpha).toString(16);
  g = '0' + Math.round(ca[1] + (cb[1] - ca[1])*alpha).toString(16);
  b = '0' + Math.round(ca[2] + (cb[2] - ca[2])*alpha).toString(16);
  return '#'
    + r.substring(r.length - 2)
    + g.substring(g.length - 2)
    + b.substring(b.length - 2);
}
*/