/* Global jQuery document */

(function ($, window) {
    "use strict";
    var view; // object

    view = {
    
    	blogIframe : {
    	
    		init: function () {
    		
	    		$(".blog a").fancybox({
					'width'				: '75%',
					'height'			: '75%',
					'autoScale'			: false,
					'transitionIn'		: 'elastic',
					'transitionOut'		: 'elastic',
					'type'				: 'iframe'
				});
	    		
    		}
    	
    	
    	},
    	
    	
    	// News page
    	imgFullscreen : {
    		init: function () {
    		
    			var theWindow        = $(window),
             	$bg              = $('#news, #music, #live, #press, #contact'),
            	aspectRatio      = $bg.width() / $bg.height();

		        function resizeBg() {
		
		                if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
		                    $bg
		                        .removeClass()
		                        .addClass('bgheight');
		                } else {
		                    $bg
		                        .removeClass()
		                        .addClass('bgwidth');
		                }
		
		        }

		        theWindow.resize(function() {
		                resizeBg();
		        }).trigger("resize");

    		
    		}
    	
    	}


    }; // end view

    $(document).ready(function () {
        $.runInit(view);
    });


} ($, window));

