$(document).ready(function() {
	
	if($('#slides').length > 0) {
		$('#slides').slides({
				play: 4000,
				preload: true,
				generateNextPrev: true
			});
	}
		
	
	
	$(".showhideslide").each(function() {
		$(this).click(function() {
			
			rel = $(this).attr("rel");
			trg = $("#" + rel);
			
			if(trg.length > 0) {
				if(trg.is(":visible")) {
					$(trg).slideUp();
					$(this).removeClass("open");
				} else {
					$(trg).slideDown();
					$(this).addClass("open");
				}
				return false;
			}
			
		});
	});
	$(".showhide").each(function() {
		$(this).click(function() {
			
			rel = $(this).attr("rel");
			trg = $("#" + rel);
			
			if(trg.length > 0) {
				if(trg.is(":visible")) {
					$(trg).hide();
					$(this).removeClass("open");
				} else {
					$(trg).show();
					$(this).addClass("open");
				}
				return false;
			}
			
		});
	});
});


