// JavaScript Documentfunction fadeImages() {	$('#mainPhoto1').delay(3000).fadeOut(5000, function() {		//alert("fade finished"); 	});}function checkFirstLoad() {		window.firstLoad++;	//alert("running firstLoad loadedImages ="+window.firstLoad);	if (window.firstLoad == 2) {		//alert("limit reached firstLoad ="+window.firstLoad);		$('.firstLoad').fadeIn(600);		window.imageCounter++;		var t = setTimeout ( "loadImages()", 5000 );		$('.mainColor').animate({backgroundColor:window.bgColor[window.colorCounter]}, 600);	}}window.wordsFunction = "theresMore2()";function changEffect() {	if (window.wordsFunction == "theresMore()") {		window.wordsFunction = "theresMore2()";	} else {		window.wordsFunction = "theresMore()";	}}function theresMore() {		var newDiv = $('<div>');		$('.wordOut').animate({"bottom": "+=80px"}, window.fadeSpeed, function() {				$(this).remove();			});		$(newDiv).addClass('theresMoreWord wordOut').append(window.theresMoreWord[window.theresMoreCounter]).appendTo('.theresMoreContainer').animate({"bottom": "-=80px"}, window.fadeSpeed, function() {				window.fadeSpeed = 1000;				window.theresMoreCounter++;				if (window.theresMoreCounter == window.theresMoreWord.length) {					window.theresMoreCounter = 0;				};				var w = setTimeout ( window.wordsFunction, 3000 );			});}function theresMore2() {		var newDiv = $('<div>');		$('.wordOut').animate({"left": "+=318px"}, window.fadeSpeed, function() {				$(this).remove();			});		$(newDiv).addClass('theresMoreWord wordOut').append(window.theresMoreWord[window.theresMoreCounter]).appendTo('.theresMoreContainer').animate({"left": "-=318px"}, window.fadeSpeed, function() {				window.fadeSpeed = 2000;				window.theresMoreCounter++;				if (window.theresMoreCounter == window.theresMoreWord.length) {					window.theresMoreCounter = 0;				};				var w = setTimeout ( window.wordsFunction, 4000 );			});}function theresMore3() {		$('.theresMoreWord').animate({"left": "+=322px"}, window.fadeSpeed, function() {				$(this).empty().append(window.theresMoreWord[window.theresMoreCounter]).animate({"left": "-=322px"}, window.fadeSpeed);				window.fadeSpeed = 1000;				window.theresMoreCounter++;				if (window.theresMoreCounter == window.theresMoreWord.length) {					window.theresMoreCounter = 0;				};				var w = setTimeout ( window.wordsFunction, 3000 );			});}function theresMore4() {		var newDiv = $('<div>');		$('.wordOut').animate({"left": "-=322px"}, window.fadeSpeed, function() {				$(this).remove();			});		$(newDiv).addClass('theresMoreWord wordOut').append(window.theresMoreWord[window.theresMoreCounter]).appendTo('.theresMoreContainer').animate({"left": "-=322px"}, window.fadeSpeed, function() {				window.fadeSpeed = 1000;				window.theresMoreCounter++;				if (window.theresMoreCounter == window.theresMoreWord.length) {					window.theresMoreCounter = 0;				};				var w = setTimeout ( window.wordsFunction, 3000 );			});}function loadImage() {	var loadedCheck = 0;	var newDiv = $('<div>');	$(newDiv).hide().addClass('mainPhotoContainer photoOut');	var img = new Image();		function checkLoadedLocal() {		loadedCheck++;		if (loadedCheck == 2) {			$('#mainPhoto').append(newDiv);			$(newDiv).fadeIn(600);			$('.mainColor').animate({backgroundColor:window.bgColor[window.colorCounter]}, 600);			$('.headerLinks').animate({color:window.aLinks[window.colorCounter]}, 600);			$('body').animate({color:window.bodyTextColor[window.colorCounter]}, 600);			$('.titleColor').animate({color:window.titleTextColor[window.colorCounter]}, 600);			$('.groupListListTitle').animate({color:window.highlightTextColor[window.colorCounter]}, 600);			$('.groupListListTitleGroup').animate({color:window.highlightTextColor[window.colorCounter]}, 600);			// uncomment line below to turn on theres more			//theresMore2();			//$('.bracketColor').animate({borderLeftColor:window.titleTextColor[window.colorCounter]}, 600).animate({borderTopColor:window.titleTextColor[window.colorCounter]}, 600).animate({borderBottomColor:window.titleTextColor[window.colorCounter]}, 600);			window.imageCounter++;			var t = setTimeout ( "loadImages()", 5000 );		};	}		$(img).load(function () {		$(newDiv).prepend(this);		checkLoadedLocal();	}).addClass('mainPhotoImage').attr('src', window.imagesMain[window.imageCounter]);		var contentHeight = document.getElementById('mainContentContainer').offsetHeight;	if (contentHeight > 557) {		var fadeImg = new Image();				$(fadeImg).load(function () {			$(newDiv).append(this);			checkLoadedLocal();		}).addClass('mainPhotoFade').attr('src', window.imagesFade[window.imageCounter]);	} else {		checkLoadedLocal();	}		if ( !$.browser.msie ) {			$('.boxBack').each(function(index,el){			var boxImg = new Image();			$(boxImg).hide().attr('src', window.boxBack[window.imageCounter]).addClass('boxBackImage photoOut').load(function () {				$(el).append(this);				$(this).fadeIn(600);				});		});	}}function loadImages() {	var newDiv = $('<div>');	$(newDiv).hide().addClass('mainPhotoContainer photoIn');	$('#mainPhoto').append(newDiv);	var img = new Image();		$(img).load(function () {		$(newDiv).prepend(this);		checkLoaded();	}).addClass('mainPhotoImage').attr('src', window.imagesMain[window.imageCounter]);		var contentHeight = document.getElementById('mainContentContainer').offsetHeight;	if (contentHeight > 557) {		var fadeImg = new Image();				$(fadeImg).load(function () {			$(newDiv).append(this);			checkLoaded();		}).addClass('mainPhotoFade').attr('src', window.imagesFade[window.imageCounter]);	} else {		checkLoaded();	}		if ( !$.browser.msie ) {		$('.boxBack').each(function(index,el){			var boxImg = new Image();			$(boxImg).hide().attr('src', window.boxBack[window.imageCounter]).addClass('boxBackImage boxPhotoIn').load(function () {				$(el).append(this);				checkLoaded();				});		});	} else {		checkLoaded();		checkLoaded();		checkLoaded();	}}function checkLoaded() {	window.loadedImages++;	//alert("running checkLoaded loadedImages ="+window.loadedImages);	if (window.loadedImages == 5) {		//alert("limit reached loadedImages ="+window.loadedImages);		window.loadedImages = 0;		window.imageCounter++;		if (window.imageCounter == window.imagesMain.length) {			window.imageCounter = 0;		}		window.colorCounter++;		if (window.colorCounter == window.imagesMain.length) {			window.colorCounter = 0;		}		swapImages();	}}function swapImages() {	//alert("running swapImages");	$('.photoOut').fadeOut(7000, function() {			$(this).remove();		});	$('.photoIn').fadeIn(7000, function() {		}).addClass('photoOut').removeClass('photoIn');	$('.mainColor').animate({backgroundColor:window.bgColor[window.colorCounter]}, 7000);	$('.headerLinks').animate({color:window.aLinks[window.colorCounter]}, 7000);	$('body').animate({color:window.bodyTextColor[window.colorCounter]}, 7000);	$('.titleColor').animate({color:window.titleTextColor[window.colorCounter]}, 7000);	$('.groupListListTitle').animate({color:window.highlightTextColor[window.colorCounter]}, 7000);	$('.groupListListTitleGroup').animate({color:window.highlightTextColor[window.colorCounter]}, 7000);	//$('.bracketColor').animate({borderLeftColor:window.titleTextColor[window.colorCounter]}, 7000).animate({borderTopColor:window.titleTextColor[window.colorCounter]}, 600).animate({borderBottomColor:window.titleTextColor[window.colorCounter]}, 600);	if ( !$.browser.msie ) {		$('.boxPhotoIn').fadeIn(7000).addClass('photoOut').removeClass('photoIn');	}	var l = setTimeout ( "loadImages()", 12000 );}function resizeSidebar() {	if (document.getElementById('sidebarMiddle')!==null && document.getElementById('mainContentMiddle')!==null) {		var contentHeight = document.getElementById('mainContentMiddle').offsetHeight;		var sidebarHeight = document.getElementById('sidebarMiddle').offsetHeight;		//alert('contentHeight = '+contentHeight+' sidebarHeight = '+sidebarHeight);		if (contentHeight > sidebarHeight) {			//alert('running resize');			document.getElementById('sidebarMiddle').style.height = contentHeight-13+"px";		}	}}function addFade() {	var img = new Image();	var newDiv = $('<div>');		$(img).load(function () {		$(newDiv).hide().addClass('mainContentContainerFade photoIn').css("background-image", "url("+window.imagesFade[window.imageCounter]+")")		$('#mainContentContainer').prepend(newDiv);		//checkLoaded();	}).attr('src', window.imagesFade[window.imageCounter]);}function chechForFade() {	var contentHeight = document.getElementById('mainContentContainer').offsetHeight;	//alert('contentHeight = '+contentHeight);	if (contentHeight > 557) {		//alert('adding fade');		//document.getElementById('mainContentContainer').style.backgroundImage="url(/images/color-fade1.png)";	}}function hoverButtons(num) {	$('#button'+num).hover(	  function() {	    $('#slide'+num+'Container').stop(true, true)		.css('height', 401) 		.slideDown(500);  		},	  function() {	    $('#slide'+num+'Container').stop(true, false)		.slideUp(1000);	  }	);}function MM_effectAppearFade(targetElement, duration, from, to, toggle){	Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});}function fadeMenu(menuID) {	MM_effectAppearFade(menuID, 500, 100, 0, false);	//setTimeout( "document.getElementById(\'searchOptionsExpanded\').style.display='none';", 700);}function clearText(theText) {     if (theText.value == theText.defaultValue) {         theText.value = ""     } } function clearCheck(checkboxField) {	 if (checkboxField == 'all' || (document.formSearchOptions.selectFrom[1].checked == 1 && document.formSearchOptions.selectFrom[2].checked == 1 && document.formSearchOptions.selectFrom[3].checked == 1 && document.formSearchOptions.selectFrom[4].checked == 1 && document.formSearchOptions.selectFrom[5].checked == 1)) {	 	document.formSearchOptions.selectFrom[1].checked = false;		document.formSearchOptions.selectFrom[2].checked = false;		document.formSearchOptions.selectFrom[3].checked = false;		document.formSearchOptions.selectFrom[4].checked = false;		document.formSearchOptions.selectFrom[5].checked = false;		document.formSearchOptions.selectFrom[0].checked = true;	 } else {	 	document.formSearchOptions.selectFrom[0].checked = false;	 } } var searchArrow = "up";function changeSearchArrow() {	if (window.searchArrow == 'up') {		document.getElementById("searchOptions").style.backgroundPosition = "right -23px";		window.searchArrow = "down";	} else if (window.searchArrow == 'down') {		document.getElementById("searchOptions").style.backgroundPosition = "right 0px";		window.searchArrow = 'up';	} 	}function MM_effectSlide(targetElement, duration, from, to, toggle){	Spry.Effect.DoSlide(targetElement, {duration: duration, from: from, to: to, toggle: toggle});}function breakout_of_frame() {  if (top.location != location) {    top.location.href = document.location.href ;  }}
