window.addEvent('domready', function() {
	if ($("bannerBags"))	{				
		var gallery1 = new slideGallery($("bannerBags"), {
			steps: 1,
			mode: "circle",
			autoplay: true,
			paging: false,
			duration:4000,
			speed:500
		});
	}	
});


window.addEvent('domready',function() {
	if ($('textFieldInput')) var over = new OverText($('textFieldInput'));
	if ($('textFieldLoginName')) var over2 = new OverText($('textFieldLoginName'));
	if ($('textFieldLoginLastName')) var over3 = new OverText($('textFieldLoginLastName'));
	if ($('textFieldLoginLastName')) var over3 = new OverText($('textFieldLoginLastName'));
	if ($('mailFriend')) var over4 = new OverText($('mailFriend'));
	if ($('username')) var over5 = new OverText($('username'));
});


window.addEvent('domready', function(){
	if ($('mainMenu')) {	
		$$('#menuColor1').addEvent('mouseover', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#ff3398');	
		});
		$$('#menuColor2').addEvent('mouseover', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#fefe3f');	
		});
		$$('#menuColor3').addEvent('mouseover', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#3196fe');	
		});
		$$('#menuColor4').addEvent('mouseover', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#65cc00');	
		});
		$$('#menuColor5').addEvent('mouseover', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#fd002f');	
		});
		
		
		$$('#mainMenuSecond.subMenu1 .menuItem').addEvent('mouseover', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#ff3398');
		});
		$$('#mainMenuSecond.subMenu2 .menuItem').addEvent('mouseover', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#fefe3f');
		});
		$$('#mainMenuSecond.subMenu3 .menuItem').addEvent('mouseover', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#3196fe');
		});
		$$('#mainMenuSecond.subMenu4 .menuItem').addEvent('mouseover', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#65cc00');
		});
		$$('#mainMenuSecond.subMenu5 .menuItem').addEvent('mouseover', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#fd002f');
		});
		

		$$('#mainMenuFirst .menuItem').addEvent('mouseout', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#fff');
		});
		$$('#mainMenuSecond .menuItem').addEvent('mouseout', function() {	
				if ( (this.getProperty('class').contains('active')) != true) this.setStyle('background-color','#fff');
		});
		
		$('mainMenu').setStyle('visibility','visible');
		
	}	
});


									 


window.addEvent('load', function(){
	
	if ( $('productList')) {
			new MooTooltips({
				hovered:'.tipper',		// the element that when hovered shows the tip
				ToolTipClass:'ToolTips',	// tooltip display class
				toolTipPosition:1, // -1 top; 1: bottom - set this as a default position value if none is set on the element
				sticky:false,		// remove tooltip if closed
				fromTop: -225,		// distance from mouse or object
				fromLeft: 120,	// distance from left
				duration: 300,		// fade effect transition duration
				fadeDistance: 20    // the distance the tooltip starts the morph
			});	
	}
});


window.addEvent('domready', function() {
   
   if ($('userForm') ) {
		   myFormValidator6 = new Form.Validator.Inline($('userForm'), {
		      stopOnFailure: true,
		      useTitles: true,
		      errorPrefix: "",
		            
		      onFormValidate: function(passed, form, event) {
		         if (passed) {
		            form.submit();
		         }
		      }
		     
		   });
		   
		  
		   if ($('userSubmit')) {
		   	$('userSubmit').addEvents({
		      		'click': function() { myFormValidator6.validate(); }
		   });
		}
		
		   
		   
		   myFormValidator6.add('choose-an-option', {
		   	errorMsg:Form.Validator.getMsg.pass('pleaseChooseAnOption'),
		
		   	test: function(element, props) {
		      	 	var noChooseValue = '';
		         	if ($type(props.noChooseValue)) {
		            	noChooseValue = props.noChooseValue;
		         	}
		         	if ((element.get('value')) == noChooseValue ) return false;
		         	else return true;
		
		  	 }
			});
			
	} //if
});

window.addEvent('domready', function() {
   
   if ($('checkoutForm') ) {
		   myFormValidator7 = new Form.Validator.Inline($('checkoutForm'), {
		      stopOnFailure: true,
		      useTitles: true,
		      errorPrefix: "",
		            
		      onFormValidate: function(passed, form, event) {
		         if (passed) {
		            form.submit();
		         }
		      }
		     
		   });
		   
		  
		   if ($('userSubmit')) {
		   	$('userSubmit').addEvents({
		      		'click': function() { myFormValidator7.validate(); }
		   });
		}
		
		   
		   
		   myFormValidator7.add('choose-an-option', {
		   	errorMsg:Form.Validator.getMsg.pass('pleaseChooseAnOption'),
		
		   	test: function(element, props) {
		      	 	var noChooseValue = '';
		         	if ($type(props.noChooseValue)) {
		            	noChooseValue = props.noChooseValue;
		         	}
		         	if ((element.get('value')) == noChooseValue ) return false;
		         	else return true;
		
		  	 }
			});
			
	} //if
});


window.addEvent('domready', function() {
   
   if ($('productDetailForm')) {
	   myFormValidator2 = new Form.Validator.Inline($('productDetailForm'), {
	      stopOnFailure: true,
	      useTitles: true,
	      errorPrefix: "",
	            
	      onFormValidate: function(passed, form, event) {
	         if (passed) {
	            form.submit();
	         }
	      },
	
	      onElementValidate: function(passed, element, validator, is_warn) {
	         if (element.get('name') == 'agb' && !passed) {
	            alert('Hey, the terms are really important!');
	         }
	      }
	   });
	   
	   //Max Quantity Validator
	   myFormValidator2.add('validate-quantity', {
	   errorMsg: function(element, props){
				return Form.Validator.getMsg('quantityTooBig').substitute({maxQuantity: props.maxQuantity || element.get('type')});
			},
	   test: function(element, props) {
	      	 var maxQuantity = '';
	         if ($type(props.maxQuantity)) {
	            maxQuantity  = props.maxQuantity;
	         }
	         if ((element.get('value')).toInt() > maxQuantity.toInt() ) return false;
	         else return true;
	
	   }
	  });
	   
	   if ($('submit')) {
	   	$('submit').addEvents({
	      		'click': function() { myFormValidator2.validate(); }
	      }); 
	   }   
	}

});

window.addEvent('domready', function() {	
	
	if ($('cartForm')) {
	   myFormValidator3 = new Form.Validator.Inline($('cartForm'), {
	      stopOnFailure: true,
	      useTitles: true,
	      errorPrefix: "",
	            
	      onFormValidate: function(passed, form, event) {
	         if (passed) {
	            form.submit();
	         }
	      },
	
	      onElementValidate: function(passed, element, validator, is_warn) {
	         if (element.get('name') == 'agb' && !passed) {
	            alert('Hey, the terms are really important!');
	         }
	      }
	   });
	   
	   if ($('submit')) {
	   	$('submit').addEvents({
	      		'click': function() { myFormValidator3.validate(); }
	      }); 
	   }   
	   
	   //Max Quantity Validator
	   myFormValidator3.add('validate-quantity', {
	   errorMsg: function(element, props){
				return Form.Validator.getMsg('quantityTooBig').substitute({maxQuantity: props.maxQuantity || element.get('type')});
			},
	   test: function(element, props) {
	      	 var maxQuantity = '';
	         if ($type(props.maxQuantity)) {
	            maxQuantity  = props.maxQuantity;
	         }
	         if ((element.get('value')).toInt() > maxQuantity.toInt() ) return false;
	         else return true;
	
	   }
	  });
	   
	   
	}

});


window.addEvent('domready', function() {
   
   if ($('productDetailForm')) {
	   myFormValidator2 = new Form.Validator.Inline($('productDetailForm'), {
	      stopOnFailure: true,
	      useTitles: true,
	      errorPrefix: "",
	            
	      onFormValidate: function(passed, form, event) {
	         if (passed) {
	            form.submit();
	         }
	      },
	
	      onElementValidate: function(passed, element, validator, is_warn) {
	         if (element.get('name') == 'agb' && !passed) {
	            alert('Hey, the terms are really important!');
	         }
	      }
	   });
	   
	   //Max Quantity Validator
	   myFormValidator2.add('validate-quantity', {
	   errorMsg: function(element, props){
				return Form.Validator.getMsg('quantityTooBig').substitute({maxQuantity: props.maxQuantity || element.get('type')});
			},
	   test: function(element, props) {
	      	 var maxQuantity = '';
	         if ($type(props.maxQuantity)) {
	            maxQuantity  = props.maxQuantity;
	         }
	         if ((element.get('value')).toInt() > maxQuantity.toInt() ) return false;
	         else return true;
	
	   }
	  });
	   
	   if ($('submit')) {
	   	$('submit').addEvents({
	      		'click': function() { myFormValidator2.validate(); }
	      }); 
	   }   
	}

});

window.addEvent('domready', function() {
   
   if ($('changePasswordForm')) {
	   myFormValidator4 = new Form.Validator.Inline($('changePasswordForm'), {
	      stopOnFailure: true,
	      useTitles: true,
	      errorPrefix: "",
	            
	      onFormValidate: function(passed, form, event) {
	         if (passed) {
	            form.submit();
	         }
	      }
	   });
	   
	   if ($('submit')) {
	   	$('submit').addEvents({
	      		'click': function() { myFormValidator4.validate(); }
	      }); 
	   }   
	}

});




