/**
* Input Search Text Onclick Clear Out
*/
function searchSiteOnClick(id)
{
    if (!id){id= "searchSite";}
    var el =  document.getElementById(id);
    if (el == "" || el.value == "Search") {
        el.value = "";
        el.style.color = "#000000";
        el.focus();
    }
}

function searchSiteOnBlur(id)
{
    if (!id){id= "searchSite";}
    var el =  document.getElementById(id);
    if (el.value == "") {
        el.style.color = "#5E6464";
        el.value = "Search";
    }
}

//whitespace only or empty
function isEmpty(inputValue)
{
    if (inputValue.match(/^s+$/) || inputValue == "")
    {
        return true;
    }
    else
    {
        return false;
    }
}

function isNumber(inputValue)
{
    var i;
    if (inputValue.length = 5)
    {
        for (i=0; i<inputValue.length; i++)
        {
            // Check that current character is number.
            var c = inputValue.charAt(i);
            if ((c < "0") || (c > "9"))
            {
                return false;
            }
        }
        // All characters are numbers.
        return true;
        }
        else {
            return false;
        }
}

function searchSiteOnBlur2(id)
{
    if (!id){id= "searchSite";}
    var el =  document.getElementById(id);
    if (el.value == "") {
        el.style.color = "#5E6464";
        el.value = "";
    }
}

//Placeholder function for WT. Remove this once WT scripts are available
/*function dcsMultiTrack()
{
}*/

//Product Overlay Image Swap Function
function swapImage(selectedId, imageId, iframeId, iframeSourcePrefix) {
    //$('roomImage').src = "http://testvipd4.scene7.com/is/image/ASF/"+imageId+"?$xl$";
    $(iframeId).src = iframeSourcePrefix + imageId;
    var roomImageList = $$('td#otherImages div');
    for (var i=0;i<roomImageList.length;i++) {
        if ($(roomImageList[i]).hasClass('selectedImage')) {
            $(roomImageList[i]).removeClass('selectedImage');
            $(roomImageList[i]).addClass('otherImage');
        }
    }
    $('img_'+ selectedId).addClass('selectedImage');
}