

var WhereToBuy = {
	TabContainerObject: function() {
		return $find(PageIDs.TabContainer);
	},
	TabContainerElement: function() {
		return $('#' + PageIDs.TabContainer).get(0);
	},
	TabElementObject: function() {
		return $find(PageIDs.TabWhereToBuy);
	},
	TabElementContext: function() {
		return $('#' + PageIDs.TabWhereToBuy);
	},
	Activate: function() {
		this.TabContainerObject().set_activeTab(this.TabElementObject());
		this.TabContainerElement().scrollIntoView(true);
	}
}

var Krillion = {
	HasProduct: function(_productId) {
		var retValue = false;
		
		jQuery.ajax(
			{
				type: "post",
				url: "krillionservice.asmx/ConfirmProduct",
				contentType: "application/json",
				data: jQuery.toJSON(
					{
						productId: "" + _productId
					}
				),
				dataType: "json",
				async: false,
				cache: false,
				success: function (data) {
					retValue = data.d;
				}/*,
				error: function (XMLHttpRequest, textStatus, errorThrown) {},
				complete: function (XMLHttpRequest, textStatus) {}*/
			}
		);
		
		return retValue;
	},
	GetProductAsync: function(_productId, _zipCode, _callback) {
		jQuery.ajax(
			{
				type: "post",
				url: "krillionservice.asmx/GetAvailableRetailers",
				contentType: "application/json; charset=utf-8",
				data: jQuery.toJSON(
					{
						productId: "" + _productId,
						zipCode: "" + _zipCode
					}
				),
				dataType: "json",
				async: true,
				cache: false,
				success: function (data) {
					_callback(data);
				}/*,
				error: function (XMLHttpRequest, textStatus, errorThrown) {}*/,
				complete: function (XMLHttpRequest, textStatus) { KrillionUI.LoadingIndicator.Hide(); }
			}
		);
	}
}

var KrillionUI = {
	ShowAll: true,
	JSONObject: null,
	ProductId: null,
	ZipCode: null,
	NumRetailers: 0,
	Init: function() {
		GMarker.prototype.IconIndex = -1;
		GMarker.prototype.location = null;
		GMarker.prototype.retailerIndex = null;
		GMarker.prototype.locationIndex = null;
	},
	AddRetailer: function(inventoryItem, filter, itemNum) {
		var location = null;
		//var html = "<table class=\"retailer\" style=\"" + (this.NumRetailers == 0 ? "" : "border-top: none;") + "\">";
		var html = "<ul class=\"wtb-listing\">";		

		var x = 0;
		do {
			if(x >= inventoryItem.LocationsWithAvailability.LocationAvailabilityList.length) return false;
			
			location = inventoryItem.LocationsWithAvailability.LocationAvailabilityList[x++]
		} while(filter == "1" && location.Availability.Status != "in_stock" && location.Availability.ProductBuyUrl.Type != "buyOnline");
		x--; //point to current location
		
		var numLoc = inventoryItem.LocationsWithAvailability.LocationAvailabilityList.length;
		if(filter == "1") {
			numLoc = 0;
			for(var i = x; i < inventoryItem.LocationsWithAvailability.LocationAvailabilityList.length; i++)
				if(!(location.Availability.Status != "in_stock" && location.Availability.ProductBuyUrl.Type != "buyOnline")) numLoc++;
		}
		
		for(var i = x; i < inventoryItem.LocationsWithAvailability.LocationAvailabilityList.length; i++) {
			if(filter == "1" && location.Availability.Status != "in_stock" && location.Availability.ProductBuyUrl.Type != "buyOnline") continue;
			
			//var xp = "inventoryItem[@index=" + inventoryItem.Index + "]/locationsWithAvailability/locationWithAvailability[@index=" + location.Index + "]";
			
			var status = { imgsrc: null, row1: null, row2: null, row3: null };
			status.imgsrc = "";
			if(location.Availability.Status == "in_stock") status.row1 = "Available";
			else if(location.Availability.Status != "in_stock" && location.Availability.ProductBuyUrl.Type == "buyOnline") {
				status.row1 = "Available Online";
				
				if(location.Availability.Status == "out_of_stock" || location.Availability.Status == "ship_to_store")
					status.row2 = "Out-Of-Stock Locally";
				if(location.Availability.Status != "ship_to_store")
					status.row3 = "<b>Ship to Store</b> Delivery Available";
			} else {
				//location.Availability.Status == "unknown" etc.
				status.row1 = "Contact Store";
				status.imgsrc = "";
			}
			
			var statustxt = "<table><tr><td style=\"vertical-align: middle;\"><img src=\"" + status.imgsrc + "\" style=\"vertical-align: top;\" alt=\"\" /></td>" + 
				"<td style=\"vertical-align: middle;\"><b style=\"color: darkgray;\">" + status.row1 + "</b><br />" + 
				(status.row2 == null ? "" : "<span style=\"color: gray;\">" + status.row2 + "</span>") + 
				"</td></tr></table>" + 
				(status.row3 == null ? "" : "<div style=\"font-size: 90%; color: darkgray; clear: both; margin-top: 15px;\">" + status.row3 + "</div>");
			
			var hasStoreNumber = (location.Location.Address.StoreNumber && location.Location.Address.StoreNumber != '' && location.Location.Address.StoreNumber != null && location.Location.Address.StoreNumber != undefined);
			var hasStoreCode = (location.Location.StoreCode && location.Location.StoreCode != '' && location.Location.StoreCode != null && location.Location.StoreCode != undefined);
			
			var rowId = (hasStoreNumber ? location.Location.Address.StoreNumber : (hasStoreCode ? location.Location.StoreCode : ""));
			var retailerName = (hasStoreNumber ? inventoryItem.Retailer.Name : inventoryItem.Retailer.Code);
			if((retailerName == null || retailerName.length == 0) && inventoryItem.Retailer.Name && inventoryItem.Retailer.Name.length > 0)
				retailerName = inventoryItem.Retailer.Name;
			
			html += 	"<li" + (i > x ? " class=\"wtb-add additionallocation forceprint hide\"" : "") + ((rowId.length > 0) ? (" class=\"wtb-norm\" id=\"rr_" + escape(rowId) + "\"") : "") + ">" +
							"<div class=\"wtb-listing-img\">" + (inventoryItem.Retailer.LogoUrl == null || i > x ? "" : "<img src=\"" + inventoryItem.Retailer.LogoUrl + "\" style=\"width: 65px; height: 65px;\" alt=\"" + inventoryItem.Retailer.AttributeName + "\" />") + "</div>" +
							"<div class=\"wtb-listing-left\">" +
								"<h3>" + location.Location.Address.StoreName + ((location.Location.Address.StoreLabel != null && location.Location.Address.StoreLabel.length > 0) ? " - " + location.Location.Address.StoreLabel : "") + "</h3>" +
								"<p>" +	location.Location.Address.Street1 + "<br />" + location.Location.Address.City + ", " + location.Location.Address.State + " " + location.Location.Address.Zip + "<br />" + location.Location.Phone + "</p>" +
								"<p>" + (location.Location.StoreUrl && location.Location.StoreUrl.length > 0 ? "<a class=\"link-blue\" href=\"" + location.Location.StoreUrl + "\" target=\"_blank\">Visit the " + location.Location.Address.StoreName + " website></a>" : "") + "</p>" +
								"<p>" + "<img class=\"marker\" src=\"\" alt=\"\" style=\"display: none;\" />Distance to the location - " + location.Location.Distance + " mi</span></p>" +
							(i == x && numLoc-1 > x ?
								"<p" + ((hasStoreNumber || hasStoreCode) ? (" id=\"rr_" + escape(rowId) + "_toggle\"") : "") + ">" + 
									"<span class=\"section" + (i > x ? " topborder" : "") + " noprint\"><a id=\"toggleretailer-" + itemNum + "\" href=\"javascript:void(0)\" onclick=\"KrillionUI.ToggleRetailer(this);dd_cancel(); return false;\">[+] Click to view " + (numLoc-1) + " more " + location.Location.Address.StoreName + " locations</a></span>" + 
								"</p>"
								:
									""
								) +								
							"</div>" +
							"<div class=\"wtb-listing-right\">" +
								"<div class=\"wtb-menu\">" +
								(rowId.length > 0 && retailerName && retailerName.length > 0 ?
									"<ul>" +
										"<li><a href=\"javascript:void(0)\" onclick=\"StarmindModal.Create('modalMail" + itemNum + i + "',{ type: 'iframe', fixed: true, closeLayer: true, iattr: { src: 'share_wtbproduct.aspx?t=email&id=wtb&productPageUrl=" + escape(PageData.RawUrl) + "&productId=" + PageData.ProductId + "&retailer=" + escape(retailerName) + "&storenumber=" + escape(rowId) + "' }, pattr: { style: 'width:580px; height:530px;'}, lattr: Settings.Modal.LayerAttr}).Open(true); EventCancel(event); return false;\">Email A Friend</a></li>" +
										"<li><a href=\"javascript:void(0)\" onclick=\"StarmindModal.Create('modalCell" + itemNum + i + "',{ type: 'iframe', fixed: true, closeLayer: true, iattr: { src: 'share_wtbproduct.aspx?t=texttocell&id=wtb&productPageUrl=" + escape(PageData.RawUrl) + "&productId=" + PageData.ProductId + "&retailer=" + escape(retailerName) + "&storenumber=" + escape(rowId) + "' }, pattr: { style: 'width:580px; height:530px;'}, lattr: Settings.Modal.LayerAttr}).Open(true); EventCancel(event); return false;\">Text To Cell</a></li>" +
										"<li class=\"last\"><a href=\"javascript:void(0)\">View Map</a></li>" +
									"</ul>"
								:
									"") +
								"</div>" +
							"</div>" +
							"<div class=\"clear\"></div>" +
						"</li>";

				/*		alert("<li" + (i > x ? " style=\"background:red\" class=\"wtb-add additionallocation forceprint hi-de\"" : "") + ((rowId.length > 0) ? (" style=\"background:lightblue\" class=\"wtb-norm\" id=\"rr_" + escape(rowId) + "\"") : "") + ">");
						
						alert(								"<p" + ((hasStoreNumber || hasStoreCode) ? (" id=\"rr_" + escape(rowId) + "_toggle\"") : "") + ">" + 
									"<span class=\"section" + (i > x ? " topborder" : "") + " noprint\"><a id=\"toggleretailer-" + itemNum + "\" href=\"javascript:void(0)\" onclick=\"KrillionUI.ToggleRetailer(this); return false;\">[+] Click to view " + (numLoc-1) + " more " + location.Location.Address.StoreName + " locations</a></span>" + 
								"</p>");
						
				*/					

				//data=\"" + $.toJSON({ num : (inventoryItem.LocationsWithAvailability.LocationAvailabilityList.length - 1), storeName: location.Location.Address.StoreName }).replace(/\"/g,"|!|") + "\"
			
			//next
			location = inventoryItem.LocationsWithAvailability.LocationAvailabilityList[i+1];
		}
		html += "</ul>";
		
		$("#wtb_retailers").append(html);
		
		this.NumRetailers++;
		
		return true;
	},
	UpdateProduct: function(data) {
		var num = 0;
		if(!(data.d.Response == null || data.d.Response.InventoryItems == null || data.d.Response.InventoryItems.InventoryItemList == null)) {
			num = data.d.Response.InventoryItems.InventoryItemList.length;
		}
		$("#wtb_results").html("<div class=\"line m-b10px\"></div><div class=\"m-b10px\"><strong>" + num + "</strong> matching locations near <strong>" + KrillionUI.ZipCode + "</strong></div>");
		$("#wtb_results").show();
	
		if(data.d.Response == null || data.d.Response.InventoryItems == null || data.d.Response.InventoryItems.InventoryItemList == null || data.d.Response.InventoryItems.InventoryItemList.length == 0) return;
		
		this.JSONObject = data.d.Response;
		
		this.LoadingIndicator.Hide();
		this.NumRetailers = 0;
		
		$("#wtb_options").show();
		
		this.ApplyFilter($('#show_filter').attr('value'));
		this.UpdateView();
	},
	ApplyFilter: function(filter) {
		$("#wtb_retailers").html("");
		this.NumRetailers = 0;
	
		var retval = false;
		for(var i = 0; i < this.JSONObject.InventoryItems.InventoryItemList.length; i++) {
			if(this.AddRetailer(this.JSONObject.InventoryItems.InventoryItemList[i], filter, i) == true) retval = true;
		}
		
		if(retval == false) $("#wtb_retailers").html("<span style=\"font-style: italic; color: darkgray;\">No locations matching current filter...</span>");
	},
	DoUpdate: function() {
		var productId = $('#' + PageIDs.ModelD).attr("value").toLowerCase();
		var zipCode = $('#' + PageIDs.ZipCode2).attr("value").toLowerCase();//.replace(/\s+/g, '');
		if(productId != "" && this.ValidateZip(zipCode) && KrillionUI.ZipCode != zipCode) {
			KrillionUI.ProductId = productId;
			KrillionUI.ZipCode = zipCode;
			KrillionUI.ShowAll = true;
			KrillionUI.SetShowAllLabel($("#wtb_expandAll").get()[0]);
			$('#show_filter').attr("value", "0");
			KrillionUI.ResetView();
			KrillionUI.LoadingIndicator.Show();
			Krillion.GetProductAsync(KrillionUI.ProductId, KrillionUI.ZipCode, function(data) { KrillionUI.UpdateProduct(data); });
		}
	},
	ValidateZip: function(zip) {
		if(/^[0-9]{5}([- \/]{0,1}[0-9]{4})?$/.test(zip) == true) {
			$('#user_zipCode2_error').hide();
			return true;
		} else {
			$('#user_zipCode2_error').show();
			return false;
		} 
	},
	ToggleAllRetailers: function(obj) {
		var al = $('.retailer a.toggleretailer');
		al.each(function() {
			KrillionUI.ToggleRetailer(this, KrillionUI.ShowAll);
		});
		KrillionUI.ShowAll = (KrillionUI.ShowAll != true);
		KrillionUI.SetShowAllLabel(obj);
	},
	SetShowAllLabel : function(obj) {
		if(!KrillionUI.ShowAll)
			obj.innerHTML = "Collapse All";
		else
			obj.innerHTML = "Expand All";
	},
	ToggleRetailer: function(link, show) {
		//var parameters = $.secureEvalJSON(link.getAttribute("data").replace(/\|!\|/g, "\""));
		var loc = this.JSONObject.InventoryItems.InventoryItemList[parseInt(link.getAttribute("id").match(/toggleretailer\-([0-9]+)/)[1])];
		var parameters = { num: (loc.LocationsWithAvailability.LocationAvailabilityList.length - 1), retailerName: loc.LocationsWithAvailability.LocationAvailabilityList[0].Location.Address.StoreName };
		var al = $(link).closest('ul').find('li.additionallocation');
		/*if(show) al.toggle(show);
		else al.toggle();*/
		
		if(show != undefined) { if(show) { al.show(); } else { al.hide(); } }
		else if(al.is(":hidden") || al.eq(0).css("display") == "none") { al.show(); } else { al.hide(); }
		
		$(link).html((al.css("display") == "none" ? "[+] Click to view " + parameters.num + " more " + parameters.retailerName + " locations" : "[-] Click to hide all " + parameters.retailerName + " locations"));
	},
	GMap: null,
	//GEOCache: null,
	//GEOCoder: null,
	CurrentView: 1,
	IconArray : ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],
	markers : null,
	ResetView: function() {
		this.GMap = null;
		GUnload();
		this.markers = null;
		$(".retailer tr").removeClass("map-selected");
		$("#map_canvas").hide();
	},
	SetView: function(id) {
		this.CurrentView = parseInt(id);
		this.UpdateView();
	},
	UpdateView: function() {
		if(this.CurrentView == 0) {
			//list view
			$("input[name=show_as]")[0].checked = true;
			$("input[name=show_as]")[1].checked = false;
			$(".retailer tr").removeClass("map-selected");
			$("#map_canvas").hide();
			$(".distance").children(".marker").hide();
		} else if(this.CurrentView == 1) {
			//map view
			$("input[name=show_as]")[0].checked = false;
			$("input[name=show_as]")[1].checked = true;
			if(GBrowserIsCompatible() && this.ZipCode != null) {
				var k = 0;
				this.markers = new Array();
				
				for(var i = 0, l = this.JSONObject.InventoryItems.InventoryItemList.length; i < l; i++) {
					for(var x = 0, l2 = this.JSONObject.InventoryItems.InventoryItemList[i].LocationsWithAvailability.LocationAvailabilityList.length; x < l2; x++) {
						var location = this.JSONObject.InventoryItems.InventoryItemList[i].LocationsWithAvailability.LocationAvailabilityList[x];
						if($('#show_filter').attr('value') == "1" && location.Availability.Status != "in_stock" && location.Availability.ProductBuyUrl.Type != "buyOnline") continue;
						
						var geo = location.Location.GeoCode;
						var lat = geo.Latitude * (180 / Math.PI), lng = geo.Longitude * (180 / Math.PI);
						this.markers[k] = this.CreateMarker(lat, lng, k, location.Location.Address.StoreName + ((location.Location.Address.StoreLabel != null && location.Location.Address.StoreLabel.length > 0) ? " - " + location.Location.Address.StoreLabel : ""));
						this.markers[k].location = location.Location;
						this.markers[k].retailerIndex = i;
						this.markers[k].locationIndex = x;
	
						k++;
					}
				}
			
				if(this.GMap == null) {
					//init map
					this.GMap = new GMap2($("#map_canvas").get()[0], { size: new GSize(parseInt($("#map_canvas").css("width")), parseInt($("#map_canvas").css("height"))) });
					var bz = this.GetMarkerBoundsAndZoom(this.markers);
					this.GMap.setCenter(bz.bounds.getCenter(), bz.zoom);
					
					//this.GEOCache = new GGeocodeCache();
					//this.GEOCoder = new GClientGeocoder(this.GEOCache);
					
					KrillionUI.GMap.setUIToDefault();
				}
				
				this.GMap.clearOverlays();
				for(var i = 0; i < this.markers.length; i++) {
					var location = this.markers[i].location;
					this.GMap.addOverlay(this.markers[i]);
					
					
					var hasStoreNumber = (location.Address.StoreNumber && location.Address.StoreNumber != '');
					var hasStoreCode = (location.StoreCode && location.StoreCode != '');
					
					var rowId = (hasStoreNumber ? location.Address.StoreNumber : (hasStoreCode ? location.StoreCode : ""));
					
					var retailerRow = $("#rr_" + escape(rowId));
					KrillionUI.BindShowMarkerInfoBox(this.markers[i], retailerRow);
					KrillionUI.BindShowSelectedRetailerRow(this.markers[i], retailerRow);
					
					KrillionUI.DisplayMarkerOnRetailer(retailerRow, this.markers[i]);
					
					var retailer = this.JSONObject.InventoryItems.InventoryItemList[this.markers[i].retailerIndex].Retailer;
					var retailerName = (hasStoreNumber ? retailer.Name : retailer.Code);
					if((retailerName == null || retailerName.length == 0) && retailer.Name && retailer.Name.length > 0)
						retailerName = retailer.Name;
					retailerName = retailerName.replace(/[^\w\s]+/, ""); //temp fix

					this.markers[i].bindInfoWindowHtml("<h3>" + location.Address.StoreName + ((location.Address.StoreLabel != null && location.Address.StoreLabel.length > 0) ? " - " + location.Address.StoreLabel : "") + "</h3><br />" + 
						location.Address.Street1 + "<br />" + 
						location.Address.City + ", " + location.Address.State + " " + location.Address.Zip + "<br />" + 
						"<b>" + location.Phone + "</b><br /><br />" + 
						(rowId.length > 0 && retailerName && retailerName.length > 0 ?
							"<a href=\"javascript:void(0)\" onclick=\"StarmindModal.Create('modalMail" + i + "',{ type: 'iframe', fixed: true, closeLayer: true, iattr: { src: 'share_wtbproduct.aspx?t=email&productId=" + PageData.ProductId + "&retailer=" + escape(retailerName) + "&storenumber=" + escape(rowId) + "' }, pattr: { style: 'width:580px; height:530px;'}, lattr: Settings.Modal.LayerAttr}).Open(true); EventCancel(event); return false;\">Email A Friend</a><br />" +
                            "<a href=\"javascript:void(0)\" onclick=\"StarmindModal.Create('modalCell" + i + "',{ type: 'iframe', fixed: true, closeLayer: true, iattr: { src: 'share_wtbproduct.aspx?t=texttocell&productId=" + PageData.ProductId + "&retailer=" + escape(retailerName) + "&storenumber=" + escape(rowId) + "' }, pattr: { style: 'width:580px; height:530px;'}, lattr: Settings.Modal.LayerAttr}).Open(true); EventCancel(event); return false;\">Text To Cell</a><br /><br />"
						:
							""
						) +
						"<span style=\"color: gray;\">Distance to the location - " + location.Distance + " mi</span>"
						);
				}
				$("#map_canvas").show();
			}
		}
	},
	DisplayMarkerOnRetailer: function(retailer, marker) {
		if(marker.IconIndex < 0) return;
		
		var m = $(retailer).find(".distance").children(".marker");
		m.attr("src", marker.getIcon().image);
		m.show();
	},
	CreateMarker: function(lat, lng, index, title) {
		var point = new GLatLng(lat, lng, false);
		
		var markerIcon = new GIcon(G_DEFAULT_ICON);
		if(index + 1 <= this.IconArray.length)
			markerIcon.image = "http://www.google.com/intl/en_ALL/mapfiles/marker"+this.IconArray[index]+".png";
		
		var marker = new GMarker(point, { title: title, icon: markerIcon });
		
		if(index + 1 <= this.IconArray.length)
			marker.IconIndex = index;
		else
			marker.IconIndex = -1;
		
		return marker;
	},
	GetMarkerBoundsAndZoom: function(markers) {
		var minLat = null, minLng = null, maxLat = null, maxLng = null;
		for(var i = 0; i < markers.length; i++) {
			var lat = markers[i].getLatLng().lat();
			var lng = markers[i].getLatLng().lng();
			if(lat > maxLat || i == 0) maxLat = lat;
			if(lat < minLat || i == 0) minLat = lat;
			if(lng > maxLng || i == 0) maxLng = lng;
			if(lng < minLng || i == 0) minLng = lng;
		}
		
		var div = document.createElement("div");
		var map = new GMap2(div, { size: new GSize(parseInt($("#map_canvas").css("width")), parseInt($("#map_canvas").css("height"))) });
		
		var paddingDeg = 0.005;
		var bounds = new GLatLngBounds(new GLatLng(minLat-paddingDeg, minLng-paddingDeg), new GLatLng(maxLat+paddingDeg, maxLng+paddingDeg));
		var zoomFit = map.getBoundsZoomLevel(bounds);
		
		delete map;
		delete div;
		
		return { bounds: bounds, zoom: zoomFit };
	},
	BindShowMarkerInfoBox: function(marker, retailerRow) {
		if(retailerRow) {
			retailerRow.bind("click",
				function() { 
					if(KrillionUI.CurrentView == 1 && KrillionUI.GMap != null && marker) {
						GEvent.trigger(marker, "click"); 								
						$("#map_canvas").get(0).scrollIntoView(true);
					}
				} 
			);
		}
	},
	BindShowSelectedRetailerRow: function(marker, retailerRow) {
		if(marker && retailerRow)
			GEvent.addListener(marker, "click", function() { KrillionUI.ShowSelectedRetailerRow(retailerRow); });
	},
	ShowSelectedRetailerRow: function(retailerRow) {
		$(".retailer tr").removeClass("map-selected");
		
		if(retailerRow) {
			retailerRow.addClass("map-selected");
			
			var toggle = $("#" + retailerRow.attr("id") + "_toggle");
			if(toggle)
				toggle.addClass("map-selected");
		}
	}
}

KrillionUI.LoadingIndicator = {
	Id: null,
	Step: 0,
	Bars: 20,
	Show: function() {
		$("#wtb_results").hide();
		$("#wtb_options").hide();
		this.Animate();
		this.Id = window.setInterval(function() { KrillionUI.LoadingIndicator.Animate(); }, 25);
	},
	Hide: function() {
		if(this.Id != null) {
			window.clearInterval(this.Id);
			this.Id = null;
			this.Step = 0;
			
			$("#wtb_retailers").html("");
		}
	},
	Animate: function() {
		if(this.Id != null) {
			var dots = "";
			for(var i = 0; i < this.Bars; i++) {
				if(i == this.Step%(this.Bars+1)) dots += "<span style=\"color:#d3d3d3;\">";
				dots += "|";
			}
			if(this.Step%(this.Bars+1) != this.Bars) dots += "</span>";
			$("#wtb_retailers").html("<div style=\"margin-top: 10px;\"><span style=\"border: solid 1px #e5e5e5; padding: 1px; font-size: 55%;\" class=\"blue\">" + dots + "</span></div>");
			
			this.Step++;
		}
	}
}

$(document).ready(function() { KrillionUI.Init(); });


