$(document).ready(function() {

	// If we're working on localhost, subst the image.ashx with paoshop.metadata.gr/image.ashx
	if ($(window).attr('location').toString().match("localhost") != null) {
		$('img[src*=mage.ashx]').attr('src', function() {
			return 'http://paoshop.metadata.gr/' + $(this).attr('src');
		});
	}

	// Mouseover functionality for buttons
	$('input[type=image].mo,a.mo img').hover(
		function() {
			$(this).attr('src', $(this).attr('src').replace('_normal', '_over'));
		},
		function() {
			$(this).attr('src', $(this).attr('src').replace('_over', '_normal'));
		}
	);

	// Top menu css tidy
	$('div.menu ul').each(function() {
		$(this).children('li:first').children('a').css('border-top', '0px');
	});

	// Top menu dropdown functionality
	$('div.menu ul li').hover(
		function() {
			$(this).addClass('hover');
			$(this).children('ul').show();
		},
		function() {
			$(this).removeClass('hover');
			$(this).children('ul').hide();
		}
	);


	// Initialize the accordion functionality
	$(".accordion").accordion({
		active: false,
		collapsible: true,
		autoHeight: false
	});
	
	// textbox quantity numeric functionality
	InitNumeric();
});