$.singlePageHandler = function () {
    if(this.nodeName.toLowerCase() == 'a') {
	    var href = this.href;
	    if($(this).hasClass('framed')) {
	       var width = 765;
	       var height = 525;
	       
	        if($(this).hasClass('news-item')) {
	            width = 500;
	            height = 460;
	        }
	        href = href + (href.match(/\?/) ? '&' : '?') + 'layout=framed';
		    Shadowbox.open( {
	            player: 'iframe',
	            content: href,
	            height:  height,
	            width:   width
	        });
        } else {
	        href = href + (href.match(/\?/) ? '&' : '?') + 'layout=ajax';
		    Shadowbox.open( {
	            player: 'ajax',
	            content: href,
                options: {
                    ajax: {
                        success: function ( data ) {
                            this.html = data;
                            this.ready = true;
                        }
                    }
                },
	            height:  535,
	            width:   765
	        });
        }
	    
	    return false;
    }
}
$(function() {
    Shadowbox.init({
        flvPlayer:'flash/flvplayer.swf',
        overlayColor: '#444',
        overlayOpacity: '0.3'
    });
});
