﻿/// <reference path="jquery-1.3.2-vsdoc2.js" />

Duroc.Business = {
    instance: null,

    init: function() {
        instance = this;
        this.setBehavior();
        this.makeInitialCall();
    },
    setBehavior: function() {
        jQuery(".company-list a").hover(function(e) {
            //e.preventDefault();
            var item = this;
            instance.loadInfo(item);
        });
    },
    loadInfo: function(item) {
        jQuery(".company-list a").removeClass('selected');
        jQuery(item).addClass('selected');
        jQuery("#BusinessInfo").html('<h3>' + jQuery(item).attr('title') + '</h3><p>' + jQuery(item).find('.intro').html() + '</p><p><a class="btn" target="_blank" href="' + jQuery(item).attr('href') + '"><span>' + jQuery(item).attr('href').replace('http://www.', '') + '</span></a></p>');
    },
    makeInitialCall: function() {
        var item = jQuery('.company-list a').eq(0);
        if (item != null && item.length > 0)
            this.loadInfo(item);
    }
};

jQuery(document).ready(function() {

    Duroc.Business.init();
});