﻿$(function(){
    //initECommerce();
    //initFlashBorders();
    //initClearInputs();
    $(".thumbs a").hover(function(){$("img.main").attr("src",this);});
});

/* Flash Border Removal
===================================================================================== */
function initFlashBorders(){
    if ($.browser.msie){
        $("object[@type='application/x-shockwave-flash']").each(function(){
                var h = this.outerHTML ;
				var params = '' ;
				var j = this.childNodes.length - 1 ;
				do {
					var p = this.childNodes[j] ;
					if (p.tagName == "PARAM") params += p.outerHTML ;
				} while (j--) ;
				var tag = h.split(">")[0] + ">" ;
				this.outerHTML = tag + params + this.innerHTML + " </object>" ;
            });
    }
}

/* Form Element Methods
===================================================================================== */
function initClearInputs(){
    $("input.autoClear").each(function(){
            $(this).attr("default",$(this).val());
            $(this).focus(function(){if($(this).val() == $(this).attr("default")) $(this).val("");});
            $(this).blur(function(){if ($(this).val() == "") $(this).val($(this).attr("default"));});
        });
}

/* E-Commerce Methods
===================================================================================== */
function initECommerce() {
    // Checkout page helpers
    if ($("#Checkout input[@type=password]").size() > 0){
        $("#Checkout input[@type=password]").keyup(function(){
                var id = ($(this).val().length > 0) ? "#ctl00_MainContent_optReturningCustomer" : "#ctl00_MainContent_optNewCustomer";
                $(id).attr("checked","checked");
            });
    }
}