// JavaScript Document

// functions to change licks on mouseover

//topbar links
function topbarLinkIn(obj) {
	obj.style.color='#C0C0C0';
}

function topbarLinkOut(obj) {
	obj.style.color='#000000';
}

// Random comic selection
function randomComic(){
	var randNum = Math.random()*91;
	var randInt = Math.ceil(randNum);
	var comicPage = randInt + ".html"
	window.location="http://www.wrongwaycomics.com/" + comicPage; //"http://www.wrongwaycomics.com/"
}



// comicnav links (blinking arrow function)

// YOU CAN CONDENSE ALL THESE DOWN TO TWO FUNCTIONS BY PASSING PARAMETERS


var i = 0;
var b;


// random nav link

function randomLinkIn() {
	if (i==0) {
		document.getElementById('random').style.color='white';
		i=1;
	}
	else {
		document.getElementById('random').style.color='black';
		i=0;
	}
	b = setTimeout("randomLinkIn()",150); 
}

function randomLinkOut() {
	clearTimeout(b);
	document.getElementById('random').style.color='black';
}

// earliest nav link

function earliestLinkIn() {
	if (i==0) {
		document.getElementById('earliest').style.color='white';
		i=1;
	}
	else {
		document.getElementById('earliest').style.color='black';
		i=0;
	}
	b = setTimeout("earliestLinkIn()",150); 
}

function earliestLinkOut() {
	clearTimeout(b);
	document.getElementById('earliest').style.color='black';
}

// previous nav link
function previousLinkIn() {
	if (i==0) {
		document.getElementById('previous').style.color='white';
		i=1;
	}
	else {
		document.getElementById('previous').style.color='black';
		i=0;
	}
	b = setTimeout("previousLinkIn()",150); 
}

function previousLinkOut() {
	clearTimeout(b);
	document.getElementById('previous').style.color='black';
}

// next
function nextLinkIn() {
	if (i==0) {
		document.getElementById('next').style.color='white';
		i=1;
	}
	else {
		document.getElementById('next').style.color='black';
		i=0;
	}
	b = setTimeout("nextLinkIn()",150); 
}

function nextLinkOut() {
	clearTimeout(b);
	document.getElementById('next').style.color='black';
}

// Latest
function latestLinkIn() {
	if (i==0) {
		document.getElementById('latest').style.color='white';
		i=1;
	}
	else {
		document.getElementById('latest').style.color='black';
		i=0;
	}
	b = setTimeout("latestLinkIn()",150); 
}

function latestLinkOut() {
	clearTimeout(b);
	document.getElementById('latest').style.color='black';
}

// Dynamic onmouseover Archive Calendar ---------

function dayOn(obj) {
	obj.style.color="#F0F0F0";
	//document.getElementById("_1_5").style.backgroundColor="black";
	obj.parentNode.style.backgroundColor="black";
}

function dayOff(obj) {
	obj.style.color="black";
	//document.getElementById("_1_5").style.backgroundColor="#F0F0F0";
	obj.parentNode.style.backgroundColor="#F0F0F0";
}

//------------------------------------------------