window.addEvent('domready', function() { 

	var commentsStatus = false;
	var formStatus = false;
	if (document.getElementById('allcomments'))
	{
		$('allcomments').setStyle('display', 'none');
		$('show_comments').addEvent('click', function(e){
			e.stop();
			if (commentsStatus == false)
			{
				$('allcomments').setStyle('display', 'block');
				$('show_comments').set('html', 'Скрий коментарите');
				commentsStatus = true;
			}
			else
			{
				$('allcomments').setStyle('display', 'none');
				$('show_comments').set('html', 'Покажи всички коментари');
				commentsStatus = false;
			}
		});	
	}
	if (document.getElementById('comments_form'))
	{
		$('comments_form').setStyle('display', 'none');
		$('add_comment').addEvent('click', function(e){
			e.stop();
			if (formStatus == false)
			{
				$('comments_form').setStyle('display', 'block');
				formStatus = true;
			}
			else
			{
				$('comments_form').setStyle('display', 'none');
				formStatus = false;
			}
		});	
		
	}
	new SmartHoverBox({

		yOffset: -165, //set your options in here

		xOffset: 100,

		lockY:'',

		lockX:'none'

	}); 

//	new SmartHoverBox({
//		yOffset: 0, //set your options in here
//		xOffset: 0,
//		smartBoxSuffix  : '_sbox', //suffix that creates a hover box
//	}); 
//	new SmartHoverBox({
//		yOffset: -120, //set your options in here
//		xOffset: -150,
//		lockX:'',
//		lockY:'',
//		smartBoxSuffix  : '_sbox2', //suffix that creates a hover box
//	}); 
	

	$$('#field1, #field2, #field3, #field4, #field5, #field6').addEvents({

		'keydown':function(){

			name=this.id;

			newname=this.id+"-2";

		},

		

		'keyup':function(){

			name=this.id;

			newname=this.id+"-2";

			$(newname).value=this.value;

		},

		

		'blur':function(){

			name=this.id;

			newname=this.id+"-2";

			$(newname).value=this.value;

			$(newname).setStyle('color','#000000');

		},

		

		'focus':function(){

			name=this.id;

			newname=this.id+"-2";

			$(newname).setStyle('color','#FF9C1C');

		}

	

	});
	
});