function IsNumeric(sText)
{
    var ValidChars = "0123456789.";
    var IsNumber=true;
    var Char;

    for (i = 0; i < sText.length && IsNumber == true; i++)
    {
        Char = sText.charAt(i);

        if (ValidChars.indexOf(Char) == -1)
        {
            IsNumber = false;
        }
    }
    return IsNumber;
}

function fnShowHide(show, hide)
{
    document.getElementById("hd_"+show).className = "detail_menu_selected";

    aHide = hide.split(':');

    for (i = 0; i < aHide.length; i++)
    {
        document.getElementById("hd_"+aHide[i]).className = "detail_menu_unselected";
    }

    $("div.view").hide();
    $('#div_'+show).fadeIn();
}

function fnClearTextBox()
{
    $("#txtSearch").val("");
}

function fnShowList(item)
{
    var filter = $("#txtSearch").val();
    var offset = $("#txtSearch").offset();

    $.ajax({
        type: "POST",
        url: baseurl + "" + "search/m/",
        data: "filter="+filter,
        success: function(msg) {
            $('#suggestions').show();
            $('#suggestions').css('left', offset.left);
            $('#suggestions').css('top', offset.top + 15);
//            $('#suggestions').css('height', '100px');
            $('#autoSuggestionsList').html(msg);
        }
     });
}

function fnSearchValue(item)
{
    var filterId = item.attributes.getNamedItem("controlId").value;
    var filter = item.attributes.getNamedItem("controlValue").value;
    var unoExists = item.attributes.getNamedItem("unoExists").value;

    $("#txtSearch").val(filter);

    $('#suggestions').hide();

    if (unoExists == 1)
        location.href = baseurl + 'm/det/' + filterId;
    else
        location.href = baseurl + 'search/s';
}

function fnClose()
{
    $('#suggestions').hide();
}

function initialize()
{
    if (GBrowserIsCompatible())
    {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(latitude, longitude), 15);
        map.setUIToDefault();

        var latlng = new GLatLng(latitude, longitude);
        map.addOverlay(new GMarker(latlng));
    }
}

$(document).ready(function(){
    $(".newsticker-jcarousellite").jCarouselLite({
        vertical: true,
        hoverPause:true,
        visible: 5,
        auto:500,
        speed:1000
    });
});