//JavaScript
$(document).ready(
				  
				  
	function() {
		
		var meteoUrl = "/weather/";

		$.ajax({
			type: "GET",
			url: meteoUrl,
			dataType: "xml",
			success: termo_processXML
		});
		
		/* Init enter OnClick event */
		if ( $('#c_enter').length ) {
			$('#c_enter').click( loginOffice );
		}
		
		if ( $('#c_password').length ) {
			$('#c_password').keydown( function(event) {
				if (event.keyCode == '13') {
				 loginOffice();
				}
			});
		}
		
		if ( $('#c_email').length ) {
			$('#c_email').keydown( function(event) {
				if (event.keyCode == '13') {
				 loginOffice();
				}
			});
		}
		
		// Lightbox construct
		$.Lightbox.construct({
							 
			"text": {
				// For translating
				"image":        "Изображение",
				"of":           "из",
				"close":        "Закрыть",
				"closeInfo":    "You can also click anywhere outside the image to close.",
				"download":     "Download.",
				"help": {
					"close":    "",
					"interact": ""
				},
				"about": {
					"text":     "jQuery Lightbox Plugin (balupton edition)",
					"title":    "Licenced under the GNU Affero General Public License.",
					"link":     "http://www.balupton.com/projects/jquery-lightbox"
				}
			},
								 
        	"show_linkback":    false
    	});
		
		// Light box exeptions
		$('a:has(img):not([lb="ignore"])').lightbox();
		
		
		masterplan_init(); // init master plan
		
		player_init();
		
	}

);
