/**
* add an event listener to an object
* @param object object to add event to
* @param string event type to add
* @param object function to execute
*/
	var ysm_accountid  = "1MDD39R3GDLVJMQDL6M03HQVG5S";
	document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' " 
	+ "SRC=//" + "srv2.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid 
	+ "></SCR" + "IPT>");

function addEvent(obj, evType, fn)
{
    if (obj)
    {
        if (obj.addEventListener)
        {
            obj.addEventListener(evType, fn, true);
            return true;
        }
        else if (obj.attachEvent)
        {
            var r = obj.attachEvent("on" + evType, fn);
            return r;
        }
        else
        {
            return false;
        }
    }
}

/**
* 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 = "#cccccc";
        el.value = "";
    }
}