﻿/**
* Auction House Base jQuery
*/


$(document).ready(function () {


	/**
	* Offset menus
	*/
	var resizeTimer;
	$(window).resize(function () {
		clearTimeout(resizeTimer);
		resizeTimer = setTimeout(offsetMenus, 1000);
	});
	function offsetMenus() {
		if ($(document).width() <= 1115) {
			$('.advicemenu').addClass('smallscreen');
			$('.regionmenu').addClass('smallscreen2');
		} else {
			$('.advicemenu').removeClass('smallscreen');
			$('.regionmenu').removeClass('smallscreen2');
		}
	}
	offsetMenus();

	/**
	* Image Popup
	*/
	$.fn.showImageText = function () {
		return this.each(function () {
			var box = $(this);
			var text = $('.popupinfo', this);
			var intro = $('.buttonlink', this);
			box.hover(function () {
				intro.fadeOut("slow")
				text.slideDown("slow");
			}, function () {
				intro.fadeIn("slow")
				text.slideUp("slow");
			});
		});
	}
	$('.contentimagebox').showImageText();


	/**
	* IE z-index fix
	*/
	var startingIndex = 400;
	$('#menu').parents().each(function (index) {
		startingIndex = startingIndex - index;
		$(this).css({ "z-index": startingIndex });
	});


});
