$(document).ready(function() {
	//Replace <h1> contents with flash
	sIFR.activate();
	sIFR.replace({src: '/flash/helvetica-neue.swf'}, {
		elements: $('h1'),
		wmode: 'transparent',
		css: {
			'.sIFR-root': {
				'color': '#FFFF00',
				'text-transform': 'uppercase'
			}
		},
		tuneHeight: -4,
		offsetTop: 2
	});
	// CYCLE
	$('#blog_cycle').cycle({
		fx: 'scrollHorz',
		speed: 800,
		pager: '#cycle_pager',
        prev:    '#cycle_prev',
        next:    '#cycle_next',
        pagerAnchorBuilder: pagerFactory
	});
    function pagerFactory(idx, slide) {
		var s = idx > 2 ? ' style="display:none"' : '';
        return '<a href="#"'+s+' class="blog_cycle_link">'+(idx+1)+'</a></li>';
    };
	$('#blog_cycle').cycle('pause');
	if ($("#cycle_pager").children().length > 1) {
		$("#cycle_prev").css('display', 'block');
		$("#cycle_next").css('display', 'block');
	}
	$(".social_e").click(function(){
		var id = $(this).attr('rel');
		sendafriend = window.open("/index.php?readmore=sendafriend&id="+id,"sendafriend","location=0,status=0,scrollbars=0,width=450,height=330,resizable=0");
		sendafriend.moveTo(((screen.width-450)/2),((screen.height-330)/2));
	});
});