//Clear function for input text on search field in header
function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}
function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}


//Colorized image rollover

        // Get the image link from within its (parent) container.
        function getImage(parent) {
            var el = document.getElementById(parent);
                    
            if (el.nodeName.toUpperCase() == "IMG") { // found an image
                    return el.src.replace(/\.jpg$/, "_silk.jpg");
             }
            
            return "";
        }

        // Get the attribute name from within its (parent) container.
        function getAttrName(parent) {
            var el = document.getElementById(parent);
                    
            if (el.nodeName.toUpperCase() == "IMG") { // found an image
                return el.alt;
            }
            
            return "";
        }

        //Set the background image
        function tqdBgImage(spotlight,tqdImg) {
            spotlight.style.backgroundImage="url('"+tqdImg+"')";
        }
        
        
        //Swap the image
        function tqdImgSwap(item) {
            var spotlight   = document.getElementById("swatchimg");
            var spotlighttext	= document.getElementById("swatchname");
            var myImg = getImage(item);
                                   
            spotlight.innerHTML = "<img src=\""+myImg+"\">";
            spotlighttext.innerHTML = getAttrName(item);
            setTimeout(function(){tqdBgImage(spotlight,myImg)},500);

        }
