﻿/// <reference path="jQuery.intellisense.js" />
$(function() {
    enterFunction = function() {

        if ($(this).hasClass('one')) {
            textn = '<a href="/default.asp?ML=22" class="active"><span class="accordionCaption">Construction is a risky activity and insurance a fundamental requirement. We offer a complete “risk solutions” service.</span></a>'
            classn = 'one_on'
        } else if ($(this).hasClass('two')) {
            textn = '<a href="/default.asp?ML=23" class="active"><span class="accordionCaption">Changes in the macroeconomy increases the complexity of products & services. We have the key to bespoke insurance.</span></a>'
            classn = 'two_on'
        } else if ($(this).hasClass('three')) {
            textn = '<a href="/default.asp?ML=35" class="active"><span class="accordionCaption">Complex industry interdependencies and Catastrophic loss scenarios are everyday issues for our experienced brokers and engineers.</span></a>'
            classn = 'three_on'
        } else if ($(this).hasClass('five')) {
            textn = '<a href="/default.asp?ML=25" class="active"><span class="accordionCaption">Captives can be an efficient way to solve insurance needs. We create the optimal structure, effcicient capital utilization, reinsruacen and claims.</span></a>'
            classn = 'five_on'
        } else if ($(this).hasClass('six')) {
            textn = '<a href="/default.asp?ML=26" class="active"><span class="accordionCaption">Marine insurance was one of the first insurance practices in the world. UIB offers an effective and integrated marine service.</span></a>'
            classn = 'six_on'
        } else if ($(this).hasClass('seven')) {
            textn = '<a href="/default.asp?ML=27" class="active"><span class="accordionCaption">UIB offer coverages which transfer the unforeseen risks of trade or operations in emerging markets and developing parts of the world.</span></a>'
            classn = 'seven_on'
        } else if ($(this).hasClass('four')) {
            textn = '<a href="/default.asp?ML=28" class="active"><span class="accordionCaption">UIBs team has unmatched experience and knowledge hin risk management & insurance for Mining / Natural Resources in any risk environment and jurisdiction.</span></a>'
            classn = 'four_on'
        }

        $(this).html(textn);
        $(this).addClass(classn);
    }

    leaveFunction = function() {
        if ($(this).hasClass("one")) {
            $(this).html('<a href="/default.asp?ML=22">Construction <br>& Engineering </a>');
            $(this).removeClass("one_on");
        }
        if ($(this).hasClass("two")) {
            $(this).html('<a href="/default.asp?ML=23">Liability <br>& Financial Lines </a>');
            $(this).removeClass("two_on");
        }
        if ($(this).hasClass("three")) {
            $(this).html('<a href="/default.asp?ML=35">Energy <br />& property</a>');
            $(this).removeClass("three_on");
        }
        if ($(this).hasClass("four")) {
            $(this).html('<a href="/default.asp?ML=25">Mining <br />& Natural Resources </a>');
            $(this).removeClass("four_on");
        }
        if ($(this).hasClass("five")) {
            $(this).html('<a href="/default.asp?ML=26">Captives <br />& Re-Insurance </a>');
            $(this).removeClass("five_on");
        }
        if ($(this).hasClass("six")) {
            $(this).html('<a href="/default.asp?ML=27">Marine Cargo </a>');
            $(this).removeClass("six_on");
        }
        if ($(this).hasClass("seven")) {
            $(this).html('<a href="/default.asp?ML=22">Credit <br>& Political Risk </a>');
            $(this).removeClass("seven_on");
        }
    }


    $(".accordion").hSlides({
        totalWidth: 910,
        totalHeight: 200,
        minPanelWidth: 110,
        maxPanelWidth: 248,
        midPanelWidth: 130,
        //easing: 'easeOutBounce',
        sensitivity: 1,
        interval: 50,
        timeout: 0,
        eventHandler: 'hover',
        onEnter: enterFunction,
        onLeave: leaveFunction
    });

    
});


$(document).ready(function() {



    $(".slideshow").cycle({ fx: 'fade', timeout: 8000, random: 1 });
    $(".slideshow").find("img").css("display", "block");

    $("#leftmenu ul li:first").addClass("first");

});

