// Sitewide JavaScript file

function tabSwitch(new_tab, new_content) {
	
	document.getElementById('content_1').style.display = 'none';
	document.getElementById('content_2').style.display = 'none';
	document.getElementById('content_3').style.display = 'none';
	document.getElementById('content_4').style.display = 'none';
	document.getElementById('content_5').style.display = 'none';
	document.getElementById(new_content).style.display = 'block';	
	

	document.getElementById('tab_1').className = '';
	document.getElementById('tab_2').className = '';
	document.getElementById('tab_3').className = '';
	document.getElementById('tab_4').className = '';
	document.getElementById('tab_5').className = '';
	document.getElementById(new_tab).className = 'active';		

}

function open_htmlguide()
{
window.open("../admin/html-guide.htm","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width=650, height=580")
}

var today = new Date();
var thisYear = today.getFullYear();

// Random image selector (contact form)

var theImages = new Array()

theImages[0] = 'images/captcha-order_01.png'
theImages[1] = 'images/captcha-order_02.png'
theImages[2] = 'images/captcha-order_03.png'
theImages[3] = 'images/captcha-order_04.png'
theImages[4] = 'images/captcha-order_05.png'
theImages[5] = 'images/captcha-order_06.png'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'" height="50" width="150" alt="Type the characters you see in this image into the box below" style="margin-left: 30px;" />');
}

// JQuery toggle function
$(document).ready(function()
{
  $(".answer").hide();
  $("h2").click(function()
  {
    $(this).next(".answer").slideToggle(600);
  });
});



