function swap(prefix, id){
	var div = document.getElementsByTagName('div');
	for(i = 0; i < div.length; i++){
		if(div[i].getAttribute('rel')){
			if(div[i].getAttribute('rel').indexOf(prefix) != -1){
				if(div[i].getAttribute('rel') == prefix + "_" + id){
					div[i].style.display = '';
				}else{
					div[i].style.display = 'none';
				}
			}
		}
	}
	var href = document.getElementsByTagName('a');
	for(i = 0; i < href.length; i++){
		if(href[i].getAttribute('rel')){
			if(href[i].getAttribute('rel').indexOf(prefix) != -1){
				if(href[i].getAttribute('rel') == prefix + "_" + id){
					href[i].className = 'selected';
				}else{
					href[i].className = '';
				}
			}
		}
	}
}
function consequent(id, add){
	var div, current, related = new Array();
	div = document.getElementsByTagName('div');
	for(i = 0; i < div.length; i++){
		if(div[i].getAttribute('rel') == id){
			related[related.length] = div[i];
			if(div[i].style.display != 'none'){
				current = related.length - 1;
			}
		}
	}
	if(add > 0){
			current = (current + add >= related.length) ? 0 : current + add ;
	}else if(add < 0){
		current = (current + add < 0) ? related.length - 1 : current = current + add ;
	}
	for(i = 0; i < related.length; i++){
		related[i].style.display = 'none';
	}
	related[current].style.display = '';
}
function DateHoroscope(calendar){
	calendar.hide();
	var timestamp = parseInt(calendar.date.print('%s')) + parseInt(calendar.date.getTimezoneOffset() * 60);
	window.location = 'Horoscope.asp?Date=' + timestamp;
}
function DateWeather(calendar){
	calendar.hide();
	var timestamp = parseInt(calendar.date.print('%s')) + parseInt(calendar.date.getTimezoneOffset() * 60);
	window.location = 'Weather.asp?Date=' + timestamp;
}
function DateQuotes(calendar){
	calendar.hide();
	var timestamp = parseInt(calendar.date.print('%s')) + parseInt(calendar.date.getTimezoneOffset() * 60);
	window.location = 'Quotes.asp?Date=' + timestamp;
}
function DateDisallowAdvance(date){
	var now = new Date();
	now.setHours(0);
	now.setMinutes(0);
	now.setSeconds(0);
	now.setMilliseconds(0);
	date.setHours(0);
	date.setMinutes(0);
	date.setSeconds(0);
	date.setMilliseconds(0);
	if(date > now){
		return true;
	}
	return false;
}