﻿
jQuery(function () {

    //Back to Top Scroll
    jQuery("a[href=#top]").click(function () {
        jQuery("html, body").animate({ "scrollTop": "0" }, "slow");
        return false;
    });

    //Quantity Available Tooltip
    jQuery("#qtyAst").tooltip({ "effect": "slide", "offset": [10, 0] });

    //Footer List
    jQuery(".f1 a").hover(
		function () { jQuery(this).stop().animate({ "paddingLeft": "13px" }, 200); },
		function () { jQuery(this).stop().animate({ "paddingLeft": "10px" }, 500); }
	);

    //Category List
    jQuery(".tame a").hover(
		function () { jQuery(this).stop().animate({ "paddingLeft": "7px", "width": "165px" }, 200); },
		function () { jQuery(this).stop().animate({ "paddingLeft": "2px", "width": "172px" }, 300); }
	);

    //Logos List
    jQuery(".logoTable td").hover(
		function () {
		    jQuery(this).stop().animate({
		        "borderTopColor": "#a0ceff", "borderRightColor": "#a0ceff",
		        "borderBottomColor": "#a0ceff", "borderLeftColor": "#a0ceff"
		    }, 600);
		},
		function () {
		    jQuery(this).stop().animate({
		        "borderTopColor": "#d2e8ff", "borderRightColor": "#d2e8ff",
		        "borderBottomColor": "#d2e8ff", "borderLeftColor": "#d2e8ff"
		    }, 1000);
		}
	);

    //Shipping Logos
    jQuery(".f3 div").hover(
		function () { jQuery(this).stop().animate({ "opacity": "0" }, 600); },
		function () { jQuery(this).stop().animate({ "opacity": "1" }, 800); }
	);

    //Add to Cart
    jQuery(".AddToCartButton").click(function () {
        //Scroll to Top
        jQuery("html, body").animate({ "scrollTop": "0" }, "medium");
        jQuery(this).effect("transfer", { to: jQuery(".itemCountWrap") }, 800);
        window.setTimeout("window.scrollTo(0, 0)", 2000);
    });

});

//Other
function searchFocus(element) {
    if (element.value == element.defaultValue) {
        element.value = '';
        element.style.fontStyle = 'normal';
        element.style.color = '#555';
    }
}
function searchBlur(element) {
    if (element.value == '') {
        element.value = element.defaultValue;
        element.style.fontStyle = 'italic';
        element.style.color = '#aaa';
    }
}
