function replaceURLWithHTMLLinks(text) {
    var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
    return text.replace(exp, "<a href='$1'>$1</a>");
}

$(function() {
    
    $('#facebook-carousel').jcarousel({ vertical: true, scroll: 1, animation: 'slow'  });

    $('input.watermark').each(function(index, Element) {
        var e = $(Element);
        var watermark = e.attr("title");
        if (watermark != undefined && watermark.length > 0) {
            e.val(watermark);
            e.focus(function() {
                var $this = $(this);
                if ($.trim($this.val()) == watermark) {
                    $this.val("");
                }
            }).blur(function() {
                var $this = $(this);
                if ($.trim($this.val()) == "") {
                    $this.val(watermark);
                }
            });
        }
    });

    

    $(".replace-links").each(function(index, Element) {
    var html = $(Element).html();
        $(Element).html(replaceURLWithHTMLLinks(html));
    });

    /*if ($('#basic-accordian').length > 0) {
    new Accordian('basic-accordian', 5, 'header_highlight');
    };*/
});
