﻿
$(document).ready(function() {
    
    /* Add rollover to search Button */
    
    $(".TopSearchSubmit").hover(
      function () {
        $(this).removeClass("TopSearchSubmit").addClass("TopSearchSubmitHover");
      }, 
      function () {
        $(this).removeClass("TopSearchSubmitHover").addClass("TopSearchSubmit");
      }
    );
    
    /* Quick Search */
    $(".HandsetList select").change(
        function(){
            window.location = "handset-" + $('.HandsetList select option:selected').val() + "-" + $('.HandsetList select option:selected').text().replace(" ","-").replace(" ","-") + ".aspx";
        }
    );
    
    /* Handset Search 
    Sys.Application.add_load(setHandsetSearch);
    */
    
});

/*
function setHandsetSearch(){
    $(".Handset select").change(
        function(){
            window.location = "handset-" + $('.Handset select option:selected').val() + "-" + $('.Handset select option:selected').text().replace(" ","-").replace(" ","-") + ".aspx";
        }
    );
}
*/

function ClearText(myTxt, myDefault){
    if(myTxt.value == myDefault){
        myTxt.value = '';
    }
}

function ResetText(myTxt, myDefault){
    if(myTxt.value == ''){
        myTxt.value = myDefault;
    }
}


function url_encode(mytext){
    return mytext.replace(" ", "-")
}