

////////////////////////////////////////////

var topRightWhich = 0;
var wait = 5500;
var imgs_to_fade = new Array('hpmepg_right_1', 'hpmepg_right_2', 'hpmepg_right_3');

function swapTopRightImgs() {
	Effect.Fade(imgs_to_fade[topRightWhich], { duration:1, from:1.0, to:0.0 });
	topRightWhich++;
	if (topRightWhich == 3) topRightWhich = 0;
	Effect.Appear(imgs_to_fade[topRightWhich], { duration:1, from:0.0, to:1.0 });
}

function startUpImgSwaps() {
	setInterval('swapTopRightImgs()',wait);
}

////////////////////////////////////////////

function getRandomQuotes(howMany) {
	if($('dk_rotating_quotes')) {
		var myUrl = '/ajax/quotes.inc.php?howMany=' + howMany;
		if($F('returnInfo') != '') myUrl = myUrl + '&gotten=' + $F('returnInfo');
		new Ajax.Updater('dk_rotating_quotes', myUrl, {evalScripts:true});
	}
}

////////////////////////////////////////////

function printNewsItems(howMany, mode) {
	if($('ajax_news')) {
		var myUrl = '/ajax/news.inc.php?howMany=' + howMany + '&mode=' + mode;
		new Ajax.Updater('ajax_news', myUrl, {evalScripts:true});
	}
}

////////////////////////////////////////////

function slideNewsCarousel() {
	if($('carousel_slider')) {
		$('carousel_slider').style.width = (395 * newsCnt) + 'px';
		
		if(newsCurrent >= (newsCnt - 1)) {
			var slideTo = 0;
			newsCurrent = -1; //reset it
		} else {
			var slideTo = '-' + (newsCurrent + 1) * 395;
		}
		
		new Effect.Morph('carousel_slider', {
			style: 'left:' + slideTo + 'px;',
			duration: 0.8
		});
		
		newsCurrent++;
	}
}


