/*
27/11/2008
Clara&Giovanni Padovani - JS application file
author: Alessandro Chinazzo
*/

window.addEvent('domready', function() {
	
	bgBottomLeft = new Element('div', { 'id' : 'bg-bottom-left' });
	bgBottomRight = new Element('div', { 'id' : 'bg-bottom-right' });
	bgBottomLeft.injectInside('content');
	bgBottomRight.injectInside('content');
	ricordaLocale = $$('#search #q').getProperty('value');
	
	$$('#search input').addEvent('focus', function() {
		if (this.value != '' && this.value == window.ricordaLocale) {
			this.setProperty('value', '');
		}
	});
	
	$$('#search input').addEvent('blur', function() {
		if (this.value == '' && this.value != window.ricordaLocale) {
			this.setProperty('value', window.ricordaLocale);
		}
	});
	
/*	$$('.month-link').addEvent('click', function(e) {
		e.stop();
		link = this.href.replace(/.*([\d][\d][\d][\d])\/([\d][\d])/, "/index.php/include/ajax-month-archive/archive/$1/$2");
		target = $(e.target);
		var myHTMLRequest = new Request.HTML({onSuccess: function(html) {
				box = target.getNext();
				box.empty('text', '');
				box.adopt(html);
				}
		});
		myHTMLRequest.get(link);
	});*/
});
