﻿jQuery(document).ready(function() {
   doLinks();
});

var currentheader = "";
var linksdone = 0;

function doLinks() {
	if (linksdone == 0) {
		linksdone = 1;
   $(".headerclass").hover(function() {
      $(this).addClass("headerhover");
   },function() {
      $(this).removeClass("headerhover");
   });
   $(".homelink").hover(function() {
      $(this).addClass("homelinkhover");
   },function() {
      $(this).removeClass("homelinkhover");
   });
   /*
   $("#headerimage").hover(function() {
      $(this).addClass("headerimagehover");
   },function() {
      $(this).removeClass("headerimagehover");
   });
   */
    displaylinks();
    displayWindow("hello.html","");
}
}

function displaylinks() {
	$("#aboutheading").click(function() {
		displayWindow("about.html", "#aboutheading");
	});
	$("#pastheading").click(function() {
		displayWindow("pastshows.html", "#pastheading");
	});
	$("#latestheading").click(function() {
		displayWindow("news.html", "#latestheading");
	});
	$("#contactheading").click(function() {
		displayWindow("contact.html", "#contactheading");
	});
	$("#photoheading").click(function() {
		displayWindow("gallery.html", "#photoheading");
	});
	/*
	$("#headerimage").click(function() {
		displayWindow("hello.html", "");
	});
	*/
}

function displayWindow(url, header) {
	if (currentheader != "") {
		$(currentheader).removeClass("headingselect");
	}
	currentheader = header;
	if (header != "") {
		$(header).addClass("headingselect");
	}
	$("#ajaxtext").load(url);
}

