﻿$(document).ready(function () {
	$('.clickPrice').click(
		function () {
			$('.clickPrice, .viewPrice').hide();
			$('.hideprice').show().css('display', 'inline');
		}
	);
	$('.hover').hover(
		function () {
			$(this).attr('src', $(this).attr('src').replace('.jpg', '_hover.jpg').replace('.gif', '_hover.gif').replace('.png', '_hover.png'));
		},
		function () {
			$(this).attr('src', $(this).attr('src').replace('_hover.jpg', '.jpg').replace('_hover.gif', '.gif').replace('_hover.png', '.png'));
		}
	);
	$('.tbLabel, .enteremail').focus(function () {
		if ($(this).val() == $(this).attr("title")) {
			$(this).val('').css('color', '#000');
		}
	}).blur(function () {
		if ($(this).val() == '') {
			$(this).val($(this).attr("title")).css('color', '#666');
		}
	});
	$('#Searchtb').focus(function () {
		if ($(this).val() == "Search GolfShoesOnly") {
			$(this).val('').css('color', '#000');
		}
	}).blur(function () {
		if ($(this).val() == '') {
			$(this).val("Search GolfShoesOnly").css('color', '#666');
		}
	}).keydown(function (e) {
		if (e.keyCode == 13) {
			doSearch();
			return false;
		}
	});
	$('.searchSubmit').click(doSearch);
	$('.whatBlem').click(function () {
		$.prompt($('.blemsContent').html());
	});
	$('.glryImg').hover(
		function () { p = $(this).parents('table.itemtbl'); p.find('.cattd:first').addClass('cattdhover'); },
		function () { p = $(this).parents('table.itemtbl'); p.find('.cattd:first').removeClass('cattdhover'); }
	);
	setAltClick();
	//$("#BreadCrumb a:last-child").css("font-weight", "bold");
	$('.showWait').click(ShowWait);
});

function setAltClick()
{
	$('.prodThumb').click(function () {
		var newSize = "/620/";
		if ($(this).hasClass('large')) {
			newSize = "/large/";
		}
		$('img.mainProdImg').attr('src', $(this).attr('src').replace('/thumb/', newSize));
	});
}

function doSearch()
{
	if ($('#Searchtb').val()!=="Search GolfShoesOnly")
	{
		window.location=BaseUrl+"/search.aspx?searchstr=" + $('#Searchtb').val();
	}
	else
	{
		window.location=BaseUrl+"/search.aspx"
	}
};

// Added For Wait Processing
function HideTip( elemID ){$('#' + elemID).hide();};
/*function ShowWait( elemID ){$('#' + elemID).show(); window.setTimeout('ShowProgressImg()',100);};*/
function ShowProgressImg() { $('.imgProcessDisplay').attr('src', $('.imgProcessDisplay').attr('src')); };
function ShowWait() {
	$('#divWaitDsply').show();
	$('#tblSummary').hide();
	window.setTimeout('ShowProgressImg()', 100);
	return true;
}
