// JavaScript Document
function getElementsByClass(searchClass,node,tag)
{
	var classElements = new Array();
	if ( node == null )
	node = document;
	if ( tag == null )
	tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}
function resetLinks( selClass )
{
	var result = getElementsByClass( selClass );
	for ( i=0; i < result.length; i++ )
	{
		result[i].className = "";
	}
}
function goto( which, page )
{
	selClass = "leftnavselected";
	resetLinks( selClass );
	which.className = selClass;
	document.getElementById ('maincopy').src = page;
}
function gotoAdv( which, page, isflash, trans, fname )
{
	selClass = "leftnavselected";
	resetLinks( selClass );
	which.className = selClass;
	document.getElementById ('maincopy').src = page + ".php";
	var img = "";
	if ( isflash )
	{
		//var swf = '<script type="text/javascript">';
		//swf += 'var s1 = new SWFObject("/images/' + fname + '","rotator","320","451","7");';
		//swf += 's1.addVariable("width","320");';
		//swf += 's1.addVariable("height","451");';
		//if ( trans )
		//{
		//	swf += 's1.addParam("wmode", "transparent");';
		//}
		//swf += 's1.write("sidegraphic");';
		//swf += '/script>';
		//img = swf;
		//s1 = new SWFObject("/images/" + fname ,"rotator","320","451","7");
		s1 = new SWFObject(fname ,"rotator","350","450","7");
		s1.addVariable("width","350");
		s1.addVariable("height","450");
		if ( trans )
		{
			s1.addParam("wmode", "transparent");
		}
		s1.write("sidegraphic");
	}
	else
	{
		var i = '<img id="sideimage" src="/images/' + fname + '" width="667" height="480" alt=""/>';
		img = i;
		document.getElementById ('sidegraphic').innerHTML = img;
	}
}
function gotoAdv2( which, page, isflash, trans, fname )
{
	selClass = "leftnavselected";
	resetLinks( selClass );
	which.className = selClass;
	document.getElementById ('maincopy').src = page;
	showResource(isflash, trans, fname);
}

function showResource(isflash, trans, fname)
{
	var img = "";
	if ( isflash )
	{
		s1 = new SWFObject(fname ,"rotator","350","450","7");
		s1.addVariable("width","350");
		s1.addVariable("height","450");
		if ( trans )
		{
			s1.addParam("wmode", "transparent");
		}
		s1.write("sidegraphic");
	}
	else
	{
		var i = '<img id="sideimage" src="/images/' + fname + '" width="350" height="450" alt=""/>';
		img = i;
		document.getElementById ('sidegraphic').innerHTML = img;
	}
}

function showResource2(isflash, trans, fname, swfwidth, swfheight)
{
	var img = "";
	if ( isflash )
	{
		s1 = new SWFObject(fname ,"rotator", swfwidth, swfheight, "7");
		s1.addVariable("width",swfwidth);
		s1.addVariable("height",swfheight);
		if ( trans )
		{
			s1.addParam("wmode", "transparent");
		}
		s1.write("sidegraphic");
	}
	else
	{
		var i = '<img id="sideimage" src="/images/' + fname + '" width="' + swfwidth + '" height="' + swfheight + '" alt=""/>';
		img = i;
		document.getElementById ('sidegraphic').innerHTML = img;
	}
}

function showResource3(isflash, trans, fname, swfwidth, swfheight, divname)
{
	var img = "";
	if ( isflash )
	{
		s1 = new SWFObject(fname ,"rotator",swfwidth,swfheight,"7");
		s1.addVariable("width",swfwidth);
		s1.addVariable("height",swfheight);
		if ( trans )
		{
			s1.addParam("wmode", "transparent");
		}
		s1.write(divname);
	}
	else
	{
		var i = '<img id="sideimage" src="/images/' + fname + '" width="' + swfwidth + '" height="' + swfheight + '" alt=""/>';
		img = i;
		document.getElementById ('sidegraphic').innerHTML = img;
	}
}

/*
function doEmail ( name )
{
	parent.document.getElementById('emailto').innerHTML = "<b>Contact " + name + "</b>";
	parent.document.getElementById('emailform').style.display = "";
	parent.document.getElementById('formcontainer').style.display = "";
	document.getElementById('page_description').style.display = "none";
}
*/

function doEmail (x, name )
{
	window.open('contact_form.php?email=' + x + '&contactor=' + name,'_blank','width=700,height=460,scrollbars=yes,menubar=no');
	//parent.document.getElementById('emailto').innerHTML = "<b>Contact " + name + "</b>";
	//parent.document.getElementById('emailform').style.display = "";
	//parent.document.getElementById('formcontainer').style.display = "";
	//document.getElementById('page_description').style.display = "none";
}

function hide ( what )
{
	document.getElementById( what ).style.display = "none";
}
function setLocation( x )
{
	//parent.document.getElementById ('plocation').value = x;
}
currentquotepage = "contactinfo";
function goNext( remove, add )
{
	document.getElementById( remove ).style.display = "none";
	document.getElementById( add ).style.display = "";
	currentquotepage = add;
}
function goQuotePage( which )
{
	document.getElementById( currentquotepage ).style.display = "none";
	document.getElementById( which ).style.display = "";
	currentquotepage = which;
}

