
// John's magical commands.js file for Gordon Lamb

// Globals..

pageurl			= document.location
domain			= location.hostname
roof				= top.location
ceiling			= parent.location
pagename			= document.title
defaultStatus		= 'gordonlamb.co.uk ¦ ' + pagename;
sitepath			= 'http://www.gordonlamb.co.uk/'
pagepath			= ''
pagezone			= location.protocol
designer			= 'Stuart Pearce'
pageTopic			= 'Gordon Lamb'

var searchLabel		= '<h2 title="Search gordonlamb.co.uk (enter some keywords)">Search gordonlamb.co.uk</h2>';
var usedCarCount	= 1000
var usedSearchTotal	= 'Search over <span class="usedCarCount" title="'+usedCarCount+' used and nearly new cars!">'+usedCarCount+'</span> used and nearly new cars.';
var marque		= ''



// Franchises Array..

var GLF = [];

GLF[0]	= '{reserved}';
GLF[1] 	= '{reserved}';
GLF[2] 	= 'Saab';
GLF[3] 	= 'Mitsubishi (Sheffield)';
GLF[4] 	= '{reserved}';
GLF[5] 	= '{reserved}';
GLF[6] 	= '{reserved}';
GLF[7] 	= 'Land Rover';
GLF[8] 	= 'Toyota (Chesterfield)';
GLF[9] 	= 'Honda';
GLF[10]	= 'Renault';
GLF[11] 	= 'Nissan';
GLF[12] 	= '{reserved}';
GLF[13] 	= '{reserved}';
GLF[14] 	= '{reserved}';
GLF[15] 	= 'Skoda';
GLF[16]	= 'Toyota (Sheffield)';
GLF[17]	= 'Mitsubishi (Chesterfield)';



// Business Telephone Numbers.. (if you think this method is cack-handed, you should have seen the one this replaced..)

var telB	= [];

telB[0]	= 'tbc';
telB[1] 	= '';
telB[2] 	= '0114 262 5000';  // Saab
telB[3] 	= '0114 262 5000'; // Mitsubishi (Sheffield)
telB[4] 	= '';
telB[5] 	= '';
telB[6] 	= '';
telB[7] 	= '01246 269000'; // Land Rover
telB[8] 	= '01246 221100'; // Toyota (Chesterfield)
telB[9] 	= '01246 221133'; // Honda
telB[10]	= '01246 261100'; // Renault
telB[11] 	= '01246 260100'; // Nissan
telB[12] 	= '';
telB[13] 	= '';
telB[14] 	= '';
telB[15] 	= '01246 221155'; // Skoda
telB[16]	= '0114 250 8855'; // Toyota (Sheffield)
telB[17]	= '01246 221155'; // Mitsubishi (Chesterfield)

// Business Contacts..

var personB	= [];

personB[0]	= 'tbc';
personB[1] 	= '';
personB[2] 	= 'Jon Sudbury'; // Saab
personB[3] 	= 'Daniel Hall'; // Mitsubishi (Sheffield)
personB[4] 	= '';
personB[5] 	= '';
personB[6] 	= '';
personB[7] 	= 'Rob Smedley'; // Land Rover
personB[8] 	= 'Peter Scattergood'; // Toyota (Chesterfield)
personB[9] 	= 'Ben Langford'; // Honda
personB[10]	= 'Martin Whitehead'; // Renault
personB[11] 	= 'Martin Whitehead'; // Nissan
personB[12] 	= '';
personB[13] 	= '';
personB[14] 	= '';
personB[15] 	= 'Daniel Hall'; // Skoda
personB[16]	= 'Peter Scattergood'; // Toyota (Sheffield)
personB[17]	= 'Daniel Hall'; // Mitsubishi (Chesterfield)

// Business Photos based on Francise ID

var mphotoB	= [];

mphotoB[0]	= '';
mphotoB[1]	= '';
mphotoB[2]	= '';
mphotoB[3]	= '/gfx/people/daniel_hall.jpg';
mphotoB[4]	= '';
mphotoB[5]	= '';
mphotoB[6]	= '';
mphotoB[7]	= '/gfx/people/rob_smedley.jpg';
mphotoB[8]	= '/gfx/people/peter_scattergood.jpg';
mphotoB[9]	= '/gfx/people/ben-langford.jpg';
mphotoB[10]	= '/gfx/people/martin-whitehead.jpg';
mphotoB[11]	= '/gfx/people/martin-whitehead.jpg';
mphotoB[12]	= '';
mphotoB[13]	= '';
mphotoB[14]	= '';
mphotoB[15]	= '/gfx/people/daniel_hall.jpg';
mphotoB[16]	= '/gfx/people/peter_scattergood.jpg';
mphotoB[17]	= '/gfx/people/daniel_hall.jpg';



// Motability Telephone Numbers..

var telM	= [];

telM[0]	= '';
telM[1] 	= '';
telM[2] 	= '0114 262 5000';  // Saab
telM[3] 	= '0114 262 5000'; // Mitsubishi (Sheffield)
telM[4] 	= '';
telM[5] 	= '';
telM[6] 	= '';
telM[7] 	= '01246 269000'; // Land Rover
telM[8] 	= '01246 221100'; // Toyota (Chesterfield)
telM[9] 	= '01246 221133'; // Honda
telM[10]	= '01246 261100'; // Renault
telM[11] 	= '01246 260100'; // Nissan
telM[12] 	= '';
telM[13] 	= '';
telM[14] 	= '';
telM[15] 	= '01246 221155'; // Skoda
telM[16]	= '0114 250 8855'; // Toyota (Sheffield)
telM[17]	= '01246 221155'; // Mitsubishi (Chesterfield)

// Motability Contacts..

var personM	= [];

personM[0]	= '';
personM[1] 	= '';
personM[2] 	= 'Keith Jowett'; // Saab
personM[3] 	= 'Chris Schwartz'; // Mitsubishi (Sheffield)
personM[4] 	= '';
personM[5] 	= '';
personM[6] 	= '';
personM[7] 	= 'David Smith'; // Land Rover
personM[8] 	= 'Andy Gibbins'; // Toyota (Chesterfield)
personM[9] 	= 'Mark Gregory'; // Honda
personM[91] 	= 'Lee Foster'; // Honda 2nd contact
personM[10]	= 'Lee Maisfield'; // Renault
personM[101]	= 'Jonathon Webb'; // Renault 2nd contact
personM[11] 	= 'Andrew Baldock'; // Nissan
personM[12] 	= '';
personM[13] 	= '';
personM[14] 	= '';
personM[15] 	= 'Andy Pienaar'; // Skoda
personM[16]	= 'Julie Hobson'; // Toyota (Sheffield)
personM[17]	= 'Daniel Hall'; // Mitsubishi (Chesterfield)


// Mobility Photos based on Francise ID

var mphotoM	= [];

mphotoM[0]	= '';
mphotoM[1]	= '';
mphotoM[2]	= '';
mphotoM[3]	= '';
mphotoM[4]	= '';
mphotoM[5]	= '';
mphotoM[6]	= '';
mphotoM[7]	= '/gfx/people/david_smith.jpg';
mphotoM[8]	= '/gfx/people/andy_gibbins.jpg';
mphotoM[9]	= '/gfx/people/mark_gregory.jpg';
mphotoM[91]	= '/gfx/people/lee_foster.jpg'; // Francise 9 contact 2
mphotoM[10]	= '/gfx/people/lee_maisefield.jpg';
mphotoM[101]	= '/gfx/people/chris_schwartz.jpg'; // Francise 10 contact 2
mphotoM[11]	= '/gfx/people/andrew-baldock.jpg';
mphotoM[12]	= '';
mphotoM[13]	= '';
mphotoM[14]	= '';
mphotoM[15]	= '/gfx/people/andy_pienaar.jpg';
mphotoM[16]	= '/gfx/people/julie_hobson.jpg';
mphotoM[17]	= '/gfx/people/daniel_hall.jpg';


// Servicing Telephone Numbers..

var telS	= [];

telS[0]	= 'tbc';
telS[1] 	= '';
telS[2] 	= '0114 262 5000';  // Saab
telS[3] 	= '0114 262 5000'; // Mitsubishi (Sheffield)
telS[4] 	= '';
telS[5] 	= '';
telS[6] 	= '';
telS[7] 	= '01246 269000'; // Land Rover
telS[8] 	= '01246 221100'; // Toyota (Chesterfield)
telS[9] 	= '01246 221133'; // Honda
telS[10]	= '01246 261100'; // Renault
telS[11] 	= '01246 260100'; // Nissan
telS[12] 	= '';
telS[13] 	= '';
telS[14] 	= '';
telS[15] 	= '01246 221155'; // Skoda
telS[16]	= '0114 250 8855'; // Toyota (Sheffield)
telS[17]	= '01246 221155'; // Mitsubishi (Chesterfield)


	
// Business, Motability and Servicing Functions!

function bPhoto(franchiseId)
	{
	document.write('<a href="/cgi-bin/pnDbSearch.cgi?data=businessvehicles&mode=user&franchise_id='+franchiseId+'"><img src="/gfx/people/b'+franchiseId+'.jpg" alt="photograph.."></a>');
	}
	
function bPhotoOnly(franchiseId)
	{
	document.write('<img src="/gfx/people/b'+franchiseId+'.jpg" alt="photograph..">');
	}
	
function mwbPhoto(frctype,franchiseId,PfranchiseId)
	{
		if(frctype == "m")
		{
			thisfphoto = mphotoM[PfranchiseId];
			thisflink = '/cgi-bin/pnDbSearch.cgi?franchise_id='+franchiseId+'&data=motabilityvehicles&searchForm=1';
		}
		else
		{
			thisfphoto = mphotoB[PfranchiseId];
			thisflink = '/cgi-bin/pnDbSearch.cgi?data=businessvehicles&mode=user&franchise_id='+franchiseId;
			
			if(franchiseId == "11")
			{
				thisflink = 'http://gordonlamb.nissan.co.uk/services/business-to-business';
			}
		}
		
		document.write('<a href="'+thisflink+'"><img src="'+thisfphoto+'" alt="photograph.."></a>');
	}
	
function mwbPhotoOnly(frctype,franchiseId)
	{
		if(frctype == "m")
		{
			thisfphoto = mphotoM[franchiseId];
		}
		else
		{
			thisfphoto = mphotoB[franchiseId];
		}
		document.write('<img src="'+thisfphoto+'" alt="photograph..">');
	}

function bTel(franchiseId)
	{
	document.write(telB[franchiseId]);
	}
	
function bPerson(franchiseId)
	{
	document.write(personB[franchiseId]);
	}

function mTel(franchiseId)
	{
	document.write(telM[franchiseId]);
	}
	
function mPerson(franchiseId)
	{
	document.write(personM[franchiseId]);
	}
	
function sTel(franchiseId)
	{
	document.write(telS[franchiseId]);
	}



// User notifications..

var publicNotices = new Array()
publicNotices[0]=""
publicNotices[1]="Please ensure that you have entered your details and also selected your preferred dealership before proceeding."
publicNotices[2]=""



// Functions..

function deClass(pageBit)
{
pageBit.className='';
}



function checkSelection()
{
if (document.enq.make_of_interest.selectedIndex == 0)
	{
	document.enq.emailclubButton.disabled = 'disabled';
	alert('Please choose a preferred dealership to continue.');
	}
else
	{
	document.enq.emailclubButton.disabled = false;
	return;
	}
}



function reClass(pageBit,nuStyle)
{
//alert('test');
pageBit.className = nuStyle;
}



function cap(pageBit)
{
pageBit.title=pageBit.innerText;
}



function outputUsedOffersLink()
{
if (marque == '')			{ document.write('<a href="/used/offers">Used special offers</a>'); }
else if (marque == 'Land Rover')	{ document.write('<a href="http://www.gordonlamb.landrover.co.uk/control.cfm?MREQ=app_usedVehicleHome&varPassedDlrId=4716" target="landRover">Used special offers</a>'); }
else						{ document.write('<a href="/cgi-bin/pnDbSearch.cgi?data=vehicles&make='+marque+'&special_offer=1">Used special offers</a>'); }
}

function outputUsedOffersLinkSYS(passedMakeToken)
{
if (passedMakeToken !='')	{ document.write('<a href="/cgi-bin/pnDbSearch.cgi?data=vehicles&make='+passedMakeToken+'&special_offer=1" onMouseOver="cap(this);">Used special offers</a>'); }
else					{ document.write('<a href="/used/offers">Used special offers</a>'); }
}

function outputNewOffersLink()
{
if (marque == '')			{ document.write('<a href="/new/offers">New special offers</a>'); }
//else if (marque == 'Land Rover')	{ document.write('<a href="http://www.gordonlamb.landrover.co.uk/control.cfm?MREQ=app_specialOffers" target="landRover">New special offers</a>'); }
else						{ document.write('<a href="/cgi-bin/pnDbSearch.cgi?model=&make='+marque+'&mode=user&data=newvehicles">New special offers</a>'); }
}

function outputNewOffersLinkSYS(passedMakeToken)
{
if (passedMakeToken == '')	{ document.write('<a href="/new/offers">New special offers</a>'); }
else						{ document.write('<a href="/cgi-bin/pnDbSearch.cgi?model=&make='+passedMakeToken+'&mode=user&data=newvehicles">New special offers</a>'); }
}


function superToggle(toShow,toHide,toggleOpen,toggleClose)
{
	document.getElementById(toShow).className='visible';
	document.getElementById(toHide).className='off';
	document.getElementById(toggleOpen).className='dealerToggleOpen';
	document.getElementById(toggleClose).className='dealerToggle';
}

function singleToggle(toShow,toggleOpen)
{
	document.getElementById(toShow).className='visible';
	document.getElementById(toggleOpen).className='dealerToggleOpen';
}

function revealConceal(toShow,toHide)
{
	document.getElementById(toShow).style.display='block !important';
	document.getElementById(toHide).style.display='none !important';
}

function revealConcealx2(toShow,toHide,toShow2,toHide2)
{
	document.getElementById(toShow).style.display='block !important';
	document.getElementById(toHide).style.display='none !important';
	document.getElementById(toShow2).style.display='block !important';
	document.getElementById(toHide2).style.display='none !important';	
}



function reveal(toShow)
{
	document.getElementById(toShow).className='on';
}

function conceal(toHide)
{
	document.getElementById(toHide).className='off';
}

function usedSearchToggle(opt)
	{
	if (opt = 'enable')
		{
		document.getElementById('usedSearch').className = 'on';
		}
		
	else if (opt = 'disable')
		{
		document.getElementById('usedSearch').className = 'off';
		}
	}
	


function usedSearchFormOff()
{
document.getElementById('usToggleHi').className='off';
document.getElementById('formUsedSearch').className='off';
document.getElementById('usToggleLo').className='visible';
}








function toggleIcon(obj,currentClass)
{
if (currentClass=='dealerToggle')
	{
	document.getElementById(obj).className = 'dealerToggleOpen';
	}

else if (currentClass=='dealerToggleOpen')
	{
	document.getElementById(obj).className = 'dealerToggle';
	}
}




function go()
{
	box = document.franchiseChooser.chosenFranchise;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}


//Added for Mobility page MW june09 (wasn't sure if this 'go()' script was used alse where and if so, if my changes would break it)

function goMobility()
{
	mbpopuppage = 'http://www.motabilityonline.com/site/current_prices/priceList/priceListDLAByVehicleDetails.jsp?formContextKey=&formSessionId=AEFE948099A8D93A6DEB21126C5D4D92&searchVehicleCategory=&searchBodyDoors=&searchNumberOfSeats=&searchBodyType=&searchManufacturer=Toyota&searchModel=&searchTransmissionType=&searchFuelType=&searchMpg=&searchEngineSize=&searchCo2=Bands+A+-+G%2C+all+levels+of+emissions&searchAdvancePayment=&userAction=Search&userAction=criteriaChange';

	box = document.franchiseChooser.chosenFranchise;
	destination = box.options[box.selectedIndex].value;
	if (destination && destination == mbpopuppage) window.open(destination,'_blank');
	else if(destination) location.href = destination;
}


// Martin's function that ensures that the Used Car Search Form is correctly reset, if the user clicks the Reset button.

function resetSearch()
{
	document.vehicleSearch.min_year.value = document.vehicleSearch.min_year.options[0].value;
	document.vehicleSearch.make.value = document.vehicleSearch.make.options[0].value;
	document.vehicleSearch.model.value = document.vehicleSearch.model.options[0].value;
	document.vehicleSearch.fuel.value = document.vehicleSearch.fuel.options[0].value;
	document.vehicleSearch.transmission.value = document.vehicleSearch.transmission.options[0].value;
	document.vehicleSearch.to_price.value = '';
}



/* Bookmark the page (add to favourites) */

function bookmark(bookmarkReference)
{
	if (window.external)
	{
	external.AddFavorite(pageurl,bookmarkReference)
	}
	
	else if(navigator.appName == "Netscape")
	{
	alert('press control and D now!')
	}

	else if(navigator.appName == "Opera")
	{
	alert('press control and T now!')
	}
}



/* Send to a Friend */

function send2Friend(theUrl,theFriend)
{
}



/* Send Form
==================================================== */

function sendForm()
{
if (document.enq.franchise.value=='')
	{
	alert('Please choose a Dealership to contact!');
	return false;
	}

else
	//:alert('Thank you.\n\We will contact you to confirm your request..');
	document.enq.submit();
}



/* Help and Tips
==================================================== */


function chgClipMssg(){

	if(clipMssg == "This vehicle has been added to your list")
	{
		document.getElementById("clipboardFill").style.backgroundImage = "url(/gfx/icons/greentick.gif)";
	}
}


function tip(hint)
{
alert(hint);
}


function hideNewsletter(){

pdflist = new Array();
pdflist[0] = "/pdf/newsletter/honda.pdf";
pdflist[1] = "/pdf/newsletter/renault.pdf";
pdflist[2] = "/pdf/newsletter/skoda.pdf";
pdflist[3] = "/pdf/newsletter/landrover.pdf";
pdflist[4] = "/pdf/newsletter/toyota.pdf";
pdflist[5] = "/pdf/newsletter/nissan.pdf";
pdflist[6] = "/pdf/newsletter/mitsubishi.pdf";
pdflist[7] = "/downloads/pdf/gordon_lamb_land_rover_newsletter_winter_2009_news.pdf";
pdflist[8] = "/downloads/pdf/gordon_lamb_skoda_news_winter_2009.pdf";
pdflist[9] = "pdf/gordon_lamb_land_rover_newsletter_winter_2009_news.pdf";
pdflist[10] = "pdf/gordon_lamb_skoda_news_winter_2009.pdf";

	pdflinks = document.getElementsByTagName("a");
	for(i=0;i<pdflinks.length;i++)
	{

		pdflink = pdflinks[i];
		thisSRC = pdflink.getAttribute("href");

		for(b=0;b<11;b++)
		{
			if(thisSRC == pdflist[b])
			{
				pdflinks.item(i).setAttribute("href","#");
				pdflinks.item(i).setAttribute("onclick","newslettermssg()");
			}
		}
	}

}

function newslettermssg(){

	alert("Gordon Lamb's latest newsletter coming soon!");

}


function sortNewConfSpec(chgSpec){

	document.getElementById("specHeadRight").style.position = "absolute";
	document.getElementById("specHeadRight").style.top = "0px";
	document.getElementById("specHeadRight").style.right = "0px";
	
	if(chgSpec == "0")
	{
		document.getElementById("specTechSpec").style.display = "none";
		document.getElementById("specHeadRight").className = "specTecHeadUn";
		
		document.getElementById("specTechEqup").style.display = "block";
		document.getElementById("specHeadLeft").className = "specTecHead";
	}
	else if(chgSpec == "1")
	{
		document.getElementById("specTechSpec").style.display = "block";
		document.getElementById("specHeadRight").className = "specTecHead";
		
		document.getElementById("specTechEqup").style.display = "none";
		document.getElementById("specHeadLeft").className = "specTecHeadUn";
	}
}


function showPartExc(chgExc){

	if(chgExc == "0")
	{
		document.getElementById("parthExtmps").style.display = "inline";
		document.getElementById("partExchangeDets").style.display = "none";
	}
	else if(chgExc == "1")
	{
		document.getElementById("parthExtmps").style.display = "none";
		document.getElementById("partExchangeDets").style.display = "block";
	}
}

function opacityin(id, opacStart, opacEnd, millisec) { 
//speed for each frame 
var speed = Math.round(millisec / 100); 
var timer = 10; 

//determine the direction for the blending, if start and end are the same nothing happens 
if(opacStart > opacEnd) { 
 for(i = opacStart; i >= opacEnd; i--) { 
     setTimeout("changeOpacin(" + i + ",'" + id + "')",(timer * speed)); 
     timer++; 
 } 
} else if(opacStart < opacEnd) { 
 for(i = opacStart; i <= opacEnd; i++) 
 { 
     setTimeout("changeOpacin(" + i + ",'" + id + "')",(timer * speed)); 
     timer++; 
 } 
} 
} 

//change the opacity for different browsers 
function changeOpacin(opacity, id) { 
var object = document.getElementById(id).style; 
	object.filter = "alpha(opacity=" + opacity + ")"; 
	object.opacity = (opacity / 100); 
	object.MozOpacity = (opacity / 100); 
	object.KhtmlOpacity = (opacity / 100); 
}

var iLocationIE;
function showEnqForm(iLocation){

	var iLocationIE = iLocation;

	if(!document.getElementById("enqformContainer"))
	{
		var eBody = document.getElementsByTagName("body")[0];
		var eDiv = document.createElement("div");
		eBody.appendChild(eDiv);
		eDiv.setAttribute("id","enqformContainer");
	}
	
	if(self.pageYOffset) 
	{
		var eqscrolling = self.pageYOffset;
	} 
	else
	{
		var eqscrolling = document.documentElement.scrollTop;
	}
	
	if(bName == "Explorer" && bVer == "6"){var eqscrolling = document.body.scrollTop;}
	
	var eqheight = screen.availHeight;
	
	eqTotalHeight = eqscrolling+eqheight;
	
	document.getElementById("enqformContainer").style.height = eqTotalHeight+"px";
	document.getElementById("enqformContainer").innerHTML = '<div id="eqBackground"></div><div id="enqform"><iframe id="fIEload" src ="'+iLocation+'" width="510" height="570" scrolling="auto" frameborder="0"></iframe></div><span id="eqClose"><a href="javascript:;" onclick="hideEnqForm()">close</a></span>';
	document.getElementById("enqform").style.top = (eqscrolling+110)+"px";
	document.getElementById("eqClose").style.top = (eqscrolling+682)+"px";
	document.getElementById("enqformContainer").style.display = "block";
	opacityin('enqformContainer', 0, 300, 200);
	
	if(bName == "Explorer" && bVer == "6")
	{
		parent.frames["fIEload"].window.location.reload(); 
	}
	
	
}



function hideEnqForm(){

	document.getElementById("enqformContainer").innerHTML = '';
	document.getElementById("enqformContainer").style.display = "none";
	opacityin('enqformContainer', 100, 0, 100);
}

function usedCarShowOption(tds,id){

	exdiv = document.getElementById("partexchangelk");
	tddiv = document.getElementById("testdrivelk");
	fqdiv = document.getElementById("financequotelk");
		
	if(tds == 1)
	{
		document.getElementById(id).style.display = "block";
		document.getElementById(id+"lk").style.display = "none";

		if(exdiv.style.display == "none" && tddiv.style.display == "none" && fqdiv.style.display == "none")
		{
			document.getElementById("moreopttitle").style.display = "none";
		}
	}
	else if(tds == 2)
	{
		if(testdriveformtype == "?testdrive")
		{
			exdiv.style.display = "none";
			tddiv.style.display = "none";
			fqdiv.style.display = "block";
			document.getElementById("moreopttitle").style.display = "block";
			document.getElementById("testdrive").style.display = "block";
		}
		else if(testdriveformtype == "?exchange")
		{
			exdiv.style.display = "none";
			tddiv.style.display = "block";
			fqdiv.style.display = "block";
			document.getElementById("moreopttitle").style.display = "block";
			document.getElementById("partexchange").style.display = "block";
		}
		else if(testdriveformtype == "?finance")
		{
			exdiv.style.display = "none";
			tddiv.style.display = "none";
			fqdiv.style.display = "none";
			document.getElementById("moreopttitle").style.display = "none";
			document.getElementById("financequote").style.display = "block";
		}
	}
}


// ----- Hide all drop-menus -----

function zapPanels()
	{
	document.getElementById('panel1').className='off';
	document.getElementById('panel2').className='off';
	document.getElementById('panel3').className='off';
	document.getElementById('panel4').className='off';
	document.getElementById('panel5').className='off';
	document.getElementById('panel6').className='off';
	document.getElementById('panel7').className='off';
	document.getElementById('panel8').className='off';
	document.getElementById('panel9').className='off';
	document.getElementById('panel10').className='off';
	document.getElementById('panel11').className='off';
	}

function closePanels()
	{
	setTimeout("zapPanels()", 2000);
	}
	

/** Added from quirksmode to replace old detect method **/
/** http://www.quirksmode.org/js/detect.html           **/

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

var bName = BrowserDetect.browser;
var bVer = BrowserDetect.version;

// window.onload = function(){hideNewsletter();}

