var addthis_pub				= '[Site name]'; 
var addthis_logo			= '[add_this_logo]';
var addthis_logo_background	= 'ffffff';
var addthis_logo_color		= '201910';
var addthis_brand			= 'IUC';
var addthis_options			= 'favorites, email, delicious, google, digg, reddit, facebook, live, more';

CD3.Behaviors({
	'body': {
		'focus:in': {
			'input[type=text]': function(){
				if (this.getValue() == this.getAttribute('title')) this.setValue('');
			}
		},
		'focus:out': {
			'input[type=text]': function(){
				if (this.getValue().length == 0) this.setValue(this.getAttribute('title') || '');
			}
		}
	},
	'#text_size': function(){
		new CD3.FontSwitcher(this, 'content', {
			reset:	'.reset',
			plus:	'.plus',
			minus:	'.minus'
		});
	},
	'#bookmark': {
		mouseover: function(){
			addthis_open(this, '', location.href, addthis_pub)
		},
		mouseout: addthis_close,
		click: addthis_sendto
	},
	'#rotator_list':function(){
		new PeriodicalExecuter(Accent, 5)
	},
	'#rotator_list li:mouseover':function(){
		$('title_annonce').innerHTML 			= this.down('a').innerHTML;
		$('short_annonce').innerHTML 			= this.down('span').innerHTML;
		$('frame_image').style.backgroundImage	=  'url('+this.down('img').src+')';
		$('link_annonce').href 					= this.down('a').href;
		
		$$('#rotator_list li').each(function(all){
			all.removeClassName('selected');
		})
		this.addClassName('selected');
	}
});


function Accent(){
	var image 		= $('frame_image'),
		title		= $('title_annonce'),
		shortInfo	= $('short_annonce'),
		link 		= $('link_annonce'),
		container	= $('rotator_list'),
		current		= container.down('li.selected').removeClassName('selected'),
		selected	= (current.next('li') || container.down('li')).addClassName('selected');
		
		title.innerHTML 			= selected.down('a').innerHTML;
		shortInfo.innerHTML 		= selected.down('span').innerHTML;
		image.style.backgroundImage	=  'url('+selected.down('img').src+')';
		link.href 					= selected.down('a').href;
}



