$(document).ready(function(){

		$('a.jqLightbox').lightBox();

		$("button#protected").click( function() {

			$("div#restrictedUError").hide();
			$("div#restrictedPError").hide();
			$('#loginMsg').html("");

			var fCheck = true;

			if ( $("input[name='restrictedU']").val() == "" ) {
				$("div#restrictedUError").fadeIn("slow");
				fCheck = false;
			}
			if ( $("input[name='restrictedP']").val() == "" ) {
				$("div#restrictedPError").fadeIn("slow");
				fCheck = false;
			}

			if (fCheck) {

				var submitStr = "secureParent=" + $("input[name='secureParent']").val() + "&protect_id=" + $("input[name='protect_id']").val() + "&lookFor=" + $("input[name='lookFor']").val() + "&username=" + $("input[name='restrictedU']").val() + "&password=" + $("input[name='restrictedP']").val() + "";

				$('#loginMsg').load('modules/secure-page-login.php?' + submitStr);
			}

		});


//				$("a#selectNews").click( function() {
//
//					$("a#selectNews").css('font-weight','normal');
//					$(this).css('font-weight','bold');
//
//					$("#newsList-wrapper").fadeOut();
//					$("#galleryList-wrapper").fadeOut();
//					$("#videoList-wrapper").fadeOut();
//
//					$("#" + $(this).attr("rel")).fadeIn();
//
//					return false;
//				});

		$("a.selectNews").click( function() {

			$("a#selectNews").css('font-weight','normal');
			$(this).css('font-weight','bold');

			$("#newsList-wrapper").fadeOut();
			$("#galleryList-wrapper").fadeOut();
			$("#videoList-wrapper").fadeOut();

			$("#" + $(this).attr("rel")).fadeIn();

			return false;
		});




		// TIMERS FOR CONTENT ROTATORS
//				$(document).everyTime('10s', function(i) {

//					currNewsItem++;
//					if ( currNewsItem > 5 ) { currNewsItem = 0;}
//					setNewsItem(currNewsItem);

//				}, 0);







		$("a").click( function() {

			var itemName	= $(this).attr("name");
			var itemLink	= $(this).attr("link");
			var itemClass	= $(this).attr("class");
			var itemTitle	= $(this).attr("title");
			var itemRel		= $(this).attr("rel");

			if ( itemName == "feature" ) {
				document.location.href = itemLink;
				return false;
			}


			if ( itemClass == "groupSelector" ) {

				$("div[id^='content-" + itemRel + "']").fadeOut('slow');
				$("div#content-" + itemRel + "-" + itemTitle).fadeIn('slow');

				$("a.groupSelector").each(function() {
					if ( $(this).attr("rel") == itemRel ) {
						$(this).css('font-weight', 'normal');
					}
				});

				$(this).css('font-weight', 'bold');

				return false;
			}


		});






 });


