function showEventsTab() {
	document.getElementById("tabs01").style.display = "";
	document.getElementById("tabs02").style.display = "none";
	document.getElementById("tabs03").style.display = "none";
}
function showPubsTab() {
	document.getElementById("tabs01").style.display = "none";
	document.getElementById("tabs02").style.display = "";
	document.getElementById("tabs03").style.display = "none";
}
function showContactsTab() {
	document.getElementById("tabs01").style.display = "none";
	document.getElementById("tabs02").style.display = "none";
	document.getElementById("tabs03").style.display = "";
}
function showBudget() {
	document.getElementById("treasure").style.display = "";
}
function hideBudget() {
	document.getElementById("treasure").style.display = "none";
}
function showPilots() {
	document.getElementById("pilots_master_list").style.display = "";
}
function hidePilots() {
	document.getElementById("pilots_master_list").style.display = "none";
}
if (document.images)
   {
     homeon= new Image(90,37);
     homeon.src="images/home_on.jpg";  
     multimediaon= new Image(91,37);
     multimediaon.src="images/multimedia_on.jpg"; 
	 linkson= new Image(92,37);
     linkson.src="images/links_on.jpg";  
     classifiedson= new Image(91,37);
     classifiedson.src="images/classifieds_on.jpg"; 
	 forumon= new Image(91,37);
     forumon.src="images/forum_on.jpg";  
     memberson= new Image(92,37);
     memberson.src="images/members_on.jpg";
	 buyeron= new Image(89,22);
     buyeron.src="images/buyer_on.jpg";  
     selleron= new Image(89,22);
     selleron.src="images/seller_on.jpg"; 

     homeoff= new Image(90,37);
     homeoff.src="images/home_off.jpg";
     multimediaoff= new Image(91,37);
     multimediaoff.src="images/multimedia_off.jpg"; 
	 linksoff= new Image(92,37);
     linksoff.src="images/links_off.jpg";
     classifiedsoff= new Image(91,37);
     classifiedsoff.src="images/classifieds_off.jpg"; 
	 forumoff= new Image(91,37);
     forumoff.src="images/forum_off.jpg";
     membersoff= new Image(92,37);
     membersoff.src="images/members_off.jpg";
	 buyeroff= new Image(89,22);
     buyeroff.src="images/buyer_off.jpg";  
     selleroff= new Image(89,22);
     selleroff.src="images/seller_off.jpg";
   }
function lightup(imgName)
 {
   if (document.images)
    {
      imgOn=eval(imgName + "on.src");
      document[imgName].src= imgOn;
    }
 }

function turnoff(imgName)
 {
   if (document.images)
    {
      imgOff=eval(imgName + "off.src");
      document[imgName].src= imgOff;
    }
 }

function roll(img_name, img_src){
	document[img_name].src = img_src;
}

function rollTabs(img_name, img_src){
	var str = (document[img_name].src);
	var buttonMode = (str.slice(-5));
	document[img_name].src = img_src;
// Events Tab
	if (buttonMode == "f.jpg" && img_name=="events"){
	roll('events', 'images/events_on.jpg');
	roll('pubs', 'images/pubs_off.jpg');
	roll('contact', 'images/contact_off.jpg');

	} else if (buttonMode == "n.jpg" && img_name=="events"){
	roll('events', 'images/events_on.jpg');
	roll('pubs', 'images/pubs_off.jpg');
	roll('contact', 'images/contact_off.jpg');
// pubs tab
	} else if (buttonMode == "f.jpg" && img_name=="pubs"){
	roll('events', 'images/events_off.jpg');
	roll('pubs', 'images/pubs_on.jpg');
	roll('contact', 'images/contact_off.jpg');

	} else if (buttonMode == "n.jpg" && img_name=="pubs"){
	roll('events', 'images/events_off.jpg');
	roll('pubs', 'images/pubs_on.jpg');
	roll('contact', 'images/contact_off.jpg');
// contact tab
	} else if (buttonMode == "f.jpg" && img_name=="contact"){
	roll('events', 'images/events_off.jpg');
	roll('pubs', 'images/pubs_off.jpg');
	roll('contact', 'images/contact_on.jpg');
	} else if (buttonMode == "n.jpg" && img_name=="contact"){
	roll('events', 'images/events_off.jpg');
	roll('pubs', 'images/pubs_off.jpg');
	roll('contact', 'images/contact_on.jpg');
	}
}

function showBig(img_name, img_src){
	document[img_name].src = img_src;
}

function showDiv(whichHide, whichShow){
	var hide = whichHide;
	var show = whichShow;
	document.getElementById(hide).style.display = "none";
	document.getElementById(show).style.display = "";
}
function ShowMessage(message){
	document.getElementById("messageSpan").innerHTML = message;
}

function toggleEvent(event){
	var whichEvent = event;

	if(document.getElementById(whichEvent).style.display == ''){
	document.getElementById(whichEvent).style.display = 'none';
	}else{
	document.getElementById(whichEvent).style.display = '';
	}
}
function openEventWindow(whichEvent){
	var EventURL = "events/"+(whichEvent)+".asp";
	window.open(EventURL, '', 'status=0, resizable=0, location=0, width=550, height=450, left=100, top=100');
}
function displayPost(whichForum){
	document.getElementById(whichForum).style.display = '';
}
function ClassifiedsSell(){
	document.getElementById('classifiedsSell').style.display = '';
	document.getElementById('classifiedsBuy').style.display = 'none';
}
function ClassifiedsBuy(){
	document.getElementById('classifiedsSell').style.display = 'none';
}

var interval = 4; // delay between rotating images (in seconds)
var random_display = 0; // 0 = no, 1 = yes
interval *= 1000;

var image_index = 0;
image_list = new Array();
//image_list[image_index++] = new imageItem("images/ss_home_01.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_02.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_03.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_04.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_05.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_06.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_07.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_08.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_09.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_10.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_11.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_12.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_13.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_14.jpg");
//image_list[image_index++] = new imageItem("images/ss_home_15.jpg");
image_list[image_index++] = new imageItem("images/ss_home_16.jpg");
image_list[image_index++] = new imageItem("images/ss_home_17.jpg");
image_list[image_index++] = new imageItem("images/ss_home_18.jpg");
image_list[image_index++] = new imageItem("images/ss_home_19.jpg");

var number_of_image = image_list.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}
function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
if (random_display) {
image_index = generate(0, number_of_image-1);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = get_ImageItemLocation(image_list[image_index]);
return(new_image);
}
function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
setTimeout(recur_call, interval);
}

