var JV_Weather = new Class({

	initialize: function(myElements) {
		options = Object.extend({			
			transition: Fx.Transitions.quadOut
		}, {});
			
		if(!exModules) var exModules = [];
		
		myElements.each(function(el){
			el = this.getDeepestDiv(el);
			var title = $E('H3', el);
			var title_weather_location = '';
			title_weather_location = $('jv-location-show').innerHTML;
			if (!title) return;
			if (title.parentNode.tagName == "LI") return;
			el._id = title.innerHTML.trim().replace (' ', '_');

			if (exModules.contains(el._id)) {
				return;
			}
			var myul = el.getElements('ul');
			var array_ul = new Array();
			myul.each(function(item,index){
				if(item.hasClass('jv-weather-location') == true) {
					title.innerHTML = title_weather_location;
				}
			});

		}, this);
	},

	getDeepestDiv: function (div) {
		while (div.getChildren().length && (div.getChildren()[0].tagName == 'DIV'))
		{
			div = div.getChildren()[0];
		}
		return div;
	}
});

window.addEvent ('domready', function(e){
	var jv_weather = new JV_Weather ($ES('.module', $('jv-colwrap')));
});
