﻿function clearTextBoxDefaultValue(id, defaultValue){
    var strValue = document.getElementById(id).value;
    
    if(strValue==defaultValue){
        document.getElementById(id).value = '';
        }
    }

function resetTextBoxDefaultValue(id, defaultValue){
    var strValue = document.getElementById(id).value;
    
    if(strValue==''){
        document.getElementById(id).value = defaultValue;
        }
    }
    
function checkSearchBlank(){
    var myString = trim(document.searchForm.search.value);
    if (myString.length<3){
        alert('Please enter a minimum of 3 characters in the product search.');
        if(myString.length==0){
            document.searchForm.search.value = '';
            }
        else{
            document.searchForm.search.value = myString;
            }
        return false;
        }
    }

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
