$(document).ready(function(){

    // $('#feature').hide(); //hide feature slides panel until intro completes fading out.

    // setTimeout(function () {
    //     $('#intro').fadeOut('slow', function () {
    //         // Animation complete.
    //         $('#feature').fadeIn('slow')
    //     });
    // }, 17000);

    $('#intro').slides({
        preload: true,
        preloadImage: 'images/loading.gif',
        generatePagination: false,
        effect: 'fade',
        fadeSpeed: 1000,
        play: 7000
    });

    $('#mosaic').hide(); //hide mosaic panel until intro completes fading out.
    setTimeout(function () {
        $('#intro').fadeOut('slow', function () {
            // Animation complete.
            $('#mosaic').fadeIn('slow')
        });
    }, 14000);

    //            $('#feature').slides({
    //                preload: true,
    //                preloadImage: 'images/loading.gif',
    //                generatePagination: false,
    //                effect: 'fade',
    //                fadeSpeed: 1000,
    //                play: 7000,
    //                pause: 1000,
    //                hoverPause: true
    //            });

    $('#people').slides({
        preload: true,
        preloadImage: 'images/loading.gif',
        effect: 'slide',
        slideSpeed: 800,
        slideEasing: 'easeInOutExpo',
        play: 7000,
        pause: 1000,
        hoverPause: true
    });

    $('#clients').slides({
        preload: true,
        preloadImage: 'images/loading.gif',
        effect: 'slide',
        slideSpeed: 800,
        slideEasing: 'easeInOutExpo',
        play: 7000,
        pause: 1000,
        hoverPause: true
    });

    $('#contact-slides').slides({
        preload: true,
        preloadImage: 'images/loading.gif',
        generatePagination: false,
        effect: 'fade',
        fadeSpeed: 1000,
        play: 7000,
        pause: 1000,
        hoverPause: true
    });

    $('.slideright').mosaic({
        animation: 'slide', //fade or slide
        hover_x: '156px', //Horizontal position on hover
        speed: 300
    });

    $('.slidedown').mosaic({
        animation: 'slide', //fade or slide
        anchor_y: 'top', 	//Vertical anchor position
        hover_y: '156px', //Vertical position on hover
        speed: 300
    });

    $('.slidecorner').mosaic({
        animation: 'slide', //fade or slide
        hover_x: '156px', //Horizontal position on hover
        hover_y: '156px', //Vertical position on hover
        speed: 300
    });

    $('.bar').mosaic({
        animation: 'slide'		//fade or slide
    });


    /* START Client tile flipping */
    /*
    //Disabling the flip pugin for now becuase this is not working for IE7
    $('.brandFlip').bind("click",function(){
		
    // $(this) point to the clicked .sponsorFlip element (caching it in elem for speed):
    var elem = $(this);
    // data('flipped') is a flag we set when we flip the element:
    if(elem.data('flipped'))
    {
    // If the element has already been flipped, use the revertFlip method
    // defined by the plug-in to revert to the default state automatically:
    elem.revertFlip();
    // Unsetting the flag:
    elem.data('flipped',false)
    }
    else
    {
    // Using the flip method defined by the plugin:
    elem.flip({
    direction:'lr',
    speed: 350,
    color: '#F9AA07',
    onBefore: function(){
    // Insert the contents of the .sponsorData div (hidden from view with display:none)
    // into the clicked .sponsorFlip div before the flipping animation starts:
					
    elem.html(elem.siblings('.brandData').html());
    }
    });
    // Setting the flag:
    elem.data('flipped',true);
    }
    });
    */

	/* START MAIL CLOAK */
		$(".email").each(function(){
			var ats, dots, address, i;
			ats = [ ' at ', ' (at) ', ' [at] ' ];
			dots = [ ' dot ', ' (dot) ', ' [dot] ' ];
			address = $(this).html();
			for ( i = 0; i < ats.length; i++ ) {
				address = address.replace(ats[i], '@');
			}
			for ( i = 0; i < dots.length; i++ ) {
				address = address.replace(dots[i], '.');
			}
			$(this).html('<a href="mailto:' + address + '">' + address + '</a>');
		});
	/* END MAIL CLOAK */
	
});

/* Pop-up for Job Opportunities link */
function openJobListing() {
	window.open("http://alcone.hodesiq.com","","width=600,height=580,top=50,left=150,scrollbars=yes");
}





















