// schooltripprice.js by frank thx to QuirksMode
window.onload = init;

function init()
{
	optionTest = true;
	if (!document.getElementById)
		{ 
		optionTest = false;
		return;
		}

	initeventhandlers();		
} //end init

function initeventhandlers ()
{
	if (!optionTest) return;
	
	//if detailbuttons available attach handler, after pricecalc they are not there
	// if (document.getElementById('detailbuttons')) { document.getElementById('detailbuttons').onclick = function () {document.getElementById('detailhide').style.display = 'block';} }
	
	// if (document.getElementById('gallery'))	//if gallery images available attach handler
		// {
	 	// var galleryimagesarray = document.getElementById('gallery').getElementsByTagName('IMG');//get all the images in the gallery
		// for (var i=0;i<galleryimagesarray.length;i++)	//assign the handlers to all the images in the gallery
			// {
			// galleryimagesarray[i].onmouseover = function () {document.getElementById('bigpicture').src = '/pictures/'+this.id.substring(1,15)+'.jpg';};
		    // galleryimagesarray[i].onclick = function () {document.getElementById('bigpicture').src = '/pictures/'+this.id.substring(1,15)+'.jpg';};
			// }
		// }

	var alltr=document.getElementsByTagName('tr');
	var alltrlen = alltr.length;
	for(var i=0;i<alltrlen;i++)
		{
		alltr[i].onmouseover=function(){this.className='trhighlight';return false}
		alltr[i].onmouseout=function(){this.className ='';return false}
		}
	

	//hide details onload
	// if (document.getElementById('detailhide')) {document.getElementById('detailhide').style.display = 'none';}
} // end initeventhandlers


// function tableruler()
// {
	// if (document.getElementById && document.createTextNode)
	// {
		// var tables=document.getElementsByTagName('table');
		// for (var i=0;i<tables.length;i++)
		// {
			// if(tables[i].className=='ruler')
			// {
				// var trs=tables[i].getElementsByTagName('tr');
				// for(var j=0;j<trs.length;j++)
				// {
					// if(trs[j].parentNode.nodeName=='TBODY')
					// {
						// trs[j].onmouseover=function(){this.className='ruled';return false}
						// trs[j].onmouseout=function(){this.className='';return false}
					// }
				// }
			// }
		// }
	// }
// }
