var seamlyne = function() {
	return {
		dropItem: function(xid) {
			$(xid).style.backgroundColor = "#FFA";
			$(xid).style.color = "#0F0";
			Effect.Fade(xid);
		},
		showColorChart : function() {
			var vUrl = '/catalog/usermods/color-chart.asp';
			 
			win = new Window({className: "dialog"
				, title: "Color Chart"
				, width:640
				, height:480
				, destroyOnClose: true
				, recenterAuto:true
				, minimizable:false
				, maximizable:false
				, url:vUrl
				, showEffectOptions:{duration:1.0}}); 
			win.showCenter(); 
		},
		showPopinWindow : function(vUrl, w, h, vTitle) {
			win = new Window({className: "dialog"
				, title: vTitle
				, width:w
				, height:h
				, destroyOnClose: true
				, recenterAuto:true
				, minimizable:false
				, maximizable:false
				, url:vUrl
				, showEffectOptions:{duration:.5}}); 
			win.showCenter(); 
		}
	}
}();

Event.observe(document, "dom:loaded", function(){
	$$(".topbarNavigation").each(function(C){
		Event.observe(C, 'mouseover', function(){
			new Effect.Morph(C, {style:'background: #aaa; color: #FFF;font-weight: bold;', duration: 0.35});
		});
		Event.observe(C, 'mouseout', function(){
			new Effect.Morph(C, {style:'background: #FFF; color: #333;font-weight: normal;', duration: 0.35});
		});
	});
	$$(".imgNav").each(function(C){
		Event.observe(C, 'click', function(){
			var direction = C.readAttribute('rel');
			nextImage(direction);
		});
	});

	$$("[rel=Inseam]").each(function(C){
		Event.observe(C, 'change', function(){
			if(C.value == 8){
				// 33-34" inseam
				alert("You should only select this option if you are above 6'-2\" in height.")
			}
			if(C.value == 9){
				// 35-36" inseam
				alert("You should only select this option if you are above 6'-4\" in height.")
			}
		});
	});

});

function nextImage(direction){
	if(direction == 'next') {
		imgCounter++
		if (imgCounter > (imgArray.length - 1)){
			imgCounter = 0
		}
	} else {
		imgCounter--
		if (imgCounter < 0){
			imgCounter = imgArray.length - 1
		}
	}
	$('ProductImg').src = imgArray[imgCounter];
}


