$(document).ready(function() {
  $('#crop').show(function() {
	var t = this;
	var img = $('.NewsSummarySummary img');
	img.crop({ height: 170, width: 360 })
	return false;
  });
  /*$('#headlines_list').show(function() {
	var t = this;
	var img = $('.NewsSummarySummary img');
	img.crop({ height: 64, width: 64 })
	return false;
  });*/
});

//MENU NAVIGATIE

var name = "#menu, #menu_bg";  
var menuYloc = null;
$(document).ready(function(){  
    menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
    $(window).scroll(function () {  
        var offset = menuYloc+$(document).scrollTop()+"px";  
        $(name).animate({top:offset},{duration:500,queue:false});  
    });

$(window).scroll(function() {   
   if($(window).scrollTop() > 420) {
       $("#menu, #menu_bg").fadeOut(1100);
   } else {
     $("#menu, #menu_bg").fadeIn(1100);
   }
 });

/*$('.live_player').popupWindow({ 
	height:350, 
	width:750, 
	centerScreen:1
});*/


// POP-UP

$('a.live_player').popupWindow({ 
	height:450, 
	width:980, 
	centerScreen:1,
	showURL:0
});


//FOOTER NAVIGATIE

/*$("#footer .footer_img").hover(

  function () {
    $(this).addClass("hover");
  },
  function () {
    $(this).removeClass("hover");
  }
);*/


// hide #back-top first
//	$("#sidenav, #sidenav_bg").hide();
	
	// fade in #back-top
//	$(function () {
//		$(window).scroll(function () {
//			if ($(this).scrollTop() > 300) {
//				$('#sidenav, #sidenav_bg').fadeIn();
//			} else {
//				$('#sidenav, #sidenav_bg').fadeOut();
//			}
//		});

		// scroll body to 0px on click
//		$('#sidenav, #sidenav_bg a').click(function () {
//			$('body,html').animate({
//				scrollTop: 0
//			}, 800);
//			return false;
//		});
//	});

$('#headlines_list img').empty();
$('#toptien .een a').attr("target", "_blank");
$('#toptien .twee a').attr("target", "_blank");

$('#headlines_list img').removeAttr("width");
$('#headlines_list img').removeAttr("height");
$('#headlines_list img').attr("title", "Meer Nieuws - Krush Radio");
$('#headlines_list img').css("background-position","center center");

$('#headlines_page img').removeAttr("height");
$('#headlines_page img').removeAttr("width");
$('#headlines_page .headlines_main img').css("width","350px");
$('#headlines_page .headlines_main img').css("height","200px");

$('#headlines_page .headlines_sub img').css("width","280px");
$('#headlines_page .headlines_sub img').css("height","150px");

//$('#headlines_page .headlines_left img').css("width","69px");
//$('#headlines_page .headlines_left img').css("height","52px");

$('.person_box').append('<img src="/site_images/shadow_contact.png" class="nostyle" />');
$('.email_person').prepend('<img src="/site_images/email_contact.png" class="nostyle" />');
$('.twitter_person').prepend('<img src="/site_images/twitter_contact.png" class="nostyle" />');


});


