$(document).ready(function(){


$('#navigation .contact a').click(function(){
	$('#contactForm').slideDown('slow');
	return false;
});


$('#contactForm .close a').click(function(){									
	$('#contactForm').slideUp('slow');
	return false;
});


        
$('.wpGallery').openDOMWindow({ 
width:900, 
positionTop:50, 
eventType:'click', 
windowSource:'iframe', 
loader:1, 
overlayOpacity: 70,
windowPadding: 0,
loaderImagePath:'animationProcessing.gif', 
loaderHeight:16, 
loaderWidth:17 
}); 

    
});

(function($) {
	$.fn.fullBg = function(){
		var bgImg = $(this);
		
		bgImg.addClass('fullBg');
		
		function resizeImg() {
			var imgwidth = bgImg.width();
			var imgheight = bgImg.height();
			
			var winwidth = $(window).width();
			var winheight = $(window).height();
			
			var widthratio = winwidth / imgwidth;
			var heightratio = winheight / imgheight;
			
			var widthdiff = heightratio * imgwidth;
			var heightdiff = widthratio * imgheight;
		
			if(heightdiff>winheight) {
				bgImg.css({
					width: winwidth+'px',
					height: heightdiff+'px'
				});
			} else {
				bgImg.css({
					width: widthdiff+'px',
					height: winheight+'px'
				});		
			}
		} 
		resizeImg();
		$(window).resize(function() {
			resizeImg();
		}); 
	};
})(jQuery)

jQuery(function($) {
	$("#background").fullBg();
});


$(document).ready(function() {

var showText="Read more [+]";
var hideText="Read less [-]";

$("#mainContent blockquote").prev().append(' <a href="#" class="moreLink">'+showText+'</a>');

$('#mainContent blockquote').hide();

$('a.moreLink').click(function() {

if ($(this).text()==showText) {
$(this).text(hideText);
}
else {
$(this).text(showText);
}

$(this).parent().next('#mainContent blockquote').toggle('slow');

// return false so any link destination is not followed
return false;

});
});


$(document).ready(function() {

var showText="Expand [+]";
var hideText="Contract [-]";

$("#mainContent ol").prev().append(' <a href="#" class="moreList">'+showText+'</a>');

$('#mainContent ol').hide();

$('a.moreList').click(function() {

if ($(this).text()==showText) {
$(this).text(hideText);
}
else {
$(this).text(showText);
}

$(this).parent().next('#mainContent ol').toggle('slow');

// return false so any link destination is not followed
return false;

});

});


