function OnLoad() {
  new CSEOverlay("009366206396355254731:s6wqj2dsn7o",
				 document.getElementById("searchbox_009366206396355254731:s6wqj2dsn7o"),
				 document.getElementById("results_009366206396355254731:s6wqj2dsn7o"));
}
GSearch.setOnLoadCallback(OnLoad);

function check_add_form() {
    var okSoFar=true //-- Changes to false when bad field found.
	var x = document.getElementById("EMAIL").value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!(filter.test(x)) && okSoFar) {okSoFar = false; alert('Incorrect email address'); document.getElementById("EMAIL").focus();return false;}
	//-- If all fields OK go ahead and submit the form and put up a message.
	if (okSoFar==true) {
		//-- The statement below actually submits the form, if all OK.
		document.getElementById("subscribe_add").action="/key2/newsletter_insert_new.asp"
		document.getElementById("subscribe_add").submit()
	}

}

//execute fadein start, initialise main content slider
		jQuery(window).bind("load", function() {
		//$('div#header-wrap,div#content-wrapper,div#footer-wrapper').fadeIn('slow'); 
		//$('div#content-wrapper').fadeIn('slow'); 
		//$('div#footer-wrapper').show('slow'); 		
			jQuery("div#main_slider").codaSlider()
			// jQuery("div#slider2").codaSlider()
			// etc, etc. Beware of cross-linking difficulties if using multiple sliders on one page.
		});
$(document).ready(function() {
//$('div.main_slider').hide();
// setting the tabs in the sidebar hide and show, setting the current tab
	$('div.tabbed div.tabcontent').hide();
	$('div.t1').fadeIn();
	$('div.tabbed ul.tabs li.t1 a').addClass('tab-current');

// SIDEBAR TABS
$('div.tabbed ul li a').click(function(){
	var thisClass = this.className.slice(0,2);
	$('div.tabbed div.tabcontent').hide();
	$('div.' + thisClass).fadeIn();
	$('div.tabbed ul.tabs li a').removeClass('tab-current');
	$(this).addClass('tab-current');
	});
});
//init. main menu dropdowns
var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;

function jsddm_open()
{  jsddm_canceltimer();
   jsddm_close();
   //ddmenuitem = $(this).find('ul').slideDown('slow');
   ddmenuitem = $(this).find('ul').css('visibility', 'visible');
   $(".google-search .hide").css({ visibility: "hidden" });
   }

function jsddm_close()
{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
   $(".google-search .hide").css({ visibility: "visible" });
   }

function jsddm_timer()
{  closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{  $('#jsddm > li').bind('mouseover', jsddm_open)
   $('#jsddm > li').bind('mouseout',  jsddm_timer)});

document.onclick = jsddm_close;



function hidediv(pass) {
var divs = document.getElementsByTagName('div');
for(i=0;i<divs.length;i++){
if(divs[i].id.match(pass)){//if they are 'see' divs
if (document.getElementById) // DOM3 = IE5, NS6
divs[i].style.display="none";// show/hide

else
if (document.layers) // Netscape 4
document.layers[divs[i]].display = 'hidden';
else // IE 4
document.all.hideshow.divs[i].visibility = 'hidden';
}
}
}

function showdiv(pass) {
var divs = document.getElementsByTagName('div');
for(i=0;i<divs.length;i++){
if(divs[i].id.match(pass)){
if (document.getElementById)
divs[i].style.display="block";
else
if (document.layers) // Netscape 4
document.layers[divs[i]].display = 'visible';
else // IE 4
document.all.hideshow.divs[i].visibility = 'visible';
}
}
}
//google tracking
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-322983-2");
pageTracker._trackPageview();
} catch(err) {}