/////////////// Add border radius
 
 $(document).ready(function() {
            //opera cannot use :hasBorderRadius.   Use normal selectors insteadthe radius settings are required for Opera, otherwise the values are taken from the CSS.
            $(".box").radius({radius: {topleft: "8px", topright: "8px", bottomleft: "8px", bottomright: "8px"}});
        });

/////////////// Add colorbox to links with or contain colorbox class
 
 $(document).ready(function() {
            $("a.hosted-video").colorbox({inline:true});
            $(".colorbox").colorbox();
 });
 
 /////////////// Add play image
 
 $(window).load(function() {
     $("a.play").each(function(index){
        var img = $(this).children('img');
        var top = (img.height()/2)-25+6; // 25 is half play.png height/width
        var left = (img.width()/2)-25+6; // 6 is border width
        $(this).append("<img src='http://www.cineon-productions.com/wp-content/themes/cineon/images/play.png' style='position:absolute;top:"+top+"px;left:"+left+"px;border:0px;' />");
     });
 });

/////////////// Add animated navigation

        $(document).ready(function () {
            slide("#mainNav ul", 10, 0, 150, .8);
        });

        function slide(navigation_id, pad_out, pad_in, time, multiplier) {
            // creates the target paths
            var list_elements = navigation_id + " li";
            var link_elements = list_elements + " a";
            
            // stripe alternate items
            //$(list_elements+':odd a').css('color', '#00A7CB');
            
            // orange news link
            //$(list_elements+':last-child a').css({'color':'#fff200', 'margin-top':'10px'});

            // initiates the timer used for the sliding animation
            var timer = 0;
            
            // creates the hover-slide effect for all link elements 		
            $(link_elements).each(function (i) {
                $(this).hover(
		function () {
		    $(this).animate({paddingLeft: pad_out}, 150);
		},
		function () {
		    $(this).animate({paddingLeft: pad_in}, 150);
		});
            });
 }           
 
/////////////// Positioning of projects in archive
    
    $(function(){        
        $('.post-type-archive-project .box #content .project').each(function(i) {
            if(i % 3 == 0) {
                $(this).css('marginLeft', '-1px') 
            };
        });
    });
