﻿$(document).ready(function() {
    $('#search .btn').addClass('btnStyled');
    $('.lblOver').labelOver();

    //Convert the drop down lists
    $('.dropdown').each(function() {
        var sel = document.createElement("select");

        sel.onchange = function() {
            var loc = $(this).val();
            if (loc == "") { return false; }
            top.location.href = loc;
            return true;
        }

        ul = $(this);

        var opt = document.createElement("option");
        opt.value = "";
        opt.innerHTML = "Please Select";
        sel.appendChild(opt);

        ul.children().each(function() {
            val = $(this).children().attr('href')
            txt = $(this).children().text()

            opt = document.createElement("option");
            opt.value = val;
            opt.innerHTML = txt;
            sel.appendChild(opt);
        });

        ul.after(sel).remove();
    });
});