<!--startList=function(){if(document.all&&document.getElementById){navRoot=document.getElementById("nav");for(i=0;i<navRoot.childNodes.length;i++){node=navRoot.childNodes[i];if(node.nodeName=="LI"){node.onmouseover=function(){this.className+=" over"}node.onmouseout=function(){this.className=this.className.replace(" over","")}}}}}window.onload=startList;



/* SEMINAR POPUP */
function closeMenuBottom(func)
{
if ($('div#seminar_register').css('display') == 'block')
{
$('div#seminar_register').slideUp('slow', func);
}
else
{
if (func != null) func();
}
};
function openMenuBottom(func)
{
if ($('div#seminar_register').css('display') == 'none')
{
$('div#seminar_register').slideDown('slow', func);
}
else
{
if (func != null) func();
}
};
function toggleMenuBottom()
{
if ($('div#seminar_register').css('display') == 'none')
{
openMenuBottom();
}
else
{
closeMenuBottom();
}
};


/* VIDEO POPUP CODE */
var popupStatus = 0;
function loadPopup()
{
if (popupStatus == 0)
{
$('div#popupBackground').css(
{
'opacity': '0.8'
});
$('div#popupBackground').fadeIn('slow');
$('div#popupBox').fadeIn('slow');
popupStatus = 1;
}
}
function centerPopup()
{
var windowWidth  = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var bodyHeight   = $('body').height();
var popupWidth   = $('div#popupBox').width();
var popupHeight  = $('div#popupBox').height();
$('div#popupBox').css(
{
'position': 'absolute',
'top'     : (windowHeight  / 2) - (popupWidth / 2),
'left'    : (windowWidth / 2) - (popupWidth  / 2)
});
$('div#popupBackground').css(
{
'height': windowHeight
});
}
function closePopup(func)
{
if (popupStatus == 1)
{
$('div#popupBackground').fadeOut('slow');
$('div#popupBox').fadeOut('slow', func);
popupStatus = 0;
}
}
function openPopup()
{
centerPopup();
loadPopup();
$(window).resize(function()
{
centerPopup();
});
$('div#popupBox .close, div#popupBackground').click(function()
{
closePopup();
return false;
});
$(document).keypress(function(e)
{
if (e.keyCode == 27)
{
closePopup();
}
});
}
function showPopup(link)
{
$('div#popupBox').load('/popuploader.asp', {option: link}, function(response, status, xhr)
{
if (status == 'error')
{
$('div#popupBox').html('<strong>Sorry, but we were unable to complete that request. The webmaster has been notified.</strong> (Message: ' + xhr.status + ' ' + xhr.statusText + ')');
}
$('div#popupBox').append('<div id="popupClose"><a href="#" id="closevideo">Close [x]</a><script type="text/javascript">$(document).ready(function(){$(\'#closevideo\').click(function(){closePopup()});});</script></div>');
closeMenuBottom(openPopup);
});
}


function ChangeTab(given_tab_id) {

	var style = document.getElementById(given_tab_id).style;

	Class_Name = Array (

	'leftTab',

	'midTab',

	'rightTab'

	);

	Tabs_Name = Array (

	'used',

	'new',

	'commercial'

	);

	Tabs_ID = Array (

	'searchForm_used',

	'searchForm_new',

	'searchForm_commercial'

	);

	for (x = 0; x < 3; x++) {

		if (Tabs_ID[x] == given_tab_id) {

			style.display = 'block';

			document.getElementById(Tabs_Name[x]).className = Class_Name[x] + ' current';

			if (Tabs_Name[x] == 'commercial') {

				document.getElementById(Tabs_Name[x]).style.width = '82px';

			} else {

				document.getElementById(Tabs_Name[x]).style.width = '108px';

			}

		} else {

			document.getElementById(Tabs_ID[x]).style.display = 'none';

			document.getElementById(Tabs_Name[x]).className = Class_Name[x];

		}

	}

}




function displayBooking(element) {
		x = document.getElementById(element).style;
		y = document.getElementById('seminar_enquiry').style;
		if (x.display == 'none' || x.display == '')
		{
		x.display = 'block';
		y.display = 'none';
		//var newHTML = 'Close Booking Form [x]';
		//document.getElementById('seminar_booking_title').innerHTML = newHTML;
		}
		else
		{
		x.display = 'none';
		//var newHTML = 'Book a place<br />at a Seminar';
		//document.getElementById('seminar_booking_title').innerHTML = newHTML;
		}	
		}


function displayEnquiry(element) {
		x = document.getElementById(element).style;
		y = document.getElementById('seminar_booking').style;
		if (x.display == 'none' || x.display == '')
		{
		x.display = 'block';
		y.display = 'none';
		//var newHTML = 'Close Enquiry Form [x]';
		//document.getElementById('seminar_enquiry_title').innerHTML = newHTML;
		}
		else
		{
		x.display = 'none';
		//var newHTML = 'Find out about<br /> our FREE Seminars';
		//document.getElementById('seminar_enquiry_title').innerHTML = newHTML;
		}	
		}


