$(document).ready(function() {
	if($(".rotator").length > 0){
		theRotator();
		$('div.rotator').fadeIn(1000);
		$('div.rotator ul li').fadeIn(1000); // tweek for IE
	}
	if($(".lightbox").length > 0){
		$(".lightbox").lightbox({
			fitToScreen: true,
			scaleImages: true,
			xScale: 1.2,
			yScale: 1.2,
			displayDownloadLink: true
		});
	}
	$("#postsContainer .postWrapper").first().addClass('first');
	$(".postWrapper:even").addClass('even');
	if($(".butRel").length > 0){
		$( ".butRel" ).mouseenter(function(){
			$(this).children('.butAbs').addClass("zindex");
			$(this).children('.butAbs').switchClass("hide", "show", 250);
		}).mouseleave(function(){
			$(this).children('.butAbs').removeClass("zindex");
			$(this).children('.butAbs').switchClass("show", "hide", 250);
		}); 
	} 
	if ($('#select-mail').length != 0) {
		var tmptxt = $("#select-mail option:selected").text();
		$("mailOpts").removeClass("show");
		if(tmptxt == "Yes") { $('#mailOpts').addClass("show"); }
		$('#select-mail').bind('change keyup',function () {
			$("#mailOpts").removeClass("show");
			var value = $(this).val();
			var thistext = $("#select-mail option:selected").text();
			if(value == 'Yes') { $('#mailOpts').addClass("show"); }else{ $('#mailOpts').removeClass("show"); }
		});
	}
	if($("#slideshow-container").length > 0){
		$('#slideshow-container').nivoSlider({
			effect: 'fade',
			animSpeed: 400,
			pauseTime: 6000,
			directionNav: true
		});
	}  
	$('ul#main-nav li.menu12 ul li ul ul li').has('ul').addClass("hasChildren");
	$('#main-nav > ul').hover(
		function() { $('ul', this).css('display', 'block'); },
		function() { $('ul', this).css('display', 'none'); }
	);
	$("#main-nav li").hover(
	  function () {
		$(this).addClass("hover");
	  },
	  function () {
		$(this).removeClass("hover");
	  }
	);
}); 
