
window.addEvent('domready', function() { 
		
		
	/*****
	**	Slider for Login Page 
	*****/	
	var ShowCV2 = $('ShowCV2');	
	if( ShowCV2 ) 
	{
		var mySlide = new Fx.Slide('WhatisOrderRef').hide();
		
		ShowCV2.addEvent('click', function(th)
		{		
			th = new Event(th);
			mySlide.toggle();
			th.stop();
		});
	}
	
	
	
	/*****
	**	Star Rating Hoves and Clicks
	*****/
	$$('.rate').each(function(element,i){
			
		element.addEvent('click', function(e){
			new Event(e).stop();
			var myStyles = ['nostar', 'onestar', 'twostar', 'threestar', 'fourstar', 'fivestar'];
			myStyles.each(function(myStyle){
				if(element.getParent().hasClass(myStyle)){
					element.getParent().removeClass(myStyle)
				}
			});		
			
			myStyles.each(function(myStyle, index){
				id = element.getProperty('id').split("_");
				if(index == id[2]){
					element.getParent().toggleClass(myStyle);
					$(id[0]+'_'+id[1]).setProperty('value', id[2]);
				}
			});		
			
			
		});
		element.addEvent('mouseover', function(){
				
			var myStyles = ['nostar_hover', 'onestar_hover', 'twostar_hover', 'threestar_hover', 'fourstar_hover', 'fivestar_hover'];
			myStyles.each(function(myStyle){
				if(element.getParent().hasClass(myStyle)){
					element.getParent().removeClass(myStyle)
				}
			});		
			myStyles.each(function(myStyle, index){
				id = element.getProperty('id').split("_");
				if(index == id[2]){
					element.getParent().toggleClass(myStyle);
					
					exit;
				}
			});		
		});
		element.addEvent('mouseout', function(){
			var myStyles = ['nostar_hover', 'onestar_hover', 'twostar_hover', 'threestar_hover', 'fourstar_hover', 'fivestar_hover'];
			myStyles.each(function(myStyle){
				if(element.getParent().hasClass(myStyle)){
					element.getParent().removeClass(myStyle)
				}
			});			
		});
	});			

	
	/******
	**	Disable Item Submit Actions
	******/		
	var itemReviews = $$('.reviewItem');
	itemReviews.each(function(ir) {
		ir.addEvent('submit', function(e) {
				
			new Event(e).stop();
 
			/**
			 * This empties the log and shows the spinning indicator
			 */
			var tmp = ir.getProperty('id').split("_");
			var log = $('Log_'+tmp[1]);
		 
			/**
			 * send takes care of encoding and returns the Ajax instance.
			 * onComplete removes the spinner from the log.
			 */
			this.send({
				update: log,
				evalScripts: true,
				onComplete: function() {
				}
			});

		});	
	});
	
	
	/******
	**	Disable Babythings4u Submit Action
	******/	
	var ir = $('ReviewBabythings4u');
	ir.addEvent('submit', function(e) {
	
		new Event(e).stop();
		
		var tmp = ir.getProperty('id').split("_");
		var log = $('Log_Babythings4u');
	 
		/**
		 * send takes care of encoding and returns the Ajax instance.
		 * onComplete removes the spinner from the log.
		 */
		this.send({
			update: log,
			evalScripts: true,
			onComplete: function() {
			}
		});
	});	

});
