/* 
	hack to keep netscape happy (or at least quiet) when it encounters rollovers in divs
*/



// Preload the on states of the tabs for quicker response

image_hoax = new Image();
image_hoax.src = "http://www.kilmartin.com/img_home/nav_hoax_ON.gif";

image_video = new Image();
image_video.src = "http://www.kilmartin.com/img_home/nav_video_ON.gif";

image_writing = new Image();
image_writing.src = "http://www.kilmartin.com/img_home/nav_writing_ON.gif";

image_lappool = new Image();
image_lappool.src = "http://www.kilmartin.com/img_home/nav_lappool_ON.gif";

image_yearbook = new Image();
image_yearbook.src = "http://www.kilmartin.com/img_home/nav_yearbook_ON.gif";

image_spots = new Image();
image_spots.src = "http://www.kilmartin.com/img_home/nav_spots_ON.gif";

image_bio = new Image();
image_bio.src = "http://www.kilmartin.com/img_home/nav_bio_ON.gif";

image_contact = new Image();
image_contact.src = "http://www.kilmartin.com/img_home/nav_contact_ON.gif";

// Pass in the random frequencies of the tabs

var hoax_freq = 10; 
var video_freq = 20; 
var writing_freq = 30; 
var lappool_freq = 40; 
var yearbook_freq = 50; 
var spots_freq = 60; 
var bio_freq = 70; 
var contact_freq = 80;
var hoax_freq = 100;


// Pass in the URL of the image which should appear on each tab




// Random Equation which determines which tab to show
var randomColoredTab;
var randomColoredSeed = Math.ceil(100*Math.random(100));
if (randomColoredSeed <= hoax_freq) {
randomColoredTab = 'hoax';
} else if (randomColoredSeed <= video_freq) {
randomColoredTab = 'video';
} else if (randomColoredSeed <= writing_freq) {
randomColoredTab = 'writing';
} else if (randomColoredSeed <= lappool_freq) {
randomColoredTab = 'lappool';
} else if (randomColoredSeed <= yearbook_freq) {
randomColoredTab = 'yearbook';
} else if (randomColoredSeed <= spots_freq) {
randomColoredTab = 'spots';
} else if (randomColoredSeed <= bio_freq) {
randomColoredTab = 'bio';
} else if (randomColoredSeed <= contact_freq) {
randomColoredTab = 'contact';
} else {
randomColoredTab = 'hoax';
}

// Function which actually swaps tabs
function changeColoredTab (tabname) {
document.getElementById('tab_hoax').style.display = 'none';
document.getElementById('tab_video').style.display = 'none';
document.getElementById('tab_writing').style.display = 'none';
document.getElementById('tab_lappool').style.display = 'none';
document.getElementById('tab_yearbook').style.display = 'none';
document.getElementById('tab_spots').style.display = 'none';
document.getElementById('tab_bio').style.display = 'none';
document.getElementById('tab_contact').style.display = 'none';
document.getElementById('tab_'+tabname).style.display = 'block';

document.getElementById('tabnav_hoax').src = 'http://www.kilmartin.com/img_home/nav_hoax.gif';
document.getElementById('tabnav_video').src = 'http://www.kilmartin.com/img_home/nav_video.gif';
document.getElementById('tabnav_writing').src = 'http://www.kilmartin.com/img_home/nav_writing.gif';
document.getElementById('tabnav_lappool').src = 'http://www.kilmartin.com/img_home/nav_lappool.gif';
document.getElementById('tabnav_yearbook').src = 'http://www.kilmartin.com/img_home/nav_yearbook.gif';
document.getElementById('tabnav_spots').src = 'http://www.kilmartin.com/img_home/nav_spots.gif';
document.getElementById('tabnav_bio').src = 'http://www.kilmartin.com/img_home/nav_bio.gif';
document.getElementById('tabnav_contact').src = 'http://www.kilmartin.com/img_home/nav_contact.gif';

document.getElementById('tabnav_'+tabname).src = 'http://www.kilmartin.com/img_home/nav_'+tabname+'_ON.gif';
//document.getElementById('logo_'+tabname).src = eval(tabname+'logo');
}
