// JavaScript Document
//Fx.MorphCustom = Fx.Morph.extend({
//	start: function(className){
//		var to = {};
//		$each(document.styleSheets, function(style){
//			var rules = style.rules || style.cssRules;
//			$each(rules, function(rule){
//				if (!rule.selectorText.test('\.' + className + '$')) return;
//				Fx.CSS.Styles.each(function(style){
//					if (!rule.style || !rule.style[style]) return;
//					var ruleStyle = rule.style[style];
//					to[style] = (style.test(/color/i) && ruleStyle.test(/^rgb/)) ? ruleStyle.rgbToHex() : ruleStyle;
//				});
//			});
//		});
//		return this.parent(to);
//	}
// 
//});
 
//Fx.CSS.Styles = ["backgroundColor", "backgroundPosition", "color", "width", "height", "left", "top", "bottom", "right", "fontSize", "letterSpacing", "lineHeight", "textIndent", "opacity"];
 
//Fx.CSS.Styles.extend(Element.Styles.padding);
//Fx.CSS.Styles.extend(Element.Styles.margin);
 
//Element.Styles.border.each(function(border){
//	['Width', 'Color'].each(function(property){
//		Fx.CSS.Styles.push(border + property);
//	});
//});




function ScrollImagesLeft()
{	
	var imgToInsert;
	var i;
	if (location.href=="http://allegromusiccenter.com/catalog" || location.href=="http://allegromusiccenter.com.com/index.php" || location.href=="http://allegromusiccenter.com/index.php" || location.href=="http://www.allegromusiccenter.com/index.php" || location.href=="http://www.allegromusiccenter.com/index.php")
	{
		var imgSet = new Fx.Morph('imgSet1', {wait: false, transition:Fx.Transitions.Back.easeInOut, duration:4500, onComplete:function(){}});
		imgToInsert=new Asset.images(['/images/header/xviolin.jpg', '/catalog/images/header/sheetmusic.jpg', '/images/header/xsax2.jpg', 
									  '/images/header/xviolin2.jpg', '/catalog/images/header/xvscroll.jpg', '/images/header/xguitar.jpg',
									  '/images/header/xclarinet.jpg', '/catalog/images/header/xkeys.jpg', '/images/header/xsax.jpg', 
									  '/images/header/xsideviewv.jpg'], {onComplete: function(){imgSet.start('.scrollLeft');}});
	
		$$(imgToInsert).injectInside('imgSet1');
	}
	else
	{
		i = Math.floor(Math.random()*4);
		i++;	
			
		switch(i)
		{
		case 1:
			imgToInsert=new Asset.images(['/images/header/xsax.jpg', '/images/header/xkeys.jpg', '/images/header/xclarinet.jpg', '/images/header/xguitar.jpg', '/images/header/xviolin.jpg', '/images/header/sheetmusic.jpg'], {onComplete: function(){}});
			break;    
		case 2:
			imgToInsert=new Asset.images(['/images/header/xvscroll.jpg', '/images/header/xkeys.jpg', '/images/header/xsax.jpg', '/images/header/xsideviewv.jpg', '/images/header/xclarinet.jpg', '/images/header/xguitar.jpg'], {onComplete: function(){}});
			break;
		case 3:
			imgToInsert=new Asset.images(['/images/header/xbridge.jpg', '/images/header/xguitar2.jpg', '/images/header/xtrumpet.jpg', '/images/header/xkeys.jpg', '/images/header/xvscroll.jpg', '/images/header/xflute.jpg'], {onComplete: function(){}});
			break;
		case 4:
			imgToInsert=new Asset.images(['/images/header/xclarinet.jpg', '/images/header/xsideviewv.jpg', '/images/header/xtrumpet.jpg', '/images/header/xguitar2.jpg', '/images/header/xbridge.jpg', '/images/header/xkeys.jpg'], {onComplete: function(){}});
			break;
		default:
			break;
		} 
		$$(imgToInsert).injectInside('imgSet1');
	}
	

}

function ScrollImagesRight()
{
var imgSet1 = new Fx.Morph('imgSet1', {wait: false, transition:Fx.Transitions.linear, duration:10000, onComplete:function(){ScrollImagesLeft();}});
imgSet1.start('.scrollRight');
}

