// JavaScript Document

 var $j = jQuery.noConflict();


$j(document).ready(function() {
$variables = [];

        $j(document).pngFix(); 

$j('#photos-week').hide(function() {
	$j('#news').find('.textNews ul').find('li:first').css({border: 'none'});
	var imgToMend = $j('.flickrd').find('.small-feature a').find('img');
	imgToMend.removeAttr('width').removeAttr('height').hide(function() {
	var featureLink = $j('.flickrd').find('.small-feature a').find('img');
	var lastDot =featureLink.attr('src').substr(0, featureLink.attr('src').lastIndexOf('.'));
	lastDot = lastDot + "_m.jpg";
	featureLink.attr('src', lastDot).show(function() {
		$j('#photos-week').slideDown();
	});
})
	
});

//console.log($j(".background-note span").html());

	$j('body').css({'background' : 'url('+$j(".background-note span").html()+') no-repeat top left fixed'});




$j('.flickr_badge_image').find('img').each ( function() {
		$variables['imageHeight'] = $j(this).height();
		$variables['imageWidth'] = $j(this).width();
$j(this).before("<div class='imageRollOverLatest'></div>");
$j('.imageRollOverLatest').css({height: $variables['imageHeight'], width: $variables['imageWidth'], display: 'block', opacity:'0.0'});
});




$j('div.cross-link').each ( function() {
		$variables['imageHeight'] = $j(this).height();
		$variables['imageWidth'] = $j(this).width();
$j(this).before("<div class='cross-sell-overlay'></div>");
$j('.cross-sell-overlay').css({height: $variables['imageHeight'], width: $variables['imageWidth'], display: 'block', opacity:'0.0'});
//$j('.cross-sell-overlay').click(function() {
$j(this).parent().find('.cross-sell-overlay').click(function() {
	window.location = ($j(this).parent().find('.cross-link a.follow').attr('href'));
});

$j('.cross-sell-overlay').hover(function() { $j(this).css({ cursor: "pointer"}); });

});



$j('.imageRollOverLatest, .cross-sell-overlay').hover(function() {
			$j(this).fadeTo(100, .3);
		}, function() { 
			$j(this).fadeTo(100, .0);
		});



})

/*
window.onload = function() {

}*/

