﻿/*Generalized version of buttonUp and buttonHover*/

function hasCss(obj, css) 
{
    var cssArray = obj.className.split(" ");
    for (var i in cssArray) 
    {
        if (cssArray[i] == css) return true;
    }
    return false;
}

function buttonUp2(obj) 
{

    if (hasCss(obj, "_quicksearch_residential")) 
    {
        obj.style.backgroundImage = "url(pics/button_quicksearch_residential_up.png)";
    }
	if (hasCss(obj, "_quicksearch_farmland")) 
    {
        obj.style.backgroundImage = "url(pics/button_quicksearch_farmland_up.png)";
    }
    else if (hasCss(obj, "search_submit"))
    {
        obj.style.backgroundImage = "url(pics/button_submit_up.png)";
    }
}

function buttonHover2(obj) 
{
    if (hasCss(obj, "_quicksearch_residential"))
    {
        obj.style.backgroundImage = "url(pics/button_quicksearch_residential_hover.png)";
    }
	if (hasCss(obj, "_quicksearch_farmland"))
    {
        obj.style.backgroundImage = "url(pics/button_quicksearch_farmland_hover.png)";
    }
    else if (hasCss(obj, "search_submit"))
    {
        obj.style.backgroundImage = "url(pics/button_submit_hover.png)";
    }    
          
}


