/*
	ical4WP: 
	by Gerald Estadieu - http://www.estadieu.com/blog/
	Licensed under the GPL
*/

/* ====================================
Event:Selectors Rules
==================================== */
var Rules = {
	'#ical_calendar_type:change':function(elt,evt){
		$$('.ical_calendar_selected').each(function(el,idx){ 
			Element.removeClassName(el,'ical_calendar_selected');
			$(el).style.display = 'none';
		});
		if($F(elt)!='Select...'){
			Element.addClassName($($F(elt)),'ical_calendar_selected');
			$($F(elt)).style.display = 'block';
		}
	  	Event.stop(evt);
  	} 
}

Event.observe(window,'load',init,false);
Event.observe(window, 'unload', unInit, false);

function init(){
  EventSelectors.start(Rules);
}

function unInit(){
	Event.unloadCache;
}
