﻿$j(document).ready(function() {
      
    searchBoxInit();
    
});    //end document.ready()



//Set search bar behaviors

// Saves the default value of the search box into the "alt" attribute.

// If the box is empty when it loses focus, restore this value.

function searchBoxInit() {

 

    //Store the default value into the "alt" attribute

    jQuery.each($j(".searchInput"), function() {

        $j(this).attr("title", $j(this).val());

    });

 

    //Clear the default search box value on click

    $j(".searchInput").click(function() {

        if ($j(this).val() == $j(this).attr("title")) {

            $j(this).val("");

        }

    });

    

    //Restore the value from "alt" if box is blank

    $j(".searchInput").blur(function() {

        if ($j(this).val() == "") {

            //$j(this).hide();

            $j(this).val($j(this).attr("title")); //Restore the value from the “alt” attribute

            //$j(this).fadeIn(300);

        }

    });

}


function RestoreSearchText()
{
    if ($j(this).val() == "") {
        $j(this).hide();
        $j(this).val("Search Terms");
        $j(this).fadeIn(300);
    }
}

function RestoreText(textbox,originalText)
{
if(textbox.value=="")
{
textbox.value=originalText;
}
}
