// Cooltips slider
$(document).ready(function() {
	$(".cooltips").easySlider({
		auto: true,
		continuous: true,
		pause: 6000,
		prevId: 'cooltipprev',
		nextId: 'cooltipnext',
 		prevText: '',
		nextText: ''
	});
});

$(function() {

	// browser check
	if (jQuery.browser.mozilla && jQuery.browser.version < "1.9") {
		$("#browser_warning").css("display", "block")
	}

	// language selector
	$(".language_selector").click(function() {
		var lang = this.value;
		var url = document.location.href;
		if (-1 !== url.indexOf("?")) url = url.substr(0, url.indexOf("?"));
		url = url + "?lang=" + lang;
		if (url.toLowerCase() !== document.location.href.toLowerCase() && url.toLowerCase().replace("?lang=nl", "") !== document.location.href.toLowerCase()) document.location = url;
	});

	// current language selection
	var url = document.location.href;
	if (-1 !== url.indexOf("=")) {
		var current_lang = url.substr(url.indexOf("=") + 1).toLowerCase();
		$(".language_selector").val(current_lang);
	}

	// links from package to hotels should stay in the same language
	$(".package .detail a").each(function() {
		if (-1 < $(this).attr("href").indexOf("/hotel") && -1 == $(this).attr("href").indexOf("?lang=")) {
			lang = "nl";
			if (-1 < document.location.href.indexOf("?lang=")) lang= document.location.href.split("?lang=")[1];
			$(this).attr("href", $(this).attr("href") + "?lang=" + lang);
		}
	});


	$("#search-button").click(function() {
		document.location = "/zoeken/" + $("#search-text").val() + "?lang=" + $(".language_selector").val();
	});

	$("#search-text").keypress(function(e) {
		if (13 === e.which) {
			$("#search-button").click();
			return false;
		}
	});

	Navigation.select($(".content").attr("data-section"));

	Calendar.setDefaults();
	Calendar.init();

	$(".hotels-filter .filter input").click(function() {
		filterHotels(1, 1);		
	});
	$(".accommodations-filter .filter input").click(function() {
		filterAccommodations(1, 1);		
	});

	$(".upload-button").click(function() {
		$(".photo-background").css("height", $(document).height());
		$(".photo-upload").show();
		$(".photo-upload-content").css("left", (($(window).width() / 2) - ($(".photo-upload-content").width() / 2)) + "px");
		$(".photo-upload-content").css("top", (($(window).height() / 2) - ($(".photo-upload-content").height() / 2)) + "px");
	});

	$(".photo-upload-cancel").click(function() {
		$(this).parents(".photo-upload").hide();
	});

	$(".photos a:not(.upload-button)").click(function() {

		$("<div class='photo-layer'><div class='photo-background'></div><div class='photo-popup' ><img class='prev' alt='' src='/images/slider_blank.png' /><img class='next' alt='' src='/images/slider_blank.png' /><div class='photo-close'></div><img src='' /><h3 class='photo-creator'></h3><h4 class='photo-location'></h4><div><div class='photo-desc'></div><div></div>").appendTo("body");

		$(".photo-popup img:not(.prev):not(.next)").attr("src", $(this).attr("href"));
		$(".photo-popup").attr("id", "popup-" + $(this).parent().attr("id"));
		$(".photo-popup .photo-desc").html($(this).attr("data-desc"));
		$(".photo-popup .photo-creator").html($(this).attr("data-creator"));
		$(".photo-popup .photo-location").html($(this).attr("data-location"));

		var top = 200; // (($(window).height() / 2) - ($(".photo-popup").height() / 2));
		if (0 > top) top = 0;
		$(".photo-popup").css("left", (($(window).width() / 2) - ($(".photo-popup").width() / 2)) + "px");
		$(".photo-popup").css("top", top + "px");
		$(".photo-background").css("height", $(document).height());

		//$(".photo-popup").shadow({ width:5, startOpacity:60, endOpacity:10, cornerHeight:8, color:"#000000"});

		$(".photo-close").click(function() {
			$(".photo-layer").remove();
		});

		$(".photo-popup .prev").click(function() {
			var $curr = $("#" + $(".photo-popup").attr("id").replace("popup-", "") + " a");
			var $prev = $curr.parent().prev().find("a");

			if (null == $prev.html()) {
				$prev = $($curr.parent().nextAll()[$curr.parent().nextAll().size() -1]).find("a");
			}

			if (null != $prev.html()) {
				$(".photo-popup img:not(.prev):not(.next)").attr("src", $prev.attr("href"));
				$(".photo-popup").attr("id", "popup-" + $prev.parent().attr("id"));
				$(".photo-popup .photo-desc").html($prev.attr("data-desc"));
				$(".photo-popup .photo-creator").html($prev.attr("data-creator"));
				$(".photo-popup .photo-location").html($prev.attr("data-location"));
			}
		});
		
		$(".photo-popup .next").click(function() {
			var $curr = $("#" + $(".photo-popup").attr("id").replace("popup-", "") + " a");
			var $next = $curr.parent().next().find("a");

			if (null == $next.html()) {
				$next = $($curr.parent().prevAll()[$curr.parent().prevAll().size() -1]).find("a");
			}

			if (null != $next.html()) {
				$(".photo-popup img:not(.prev):not(.next)").attr("src", $next.attr("href"));
				$(".photo-popup").attr("id", "popup-" + $next.parent().attr("id"));
				$(".photo-popup .photo-desc").html($next.attr("data-desc"));
				$(".photo-popup .photo-creator").html($next.attr("data-creator"));
				$(".photo-popup .photo-location").html($next.attr("data-location"));
			}
		});
		
		$(".photo-background").click(function() {
			$(".photo-layer").remove();
		});		

		
		return false;
	});

	// remove zoover border
	window.setTimeout(function() {
		if (0 < $(".reviews div").size()) {
			$($(".reviews div")[0]).css("border", "");
			$("#GadgetTitle").html($("#GadgetTitle").html().replace("Waardering ", "").replace("Appreciation ", "").replace("Gesamtwertung ", "").replace("Apreciación ", "").replace("Valutazione dei viaggiatori: ", "").replace("Värdering ", ""));
		}
	}, 1000);

});

function filterHotels(page, seed) {
	$("<div class='hotels-progress' ><div>").appendTo("body");
	var p = findPos($(".hotel-list")[0]);
	var pX = p[0];
        var pY = p[1];
        $(".hotels-progress").css({left: pX, top: pY, width: 730, height: 200});

	if (page == undefined) page = 1;
	if (seed == undefined) seed = Math.ceil(Math.random()*65000);

	var url = "/hotellijst";
	var params = "lang=" + $(".content").attr("data-language")
                + "&page=" + page
		+ "&seed=" + seed
		+ "&zwembad=" + $(".filter input#zwembad:checked").size()
		+ "&internet=" + $(".filter input#internet:checked").size()
		+ "&restaurant=" + $(".filter input#restaurant:checked").size()
		+ "&bar=" + $(".filter input#bar:checked").size()
		+ "&terras=" + $(".filter input#terras:checked").size()
		+ "&parkeren=" + $(".filter input#parkeren:checked").size()
		+ "&lift=" + $(".filter input#lift:checked").size()
		+ "&huisdieren=" + $(".filter input#huisdieren:checked").size()
		+ "&allin=" + $(".filter input#allin:checked").size()
		+ "&castle=" + $(".filter input#castle:checked").size()
		+ "&brabant=" + $(".filter input#brabant:checked").size()
		+ "&shertogenbosch=" + $(".filter input#shertogenbosch:checked").size()
		+ "&veluwe=" + $(".filter input#veluwe:checked").size()
		+ "&arnhem=" + $(".filter input#arnhem:checked").size()
		+ "&nijmegen=" + $(".filter input#nijmegen:checked").size()
		+ "&rivierenland=" + $(".filter input#rivierenland:checked").size()
		+ "&maasduinen=" + $(".filter input#maasduinen:checked").size()
		+ "&peelenmaas=" + $(".filter input#peelenmaas:checked").size()
		+ "&maasplassen=" + $(".filter input#maasplassen:checked").size()
		+ "&kleve=" + $(".filter input#kleve:checked").size()
		+ "&wesel=" + $(".filter input#wesel:checked").size()
		+ "&viersen=" + $(".filter input#viersen:checked").size()
		+ "&krefeld=" + $(".filter input#krefeld:checked").size()
		+ "&duisburg=" + $(".filter input#duisburg:checked").size()
		+ "&neuss=" + $(".filter input#neuss:checked").size()
		+ "&middenlimburg=" + $(".filter input#middenlimburg:checked").size();

	$.ajax({
		type: "GET",
		data: params,
		url: url,
		cache: false,
		dataType: "html",
		success: function(response) {
			$(".hotel-list").html(response);

			Map.clearPins();
			Map.showCurrentHotels();

			$(".hotels-progress").remove();
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
			//alert(textStatus);
		}
	});
}

function filterAccommodations(page, seed) {
	$("<div class='hotels-progress' ><div>").appendTo("body");
	var p = findPos($(".hotel-list")[0]);
	var pX = p[0];
        var pY = p[1];
        $(".hotels-progress").css({left: pX, top: pY, width: 730, height: 200});

	if (page == undefined) page = 1;
	if (seed == undefined) seed = Math.ceil(Math.random()*65000);

	var url = "/accommodatielijst";
	var params = "lang=" + $(".content").attr("data-language")
                + "&page=" + page
		+ "&seed=" + seed
		+ "&hotel=" + $(".filter input#hotel:checked").size()
		+ "&camping=" + $(".filter input#camping:checked").size()
		+ "&bnb=" + $(".filter input#bnb:checked").size()
		+ "&bungalowpark=" + $(".filter input#bungalowpark:checked").size()
		+ "&vakantiewoning=" + $(".filter input#vakantiewoning:checked").size()
		+ "&kampeerboerderij=" + $(".filter input#kampeerboerderij:checked").size()
		+ "&kasteel=" + $(".filter input#kasteel:checked").size()
		+ "&overig=" + $(".filter input#overig:checked").size()
		+ "&brabant=" + $(".filter input#brabant:checked").size()
		+ "&shertogenbosch=" + $(".filter input#shertogenbosch:checked").size()
		+ "&veluwe=" + $(".filter input#veluwe:checked").size()
		+ "&arnhem=" + $(".filter input#arnhem:checked").size()
		+ "&nijmegen=" + $(".filter input#nijmegen:checked").size()
		+ "&rivierenland=" + $(".filter input#rivierenland:checked").size()
		+ "&maasduinen=" + $(".filter input#maasduinen:checked").size()
		+ "&peelenmaas=" + $(".filter input#peelenmaas:checked").size()
		+ "&maasplassen=" + $(".filter input#maasplassen:checked").size()
		+ "&kleve=" + $(".filter input#kleve:checked").size()
		+ "&wesel=" + $(".filter input#wesel:checked").size()
		+ "&viersen=" + $(".filter input#viersen:checked").size()
		+ "&krefeld=" + $(".filter input#krefeld:checked").size()
		+ "&duisburg=" + $(".filter input#duisburg:checked").size()
		+ "&neuss=" + $(".filter input#neuss:checked").size()
		+ "&middenlimburg=" + $(".filter input#middenlimburg:checked").size();

	$.ajax({
		type: "GET",
		data: params,
		url: url,
		dataType: "html",
		success: function(response) {
			$(".hotel-list").html(response);

			Map.clearPins();
			Map.showCurrentHotels();

			$(".hotels-progress").remove();
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
			//alert(textStatus);
		}
	});
}

var Navigation = {
	"select":function(item) {
		if (item) {
			$("." + item).addClass("selected");
		}
	}
};

$(function() {
	$("#calendar-year").change(function() {
		Calendar.year = $(this).val();
		Calendar.init();
	});

	$("#calendar-month").change(function() {
		Calendar.month = $(this).val();
		Calendar.init();
	});

	$(".calendar-prev").click(function() {
		if ("1" !== $("#calendar-month").val()) {
			$("#calendar-month").val(parseInt($("#calendar-month").val()) - 1);
		} else {
			$("#calendar-month").val(12);
			$("#calendar-year").val(parseInt($("#calendar-year").val()) - 1);
		}
	
		Calendar.month = $("#calendar-month").val();
		Calendar.year = $("#calendar-year").val();
		Calendar.init();
	});

	$(".calendar-next").click(function() {
		if ("12" !== $("#calendar-month").val()) {
			$("#calendar-month").val(parseInt($("#calendar-month").val()) + 1);
		} else {
			$("#calendar-month").val(1);
			$("#calendar-year").val(parseInt($("#calendar-year").val()) + 1);
		}

		Calendar.month = $("#calendar-month").val();
		Calendar.year = $("#calendar-year").val();
		Calendar.init();
	});

});

var Calendar = {
	"month":1,
	"year":1970,
	"row":null,
	"setDefaults":function() {
		$("#calendar-month").val(new Date().getMonth() + 1);
		$("#calendar-year").val(new Date().getFullYear());

		Calendar.month = $("#calendar-month").val();
		Calendar.year = $("#calendar-year").val();
	},
	"init":function() {


		if (0 == $(".calendar").size()) return;

		$("<div class='calendar-progress' ><div>").appendTo("body");
		var p = findPos($(".calendar")[0]);
		var pX = p[0];
	        var pY = p[1];
	        $(".calendar-progress").css({left: pX, top: pY, width: 220, height: 250});
	
		var url = "/kalender";
		var params = "jaar=" + Calendar.year + "&maand=" + Calendar.month + "&lang=" + $(".calendar").attr("data-language");

		$.ajax({
			type: "GET",
			data: params,
			url: url,
			dataType: "html",
			success: function(response) {
				$(".calendar table tbody").html(response.substr(response.indexOf(">") + 1).replace("</table>", ""));

				$(".calendar td.events").click(function(event) {
					if ("1" == $("#calendar-tooltip-" + this.innerHTML).attr("data-fix")) {
						$("#calendar-tooltip-" + this.innerHTML).attr("data-fix", "0");
					} else {
						$("#calendar-tooltip-" + this.innerHTML).attr("data-fix", "1");
					}
				});
				$(".calendar td.events").mouseover(function(event) {
					if (0 == $("#calendar-tooltip-" + this.innerHTML).size()) {
						$(".calendar-tooltip").remove();
						if ($(".calendar").parent().hasClass("right")) {
							$("<div class='calendar-tooltip' id='calendar-tooltip-" + this.innerHTML + "'><div class='calendar-rightpointer'></div>" + $(this).attr("data-eventlist") + "</div>").appendTo("body");
						} else {
							$("<div class='calendar-tooltip' id='calendar-tooltip-" + this.innerHTML + "'><div class='calendar-leftpointer'></div>" + $(this).attr("data-eventlist") + "</div>").appendTo("body");
						}
						var pos = findPos(this);
						var posX = pos[0] + 25;
					        var posY = pos[1] - 50;
						if ($(".calendar").parent().hasClass("right")) posX = pos[0] - $("#calendar-tooltip-" + this.innerHTML).width() - 60;
					        $("#calendar-tooltip-" + this.innerHTML).css({left: posX, top: posY});

						$(".calendar-tooltip").click(function(event) {
							$(this).attr("data-fix", "0");
						});
						$(".calendar-tooltip").mouseout(function(event) {
							if (0 == $(this).attr("data-fix")) {
								$(this).remove();
							}
						});
					}
				});
				$(".calendar td.events").mouseout(function(event) {
					if ("1" != $("#calendar-tooltip-" + this.innerHTML).attr("data-fix")) {
						$("#calendar-tooltip-" + this.innerHTML).remove();
					}
				});
				$(".calendar-progress").remove();
			},
			error: function(XMLHttpRequest, textStatus, errorThrown) {
				//alert(textStatus);
			}
		});
	}
};

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	return [curleft,curtop];
}

function CloseOverlay(element)
{
	if(typeof(element) != 'object') {
		$("#" + element).hide();
	} else {
		element.hide();
	}
}

jQuery(function($) {
	if (0 < $('.slider').length) {

		$('.slider .prev').hide();
		$('.slider .next').hide();

		// bug in jquery 1.3.2, selector :has :gt returns 0 items
		//		$('.slider:has(.sections li:gt(2))').find('.next').show();
		$('.slider').each(function() {
			if (1 < $(this).find("li").size()) $(this).find('.next').show();
		});

		$('.slider').serialScroll({
			target: '.slider-content',
			items: 'li',
			prev: 'img.prev',
			next: 'img.next',
			axis: 'x',
			duration: 700,
			force: true,
			exclude: 0,
			cycle: false,
			step: 1,
			lazy: true,

			onBefore: function(e, elem, $pane, $items, pos) {
				// hide arrows at limits
				var $prev = $pane.parent().find('.prev'),
						$next = $pane.parent().find('.next');

				$prev.add($next).show();
				if (pos == 0)
					$prev.hide();
				else if (pos == $items.length - 1)
					$next.hide();

				e.preventDefault();
				if (this.blur)
					this.blur();
			},
			onAfter: function(elem) {
				//'this' is the element being scrolled ($pane) not jqueryfied
			}
		});
	}
});

function highlight(id, location, type, header, image, text, url, more, region) {
	this.id = id;
	this.location = location;
	this.type = type;
	this.header = header;
	this.image = image;
	this.text = text;
	this.url = url;
	this.more = more;
	this.mapid = 0;
	this.region = region;
}

var mapZoomTimeout;

var Map = {
	"map":null,
	"lat":52,
	"lon":6,
	"zoom":10,
	"finalZoomLevel":10,
	"highlights":new Array(),
	"init":function(item, newZoomLevel) {
		$(".map-legend input:checked").attr('checked', false);

		try {
			map = new VEMap('mymap');
		} catch (e) {}
		if (undefined === map) return;
		
		if(newZoomLevel !== undefined) Map.zoom = newZoomLevel;

		map.SetDashboardSize(VEDashboardSize.Tiny);
		map.AttachEvent("onmousewheel", function() { return true; });
		map.LoadMap();
		map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers); 
		map.SetCenterAndZoom(new VELatLong(Map.lat, Map.lon), Map.zoom -1);
		//map.ZoomIn();
		map.ShowMessageBox = false;

		//Map.showCurrentHotels();

		$(".map-legend input").click(function() {
			//var shape = map.GetShapeByID();
			//map.DeleteShape(shape);

			for (i = 0; i < Map.highlights.length; i++) {
				var h = Map.highlights[i];
				$("#" + h.mapid).addClass("pin_" + h.type);
			}

			if ($(this).attr("checked") && 1 < $(this).parent().parent().find("input:checked").size()) {
				type = $(this).attr("value");
				Map.showHighlights("", type);
			} else {
				var type = "";
				$(this).parent().parent().find("input:checked").each(function(e) {
					type += ";" + $(this).attr("value");
				});

				Map.clearPins();
				Map.showHighlights("", type);
			}
		});
	},
	"clearPins":function() {
		map.DeleteAllShapes();
	},
	"zoomIn":function() {
	         map.ZoomIn();
	},
	"setCenter":function(center) {
		map.SetCenter(center);
	},
	"startZoomIn":function() {
			var currentZoomLevel;
			if(map != null) {
				currentZoomLevel = map.GetZoomLevel();
			} else {
				currentZoomLevel = Map.zoom;
			}
			if(currentZoomLevel < Map.finalZoomLevel) {
				// Start the timeout
				Map.zoomIn();
				Map.zoom++;
				mapZoomTimeout = setTimeout("Map.startZoomIn();", 900);
			}
			else {
				// Stop the timeout
				clearTimeout(mapZoomTimeout);
				Map.showHighlights();
			}
	},
	"addPin":function (lat, lon, icon, header, infobox, type) {
		var shape = new VEShape(VEShapeType.Pushpin, new VELatLong(lat, lon));

		//Set the icon
		shape.SetCustomIcon(icon);
		shape.SetTitle("<h2>" + header + "</h2>");
		shape.SetDescription(infobox);
		//Set the info box
		//map.ClearInfoBoxStyles();
		//if ("" !== header) { shape.SetTitle("<h2>" + header + "</h2>"); }
		//if ("" !== infobox) { shape.SetDescription(infobox); }

		//Add the shape the the map
		map.AddShape(shape);
		return shape.GetID();
	},
	"addItem":function (location, type, header, image, text, url, center, more, target) {
		var icon_file = "/images/pin_" + type + ".png";
		var icon = "<div><img src='" + icon_file + "' alt='pin' /></div>";
		var infobox = "";
		
		if ("" !== text) {
			infobox += "<img src='" + image+ "' alt='' /><p>"
				  + text + "</p>";
		}
		if ("" !== url) {
			infobox += "<p class='details'><a href='" + url + "' target='" + target + "'>" + more + "</a></p>";
		}

		map.Find(null, location, VEFindType.Businesses, null, null, null, false, false, false, false,
			function(layer, resultsArray, places, hasMore, veErrorMessage) {
				if (null != places) {
					if (center)
					{
						map.SetCenter(places[0].LatLong);
						map.SetZoomLevel(Map.zoom);
					}
					id = Map.addPin(places[0].LatLong.Latitude, places[0].LatLong.Longitude, icon, header, infobox, type);
				} else {
					//alert("no results! " + veErrorMessage);
				}
			}
		);
	},
	"addItemH":function(h) {

		var icon_file = "/images/pin_" + h.type + ".png";
		var icon = "<div><img src='" + icon_file + "' alt='pin' /></div>";
		var infobox = "";
		if ("" !== h.text) {
			infobox += "<img src='" + h.image+ "' alt='' /><p>"
				  + h.text + "</p>";
		}
		if ("" !== h.url) {
			infobox += "<p class='details'><a href='" + h.url + "'>" + h.more + "</a></p>";
		}

		map.Find(null, h.location, VEFindType.Businesses, null, null, null, false, false, false, false,
			function(layer, resultsArray, places, hasMore, veErrorMessage) {
				if (null != places) {
					id = Map.addPin(places[0].LatLong.Latitude, places[0].LatLong.Longitude, icon, h.header, infobox, h.type);
					h.mapid = id;
				} else {
					//alert("no results! " + veErrorMessage);
				}
			}
		);
	},
	"addHighlight":function (id, location, type, header, image, text, url, more, region) {
		var h = new highlight(id, location, type, header, image, text, url, more, region);
		Map.highlights[Map.highlights.length] = h;
	},
	"showHighlights":function(theme, type) {
		for (i = 0; i < Map.highlights.length; i++) {
			var h = Map.highlights[i];
			if ("" != h.location && (undefined == type || "" == type || -1 != type.indexOf(h.type))) {
				Map.addItemH(h);
			}
		}
	},
	"addHighlightIcon":function (location, type, header, image, text) {
		if ("" != location) Map.addItem(location, type, header, image, text, "", true);
	},
	"addHotelIcon":function (location) {
		if ("" != location) Map.addItem(location, "hotel", "", "", "", "", true);	
	},
	"showCurrentHotels":function() {
		$(".hotel-list h2").each(function(i) {
			if ("" != $(this).attr("data-location")) Map.addItem($(this).attr("data-location"), "hotel", $(this).attr("data-name"), $(this).attr("data-image"), $(this).attr("data-description"), $(this).attr("data-url"), false, $(this).attr("data-more"));	
		});
	},
	"animateShapes":function() {
		if (0 < map.GetShapeLayerCount()) {
			var layer = map.GetShapeLayerByIndex(0);

			if (0 < layer.GetShapeCount()) {
				var randomIndex = Random(layer.GetShapeCount());

				var shape = layer.GetShapeByIndex(randomIndex);
				if (undefined == shape) {
					setTimeout(Map.animateShapes, 10);
				} else {
					var location = shape.GetPoints()[0];
					map.PanToLatLong(new VELatLong(location.Latitude, location.Longitude + 1.25));  // 0.69
					setTimeout(function(){Map.animateShapes2(shape)}, 2000);
				}
			} else {
				setTimeout(Map.animateShapes, 2000);
			}
		}
	},
	"animateShapes2":function(shape) {
		map.ShowInfoBox(shape);
		setTimeout(Map.animateShapes, 10000);
	}
};

function Random(r) { 
	return Math.ceil(Math.random()*r);
}

function daysInMonth(month, year)
{
	return 32 - new Date(year, month - 1, 32).getDate();
}

function ShowHideVideo(id) 
{
	//hide videos
	$(".videos").hide();
	$("#videowindow").empty()
	$("#ytvideo" + id).clone().appendTo($("#videowindow")).show();
}

var Lst;

function SelectedVideoLink(obj){
	if (Lst) Lst.className='';
	obj.className='selected';
	Lst=obj;
}
