
/* ====================================================

  General Site variables script

  Created by John Mounsey, Peaknet Limited.
  john@peaknet.ltd.uk
  © 2OO6 - please do not steal!

==================================================== */

function minibusMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

var thisYear='2005-present'
var slogan="fiatbus.co.uk";
var marque="Fiat";
var model = 'Ducato';
var fullPath="http://www.fiatbus.co.uk/"



/* Print the current Date */

function printDate()

{
document.write('<SPAN TITLE="The date">' + today + '</SPAN>');
}


/* ====================================================
Page Greeting
==================================================== */

function greeting()

{
if (hour >= 22)		{ period = 'night'; }
else if (hour >= 17)	{ period = 'evening'; }
else if (hour >= 12) 	{ period = 'afternoon'; }
else if (hour >= 6) 	{ period = 'morning'; }
document.write(period);
}


/* ====================================================
Hide "Loading" message
==================================================== */

function hideLoad()

{
// alert('Loading complete!')
document.getElementById('loading')
loading.style.display='none';
}


/* ====================================================
Hi-Lite <TR> areas
==================================================== */

function hi(field)	{ field.className = 'demoon' }
function lo(field)	{ field.className = 'demo' }


/* ====================================================
Things to do when page 100% loaded or resized
==================================================== */

function loaded()

{
window.status		= 'Page Loaded.';
hideLoad();
}

function diag()

{
window.status		= 'Screen across: ' + pageW + ' Screen height: ' + pageH;
}


/* ====================================================
Show Destination of a url
==================================================== */

function preUrl(goal)	{ goal.title = 'Links to.. ' + goal.href; }


/* ====================================================
Bookmark / Add to Favorites script
==================================================== */

function bookmark()

{ 
if (window.external) { external.AddFavorite(pagelink,pagename) }
	
else if (navigator.appName == "Netscape") 	{ alert('press control and D now to bookmark this page') }
else if (navigator.appName == "Opera") 		{ alert('press control and T now to bookmark this page') }
}


/* ====================================================
Recommend a Friend
==================================================== */

function sendPage()
	{
	alert('This opens a blank Email for you to send to friends ..');
	window.location='mailto:?subject=I recommend this site: ' + siteUrl + ' (' + siteName + ')';
	}


/* ====================================================
Previous Pages
==================================================== */

function goBack(dest) { history.go(-1); }
function doubleBack() { history.go(-2); }


/* ====================================================
Status Bar Captions [note! does not work on <A> tags]
==================================================== */

function cap(label)
{ 
status=label; return true;
}


/* ====================================================
Change text within an ID'd <P> or <TD> tag
==================================================== */

function change(part,msg)
{
document.getElementById(part).innerText = msg;
}


/* ====================================================
Footer Tools
==================================================== */

function footerTools()
{
document.write('<P CLASS="tools"><A HREF="index.html" title="Go Home ..">Home</A> / <A HREF="javascript:print();" title="Take a hard-copy of this page ..">Print</A> / <A HREF="javascript:bookmark();" title="Add this page to your Favourites ..">Save</A> / <A HREF="#top" title="Jump to the top of this page ..">Top</A></P>');
}

function credit()
{
document.write('<P TITLE="copyright message" CLASS="tools">© ' + siteName + ' ' + thisYear + '</P>');
}


/* ====================================================
Group menu controller
==================================================== */

function fusionGroup(targ,chosen,restore)
	{
	eval(targ+".location='"+chosen.options[chosen.selectedIndex].value+"'");
	if (restore) chosen.selectedIndex=0;
	}


/* ====================================================
Top right promotional area [default = off]
==================================================== */

function promo()

{
document.write('&nbsp;');
}


/* ====================================================
Menu rollover code
==================================================== */

function mOn(slot)

{
slot.className = 'menuitemon';
}

function mOff(slot)

{
slot.className = 'menuitem';
}

function mHi(slot)

{
slot.className = 'menuhi';
}

/* ====================================================
Drop-menu
==================================================== */

function dropMenu()
{
document.write('<FORM name="form" ID="dropmenu">')
document.write('<SELECT name="mainmenu" class="dropmenu" onChange="minibusMenu(\'parent\',this,1)">')
document.write('<OPTION value="/index.html" selected>Quick Links</option>')
document.write('<OPTION value="/cgi-bin/pnDbDetail.cgi/display::vehicle_groups::::::2::user::::Fiat,Ducato,standard">Standard Minibuses</option>')
document.write('<OPTION value="/cgi-bin/pnDbDetail.cgi/display::vehicle_groups::::::2::user::::Fiat,Ducato,wheelchair">Wheelchair Accessible</option>')
document.write('<OPTION value="/3d_minibus_seating_plans.html">3D Seating Plans</option>')
document.write('<OPTION value="/safety.html">Safety</option>')
document.write('<OPTION value="/price_it.html">Minibus Configurator</option>')
//document.write('<OPTION value="/contract_hire.html">Contract Hire & Leasing</option>')
//document.write('<OPTION value="/cgi-bin/pnDbSearch.cgi/::0::user::0::vehicle_sales::::">On The Road Pricing</option>')
//document.write('<OPTION value="/information.html">About Us</option>')
document.write('<option value="/360_virtual_tour/index.html">360&deg; Virtual Tour *NEW*</option>')
document.write('<OPTION value="/legal.html">All The Legal Stuff</option>')
document.write('<OPTION value="/accessibility.html">Accessibility</option>')
document.write('<OPTION value="/location.html">Location</option>')
document.write('<OPTION value="/contact.html">Contact Us</option>')
document.write('<OPTION value="/">Home Page</option>')
document.write('</SELECT></FORM>')
}

function noClass(obj)
{
obj.className='';
}

/* ====================================================
Join mailing list Forms
==================================================== */

function register(email)
	{
	winHref = fullPath + "/cgi-bin/register.cgi/" + reg.email.value;
	winName = "Register";
	winFeatures = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,height=250,width=250";
	var reg_window = window.open(winHref,winName,winFeatures);
	}

/* ====================================================
<FORM> checker
==================================================== */

function formCheck()
	{
	if (document.enq.realname.value == '' || document.enq.email.value == '' || document.enq.message.value == '')
		{
		alert('Please enter your name, Email address and message.')
		}
	else document.enq.submit();
	}



/* ====================================================
Document Title Changer
==================================================== */

function nuTitle(nuName)
{
var nuTitle = nuName;
document.title = nuTitle;
}

/* ====================================================
Seat Belt Labels Page	
==================================================== */

function changeLabels(activeLabel)
{
//alert(activeLabel);
document.getElementById('label0').className='hidden';
document.getElementById('label1').className='hidden';
document.getElementById('label2').className='hidden';
document.getElementById('label3').className='hidden';
document.getElementById(activeLabel).className='visible';
}

/* ====================================================
Home Page Model Chooser
==================================================== */

function chooseModel(mainType)
{
var listStatus = document.getElementById(mainType).className;

if (listStatus == 'display')
	{
	document.getElementById(mainType).className = 'nodisplay';
	}

else if (listStatus == 'nodisplay')
	{
	document.getElementById(mainType).className = 'display';
	}
}

/* ====================================================
Legal stuff open/close gizmo (jnm)
==================================================== */

var currentID = 'rules';

function closeTheLot()
{
	if(currentID != '')
	{
		document.getElementById(currentID).className='hidden';
	}
}

function openUp(drawerName)
{
	if(drawerName != currentID)
	{
		document.getElementById(drawerName).className='visible'
		currentID = drawerName;
	}
	else
	{
		currentID = '';
	}

}
