try {
	var Anamo_Images2 = new Array(new Image());
	Anamo_Images2[0].src = "/z/img/img-ui-list-arrow-hover.png";
} catch(ex) {}
$(document).ready(function() {
	$(document).bind("click", function(e) {
		var $EventTarget = $(e.target);
		if($EventTarget.parents(".thrColHybHdr > .container .sd1 > ul").length == 0) {
			$(".thrColHybHdr > .container .sd1 #anamo-ws-browsestores ul > li > a.current").each(function(intIndex) {
				$(this).removeClass("current");
			});
			$(".thrColHybHdr > .container .sd1 .anamo-ws-browsestores-contextmenu").hide();
		}
	});
	$(".managepersonalaccount").bind("click", function(e) {
		window.location = "/accounts/homepage";
		return false;
	});
	$(".thrColHybHdr > .container .sd1 #anamo-ws-browsestores ul > li > a").bind("mouseenter", function() {
		$(".thrColHybHdr > .container .sd1 #anamo-ws-browsestores ul > li > a.current").each(function(intIndex) {
			$(this).removeClass("current");
		});
		$(".thrColHybHdr > .container .sd1 .anamo-ws-browsestores-contextmenu").hide();
		$(this).parents(".storeelement:first").children(".anamo-ws-browsestores-contextmenu").show();
	});
	$(".thrColHybHdr > .container .sd1 #anamo-ws-browsestores ul > li > a").bind("mouseleave", function() {
		var Cm = $(this);
		$.timer(150, function(timer) {
			if($(".thrColHybHdr > .container .sd1 #anamo-ws-browsestores ul > li > a.ishover").length == 0 && $(".thrColHybHdr > .container .sd1 #anamo-ws-browsestores ul > li > a.current").length == 0) {
				Cm.parents(".storeelement:first").children(".anamo-ws-browsestores-contextmenu").hide();
			}
			timer.stop();
		});
	});
	$(".thrColHybHdr > .container .sd1 #anamo-ws-browsestores ul > li > a").hover(
		function() {
			$(this).addClass("ishover");
		},
		function() {
			$(this).removeClass("ishover");
		}
	);
	$(".thrColHybHdr > .container .sd1 .anamo-ws-browsestores-contextmenu .anamo-header-contextmenu-content ul li a").hover(
		function() {
			$(this).parents(".storeelement:first").children("a").addClass("current");
		},
		function() {
			//
		}
	);
	$(".skiaD1").each(function(intIndex) {
		$(this).css("zIndex", 9999);
		$(this).css("z-index", 9999);
	});
	$(".skiaD1").hover(
		function() {
			//
		},
		function() {
			//
		}
	);
	if($("#anamo-popularitems-forprotein").length > 0) {
		$.ajax({
			type: "POST",
			url: "/api/anamo-stats-mostordereditems",
			data: "limit=0,9&category=1",
			beforeSend: function(XMLHttpRequest) {
				var CurrentListElement = $("#anamo-popularitems-forprotein");
				CurrentListElement.empty();
				CurrentListElement.append('<strong class="loading"><img src="/z/img/icon-loading.gif"/> <span lang="en">Loading...</span><span lang="el">Φορτώνει...</span></strong>');
			},
			success: function(data, textStatus) {
				var CurrentListElement = $("#anamo-popularitems-forprotein");
				CurrentListElement.empty();
				var ElementsCount = 0;
				$(data).find("mostorderedproducts").each(function(intIndex) {
					CurrentListElement.append('<div class="mestiles" style="margin-bottom:5px;">            <div class="stili1" style="width:75px; height:75px; padding:1px; border:#c6c6e0 solid 1px; background:#ffffff;">            	<a href="/product/'+$(this).children("itemid").text()+'" style="display:block; width:75px; height:75px; line-height:75px; background-position:50% 50%; background-repeat:no-repeat; background-color:#ffffff; background-image:url(\'/thumb?what=product&size=75&itemid='+$(this).children("itemid").text()+'\');"></a>            </div>            <div class="stilimesa" style="margin-left:82px;">            	<h3 style="margin:0; padding:0;">#'+(ElementsCount + 1)+'</h3>              <a href="/product/'+$(this).children("itemid").text()+'"><strong>'+$(this).children("itemname").text()+'</strong></a>              <br/>              <small>                <span lang="en">by</span>                <span lang="el">από</span>              </small>              <div class="timi">                <span class="katalogou">'+$(this).children("itemcatalogpricestring").text()+'</span>                <span class="kanoniki">'+$(this).children("itempricestring").text()+'</span>              </div>            </div>          </div>');
					ElementsCount++;
				});
				if(ElementsCount == 0) {
					CurrentListElement.append('<h3 class="empty"><span lang="en">No items for this category.</span><span lang="el">Καθόλου αντικείμενα γι\' αυτή την κατηγορία.</span></h3>');
				} else {
					//
				}
			}
		});
	}
	if($("#anamo-recentlyvisiteditem-one").length > 0) {
		/*$.ajax({
			type: "POST",
			global: false,
			url: "/api/anamo-stats-recentlyvisiteditems",
			data: "limit=0,1",
			beforeSend: function(XMLHttpRequest) {
				//
			},
			success: function(data, textStatus) {
				$("#anamo-recentlyvisiteditem-one h4.container-title").empty();
				var ElementsCount = 0;
				$(data).find("browsinghistoryproducts").each(function(intIndex) {
					if($(this).children("itemexists").text() == 1) {
						$("#anamo-recentlyvisiteditem-one h4.container-title").html($(this).children("itemname").text());
						$("#anamo-recentlyvisiteditem-one > a").css("background", 'background-image:url(\'/thumb?what=product&size=75&itemid='+$(this).children("itemid").text()+'\');');
						$("#anamo-recentlyvisiteditem-one > a").attr("href", '/product/'+$(this).children("itemid").text());
						ElementsCount++;
					}
				});
				if(ElementsCount == 0) {
					//$("#anamo-recentlyvisiteditem-one-container").hide();
				} else {
					//
				}
			}
		});*/
	}
	RefreshCarousel("", "");
	/*$.ajax({
		type: "POST",
		url: "/api/anamo-stats-mostordereditems",
		data: "limit=0,12&category=1",
		global: false,
		beforeSend: function(XMLHttpRequest) {
			var CurrentListElement = $("#anamo-ws-sibliromata-sample");
			CurrentListElement.empty();
			CurrentListElement.append('<tr><td><strong class="loading"><img src="/z/img/icon-loading.gif"/> <span lang="en">Loading...</span><span lang="el">Φορτώνει...</span></strong></td></tr>');
		},
		success: function(data, textStatus) {
			var CurrentListElement = $("#anamo-ws-sibliromata-sample");
			CurrentListElement.empty();
			var ElementsCount = 0;
			var ElementsFlag = 0;
			var ElementsTag = "";
			$(data).find("mostorderedproducts").each(function(intIndex) {
				if(ElementsFlag == 4) {
					ElementsFlag = 0;
				}
				ElementsTag += (ElementsFlag == 0? '<tr>': '')+'<td id="anamo-history-hottest-sibliroma-'+$(this).children("itemid").text()+'"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'" style="background-image:url(\'/thumb?what=product&size=100&itemid='+$(this).children("itemid").text()+'\');" class="ikona"></a><div class="titlos"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'">'+$(this).children("itemname").text()+'</a></div><div class="statistika">'+($(this).children("itemavgcstratingcount").text() > 0? '<span class="aksiologisi anamo-aksiologisi-a'+$(this).children("itemavgcstratingstring").text()+'">(<a href="/review/'+$(this).children("itemid").text()+'">'+$(this).children("itemavgcstratingcount").text()+'</a>)</span>': '')+'<div class="timi" style="padding-top:3px;">'+$(this).children("itempricestring").text()+'</span></div></td>'+(ElementsFlag == 3? '</tr>': '');
				ElementsCount++;
				ElementsFlag++;
			});
			if(ElementsCount == 0) {
				CurrentListElement.append('<tr><td><h3 class="empty"><span lang="en">No items for this category.</span><span lang="el">Καθόλου αντικείμενα γι\' αυτή την κατηγορία.</span></h3></td></tr>');
			} else {
				CurrentListElement.append(ElementsTag);
			}
		}
	});*/
	if($("#anamo-ws-kinita-sample").length > 0) {
		$.ajax({
			type: "POST",
			url: "/api/anamo-stats-showtimesample",
			data: "limit=0,12&category=194",
			global: false,
			beforeSend: function(XMLHttpRequest) {
				var CurrentListElement = $("#anamo-ws-kinita-sample");
				CurrentListElement.empty();
				CurrentListElement.append('<tr><td><strong class="loading"><img src="/z/img/icon-loading.gif"/> <span lang="en">Loading...</span><span lang="el">Φορτώνει...</span></strong></td></tr>');
			},
			success: function(data, textStatus) {
				var CurrentListElement = $("#anamo-ws-kinita-sample");
				CurrentListElement.empty();
				var ElementsCount = 0;
				var ElementsFlag = 0;
				var ElementsTag = "";
				$(data).find("products").each(function(intIndex) {
					if(ElementsFlag == 4) {
						ElementsFlag = 0;
					}
					ElementsTag += (ElementsFlag == 0? '<tr>': '')+'<td id="anamo-history-recent-arrival-'+$(this).children("itemid").text()+'"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'" style="background-image:url(\'/thumb?what=product&size=100&itemid='+$(this).children("itemid").text()+'\');" class="ikona"></a><div class="titlos"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'">'+$(this).children("itemname").text()+'</a></div><div class="statistika">'+($(this).children("itemavgcstratingcount").text() > 0? '<span class="aksiologisi anamo-aksiologisi-a'+$(this).children("itemavgcstratingstring").text()+'">(<a href="/review/'+$(this).children("itemid").text()+'">'+$(this).children("itemavgcstratingcount").text()+'</a>)</span>': '')+'<div class="timi" style="padding-top:3px;">'+$(this).children("itempricestring").text()+'</span></div></td>'+(ElementsFlag == 3? '</tr>': '');
					ElementsCount++;
					ElementsFlag++;
				});
				if(ElementsCount == 0) {
					CurrentListElement.append('<tr><td><h3 class="empty"><span lang="en">No items for this category.</span><span lang="el">Καθόλου αντικείμενα γι\' αυτή την κατηγορία.</span></h3></td></tr>');
				} else {
					CurrentListElement.append(ElementsTag);
				}
			}
		});
	}
	if($("#anamo-ws-printers-sample").length > 0) {
		$.ajax({
			type: "POST",
			url: "/api/anamo-stats-showtimesample",
			data: "limit=0,12&category=220",
			global: false,
			beforeSend: function(XMLHttpRequest) {
				var CurrentListElement = $("#anamo-ws-printers-sample");
				CurrentListElement.empty();
				CurrentListElement.append('<tr><td><strong class="loading"><img src="/z/img/icon-loading.gif"/> <span lang="en">Loading...</span><span lang="el">Φορτώνει...</span></strong></td></tr>');
			},
			success: function(data, textStatus) {
				var CurrentListElement = $("#anamo-ws-printers-sample");
				CurrentListElement.empty();
				var ElementsCount = 0;
				var ElementsFlag = 0;
				var ElementsTag = "";
				$(data).find("products").each(function(intIndex) {
					if(ElementsFlag == 4) {
						ElementsFlag = 0;
					}
					ElementsTag += (ElementsFlag == 0? '<tr>': '')+'<td id="anamo-history-recent-arrival-'+$(this).children("itemid").text()+'"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'" style="background-image:url(\'/thumb?what=product&size=100&itemid='+$(this).children("itemid").text()+'\');" class="ikona"></a><div class="titlos"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'">'+$(this).children("itemname").text()+'</a></div><div class="statistika">'+($(this).children("itemavgcstratingcount").text() > 0? '<span class="aksiologisi anamo-aksiologisi-a'+$(this).children("itemavgcstratingstring").text()+'">(<a href="/review/'+$(this).children("itemid").text()+'">'+$(this).children("itemavgcstratingcount").text()+'</a>)</span>': '')+'<div class="timi" style="padding-top:3px;">'+$(this).children("itempricestring").text()+'</span></div></td>'+(ElementsFlag == 3? '</tr>': '');
					ElementsCount++;
					ElementsFlag++;
				});
				if(ElementsCount == 0) {
					CurrentListElement.append('<tr><td><h3 class="empty"><span lang="en">No items for this category.</span><span lang="el">Καθόλου αντικείμενα γι\' αυτή την κατηγορία.</span></h3></td></tr>');
				} else {
					CurrentListElement.append(ElementsTag);
				}
			}
		});
	}
	/*$.ajax({
		type: "POST",
		url: "/api/anamo-stats-showtimesample",
		data: "limit=0,12&category=2",
		global: false,
		beforeSend: function(XMLHttpRequest) {
			var CurrentListElement = $("#anamo-ws-protein-sample");
			CurrentListElement.empty();
			CurrentListElement.append('<tr><td><strong class="loading"><img src="/z/img/icon-loading.gif"/> <span lang="en">Loading...</span><span lang="el">Φορτώνει...</span></strong></td></tr>');
		},
		success: function(data, textStatus) {
			var CurrentListElement = $("#anamo-ws-protein-sample");
			CurrentListElement.empty();
			var ElementsCount = 0;
			var ElementsFlag = 0;
			var ElementsTag = "";
			$(data).find("products").each(function(intIndex) {
				if(ElementsFlag == 4) {
					ElementsFlag = 0;
				}
				ElementsTag += (ElementsFlag == 0? '<tr>': '')+'<td id="anamo-history-recent-arrival-'+$(this).children("itemid").text()+'"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'" style="background-image:url(\'/thumb?what=product&size=100&itemid='+$(this).children("itemid").text()+'\');" class="ikona"></a><div class="titlos"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'">'+$(this).children("itemname").text()+'</a></div><div class="statistika">'+($(this).children("itemavgcstratingcount").text() > 0? '<span class="aksiologisi anamo-aksiologisi-a'+$(this).children("itemavgcstratingstring").text()+'">(<a href="/review/'+$(this).children("itemid").text()+'">'+$(this).children("itemavgcstratingcount").text()+'</a>)</span>': '')+'<div class="timi" style="padding-top:3px;">'+$(this).children("itempricestring").text()+'</span></div></td>'+(ElementsFlag == 3? '</tr>': '');
				ElementsCount++;
				ElementsFlag++;
			});
			if(ElementsCount == 0) {
				CurrentListElement.append('<tr><td><h3 class="empty"><span lang="en">No items for this category.</span><span lang="el">Καθόλου αντικείμενα γι\' αυτή την κατηγορία.</span></h3></td></tr>');
			} else {
				CurrentListElement.append(ElementsTag);
			}
		}
	});
	$.ajax({
		type: "POST",
		url: "/api/anamo-stats-showtimesample",
		data: "limit=0,12&category=5",
		global: false,
		beforeSend: function(XMLHttpRequest) {
			var CurrentListElement = $("#anamo-ws-glutamines-sample");
			CurrentListElement.empty();
			CurrentListElement.append('<tr><td><strong class="loading"><img src="/z/img/icon-loading.gif"/> <span lang="en">Loading...</span><span lang="el">Φορτώνει...</span></strong></td></tr>');
		},
		success: function(data, textStatus) {
			var CurrentListElement = $("#anamo-ws-glutamines-sample");
			CurrentListElement.empty();
			var ElementsCount = 0;
			var ElementsFlag = 0;
			var ElementsTag = "";
			$(data).find("products").each(function(intIndex) {
				if(ElementsFlag == 4) {
					ElementsFlag = 0;
				}
				ElementsTag += (ElementsFlag == 0? '<tr>': '')+'<td id="anamo-history-recent-arrival-'+$(this).children("itemid").text()+'"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'" style="background-image:url(\'/thumb?what=product&size=100&itemid='+$(this).children("itemid").text()+'\');" class="ikona"></a><div class="titlos"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'">'+$(this).children("itemname").text()+'</a></div><div class="statistika">'+($(this).children("itemavgcstratingcount").text() > 0? '<span class="aksiologisi anamo-aksiologisi-a'+$(this).children("itemavgcstratingstring").text()+'">(<a href="/review/'+$(this).children("itemid").text()+'">'+$(this).children("itemavgcstratingcount").text()+'</a>)</span>': '')+'<div class="timi" style="padding-top:3px;">'+$(this).children("itempricestring").text()+'</span></div></td>'+(ElementsFlag == 3? '</tr>': '');
				ElementsCount++;
				ElementsFlag++;
			});
			if(ElementsCount == 0) {
				CurrentListElement.append('<tr><td><h3 class="empty"><span lang="en">No items for this category.</span><span lang="el">Καθόλου αντικείμενα γι\' αυτή την κατηγορία.</span></h3></td></tr>');
			} else {
				CurrentListElement.append(ElementsTag);
			}
		}
	});*/
	// New era.
	$(".newera").show("bounce", {}, 500, function() {
		setTimeout(function() {
			$(".newera").hide("drop", {}, 500);
		}, 5000);
	});
	// Videos.
	$('#anamo-videos-easmov').anamovideoplayer({
		autoplay: false,
		poster: '/z/dia/vid-EAS_Commercial2.jpg',
		autocollapseVideo: '/z/dia/vid-EAS_Commercial2.flv',
		videos: [{source:'/z/dia/vid-EAS_Commercial2.ogg', type:'ogg'},{source:'/z/dia/vid-EAS_Commercial2.mp4', type:'mp4'}]
	});
	$('#anamo-videos-lgmov').anamovideoplayer({
		autoplay: false,
		poster: '/z/dia/vid-LG_New_Chocolate_BL20.jpg',
		autocollapseVideo: '/z/dia/vid-LG_New_Chocolate_BL20.flv',
		videos: [{source:'/z/dia/vid-LG_New_Chocolate_BL20.ogg', type:'ogg'},{source:'/z/dia/vid-LG_New_Chocolate_BL20.mp4', type:'mp4'}]
	});
	$('#anamo-videos-hpmov').anamovideoplayer({
		autoplay: false,
		poster: '/z/dia/vid-HP_Commercial.jpg',
		autocollapseVideo: '/z/dia/vid-HP_Commercial.flv',
		videos: [{source:'/z/dia/vid-HP_Commercial.ogg', type:'ogg'},{source:'/z/dia/vid-HP_Commercial.mp4', type:'mp4'}]
	});
});
function RefreshCarousel(ByValCategoryId, ByValBrand) {
	$.ajax({
		type: "POST",
		url: "/api/anamo-stats-recentarrivals",
		data: "limit=0,40&category="+ByValCategoryId+"&brand="+ByValBrand,
		global: false,
		beforeSend: function(XMLHttpRequest) {
			var CurrentListElement = $("ul.jcarousel-skin-anamo-history-new-arrivals");
			CurrentListElement.empty();
			CurrentListElement.append('<strong class="loading"><img src="/z/img/icon-loading.gif"/> <span lang="en">Loading...</span><span lang="el">Φορτώνει...</span></strong>');
		},
		success: function(data, textStatus) {
			var CurrentListElement = $("ul.jcarousel-skin-anamo-history-new-arrivals");
			CurrentListElement.empty();
			var ElementsCount = 0;
			$(data).find("products").each(function(intIndex) {
				CurrentListElement.append('<li id="anamo-history-recent-arrival-'+$(this).children("itemid").text()+'"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'" style="background-image:url(\'/thumb?what=product&size=100&itemid='+$(this).children("itemid").text()+'\');" class="ikona"></a><div class="titlos"><a href="/product/'+$(this).children("itemid").text()+'" title="'+$(this).children("itemname").text()+'">'+$(this).children("itemname").text()+'</a></div><div class="statistika">'+($(this).children("itemavgcstratingcount").text() > 0? '<span class="aksiologisi anamo-aksiologisi-a'+$(this).children("itemavgcstratingstring").text()+'">(<a href="/review/'+$(this).children("itemid").text()+'">'+$(this).children("itemavgcstratingcount").text()+'</a>)</span>': '')+'<div class="timi" style="padding-top:3px;">'+$(this).children("itempricestring").text()+'</div></div></li>');
				ElementsCount++;
			});
			if(ElementsCount == 0) {
				CurrentListElement.append('<h3 class="empty"><span lang="en">No recent arrivals for this category.</span><span lang="el">Καθόλου νέες αφίξεις γι\' αυτή την κατηγορία.</span></h3>');
			} else {
				CurrentListElement.jcarousel({
					"auto": 4,
					"wrap": "last",
					"initCallback": function(carousel) {
						// Disable autoscrolling if the user clicks the prev or next button.
						carousel.buttonNext.bind('click', function() {
							carousel.startAuto(0);
						});
						carousel.buttonPrev.bind('click', function() {
							carousel.startAuto(0);
						});
						// Pause autoscrolling if the user moves with the cursor over the clip.
						carousel.clip.hover(function() {
							carousel.stopAuto();
						}, function() {
							carousel.startAuto();
						});
				},
				});
			}
		}
	});
}
