﻿// >> Global Startup
$(document).ready(function()
    {
        // Colorbox >>
        $("a[rel='comments']").colorbox({ iframe: true, innerWidth: 600, innerHeight: 500 });
        $("a[rel='getAdvice']").colorbox({ iframe: true, innerWidth: 600, innerHeight: 400 });
        $("a[rel='getQuote']").colorbox({ iframe: true, innerWidth: 600, innerHeight: 550 });
        $("a[rel='submitClaim']").colorbox({ iframe: true, innerWidth: 600, innerHeight: 550 });
        $("a[rel='disclaimer']").colorbox({ iframe: true, innerWidth: 550, innerHeight: 400 });
        $("a[rel='terms_and_conditions']").colorbox({ iframe: true, innerWidth: 600, innerHeight: 550 });
        $("a[rel='Patience-Sibulla']").colorbox({ iframe: true, innerWidth: 600, innerHeight: 550 });
        
        
        // Browser accommodation >>
        //        if($.browser.msie && $.browser.version=="6.0") {$("#banner_HTML").hide(); "#banner_IE").show(); }  

        //        if($.browser.msie && $.browser.version=="7.0") {$("#banner_HTML").hide(); "#banner_IE").show(); }

        //        if($.browser.msie && $.browser.version=="8.0") {$("#banner_HTML").hide(); "#banner_IE").show(); }

        //        if($.browser.msie && $.browser.version=="5.0") {$("#banner_HTML").hide(); "#banner_IE").show(); }

        //        if($.browser.msie && $.browser.version=="3.0") {$("#banner_HTML").hide(); "#banner_IE").show(); }
        //        
        //        if($.browser.msie && $.browser.version=="9.0") {$("#banner_HTML").show(); "#banner_IE").hide(); }


        //        if($.browser.msie) {} else {$("#banner_HTML").show(); "#banner_IE").hide(); }
        
        
        // Droppy >>
        $('#nav').droppy({ speed: 250 });
        $('#nav2').droppy({ speed: 250 });
        
        // Scroll To >>
        $('.ScrollTo_Top').click(
        function()
        {
            $.scrollTo("#container", {duration:1500});
	    });
	    
        $(function() {
            setInterval( "slideSwitch()", 5000 );
        });

    }); 
// >> Global Startup   

// >> Slide Show
function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}


//	    function slideSwitch() {

//            var $active = $('#slideshow img.active');
//            var $next = $active.next();    
//            
//            if ($next.length == 0)
//            {
//                $next = $("#slideshow img:first");
//            }
//                     
//            $next.addClass('active').fadeTo('fast', 1, function() {
//      // Animation complete.
//                });
//            $active.removeClass('active');
//            
//        }
         
// << Slide Show

