//Plug-in for jQuery animation on links
(function($){
    $.fn.extend({
    //plugin name - emoryExplore
        emoryExplore: function(options) {
            return this.each(function() {
                //Assign current element to variable, in this case is div element
                var obj = $(this);
                $("div.exploreEmoryjQuerylink", obj).hover(
                    function () { 
                        $(this).stop(true, true).animate({color:'#dab000',fontSize:'1.3500em'}, 250);
                        $(this).find("div.exploreEmoryjQueryarrow").stop(true, true).show('slide', {direction: 'right'}, 250);
                        
                        if($.isiOS == true){console.log('iOS trigger');$(this).find("a").trigger('click');}
                            }
                            ,
                    function () { 
                            $(this).stop(true, true).animate({color:'#ffffff',fontSize:'1.2500em'}, 250);
                            $(this).find("div.exploreEmoryjQueryarrow").stop(true, true).hide('slide', {direction: 'right'}, 250); 
                            }
                        );
 
            });
        }
    });
})(jQuery);
//Function for animating intro of blue bar and add listener added to the root scope of the $ jquery alias 
$.emoryExploreInit = function() {
$('#exploreEmoryjQuerybackground').delay(1500).animate({height:'62px'},1500,
function()
     {     
           $('#exploreEmoryjQuerylinktext1').css({'opacity': 0.0});
           $('#exploreEmoryjQuerylinktext1').animate({'opacity': 1.0},1000);
           $('#exploreEmoryjQuerylink1').show('slide', {direction: 'left'}, 1000,
             function()
                 {
                      $('#exploreEmoryjQuerylinktext2').css({'opacity': 0.0});
                      $('#exploreEmoryjQuerylinktext2').animate({'opacity': 1.0},1000);
                      $('#exploreEmoryjQuerylink2').show('slide', {direction: 'left'}, 1000,
                        function()
                           {
                              $('#exploreEmoryjQuerylinktext3').css({'opacity': 0.0});
                              $('#exploreEmoryjQuerylinktext3').animate({'opacity': 1.0},1000);
                              $('#exploreEmoryjQuerylink3').show('slide', {direction: 'left'}, 1000);
                                
                           }
                      );
                 }
             ); 
     }
);    
$('#exploreEmoryjQuerycontainer').emoryExplore();
}

//Set jQuery var about iOS device

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))){
    $.isiOS = true;
    try{console.log('iOS device detected.');} catch(err){};
} else {
    $.isiOS = false;
    try{console.log('iOS device not detected.');} catch(err){};
}

