$(window).load(function () {
	// Pop Up
	function popitup(url) {
		newwindow=window.open(url,'name','height=178,width=360');
		if (window.focus) {newwindow.focus()}
		return false;
	}
	function popitupagain(url) {
		newwindow=window.open(url,'name','height=600,width=470');
		if (window.focus) {newwindow.focus()}
		return false;
	}
	// Photos
	$("#photos .entry, #tourPhotos .entry").each(function(){
		var imgCenter = ($(this).height() - $(this).find('img').height()) / 2;
		$(this).find("a").css({
			width: $(this).find('img').width()
		});
		$(this).find(".image").css({
			width: $(this).find('img').width()+10,
			height: $(this).find('img').height()+10,
			marginTop:imgCenter + "px"
		});
		
		$(this).find(".image").hover(function(){
			$(this).find(".toolTip").css({
				display: "block",
				top: -$(this).find(".toolTip").height() + imgCenter - 15
			});
			
		}, function() {
			$(this).find(".toolTip").css("display", "none");
		});
	});
	
	// Fixes if hovered over the info div
	$("#photos .entry .image .toolTip, #tourPhotos .entry .image .toolTip").mouseover(function () {
			$(this).css("display", "none");
	  });
	// Component NewsAlt 
	$('#newsAlt ul li.entry:last-child').addClass('noBorder');
	$('#twitter .tweets li:last-child').addClass('noBorder');
	
	//Socialbar - small version
	$('#news .entry ul.socialLinks').each(function() {
		$(this).removeClass('large');									   
	});
	
});
