function switchView(id,img_src, ext) {
	var el = document.getElementById("product_view");
//	if (showing_detail) hideDetail();

	if (id == -1) {
		el.src = img_src;
	} else {
		el.src = global_view_path + id + "." + ext;
	}
}

function checkBasket(form_el) {
    var q_el = form_el.quantity;
	var numeric = /^[0-9\,\.]+$/;
    if (!numeric.test(q_el.value)) {	    
        alert("Invalid Quantity: " + q_el.value);
        return false;
    }
    return true;
}

function showSearchTab(cat_el) {
    var curr_cat = cat_el.value;
    var curr_div;

    for (i=1; i<25; i++) {
        curr_div = document.getElementById("search-tab-"+i);
        if (curr_div) {
            if (i == curr_cat) {
                curr_div.style.display = "block";
                curr_div.style.visibility = "visible";
            } else {
                curr_div.style.display = "none";            
            }
        }
    }
    //hide stainless and hi spec for plastic fasteners(4) cable ties(12) and king klik(17)
    var stainlessHiSpec = document.getElementById("stainlessHiSpec");
    if (cat_el.value == 4 || cat_el.value == 12 || cat_el.value == 17) {
        stainlessHiSpec.style.display = "none";
    } else {
        stainlessHiSpec.style.display = "block";
    }
}
