
var pageWidth = 206;
var pageUpto = 0;
var nPages = 4;

function nextPage()
{
	if (pageUpto == (nPages - 1))
	{
		return document.getElementById('buyFormMidInner').submit();
	}

	var el = document.getElementById("buyFormMidInner");
	pageUpto++;
	el.style.left = (0 - (pageWidth * pageUpto)) + "px";

	if (pageUpto == (nPages - 1))
	{
		document.getElementById('buyFormBtn').value = "Send Enquiry >";
	}
	else
	{
		document.getElementById('buyFormBtn').value = " Next > ";
	}
}

function lastPage()
{
	if (pageUpto == 0)
		return;

	var el = document.getElementById("buyFormMidInner");
	pageUpto--;
	el.style.left = (0 - (pageWidth * pageUpto)) + "px";
}

function setOpacity(id, opacity)
{
	obj = document.getElementById(id);
	opacity = opacity / 100;
	obj.style.opacity = opacity;
	obj.style.filter = "alpha(opacity=" + (opacity * 100) + ")";

	if (opacity == 1) opacity = 0.99;
	obj.MozOpacity = opacity;
}

function subform1_click()
{
//	if ()
//	{
//		boatInMindYes();
//	}
}

function subform2_click()
{
//	if ()
//	{
//		boatInMindNo();
//	}
}

function boatInMindYes()
{
	setOpacity('yesForm', 100);
	setOpacity('noForm', 35);
}

function boatInMindNo()
{
	setOpacity('yesForm', 35);
	setOpacity('noForm', 100);
}

 function penned_trailer_q3(el)
 {
 	var type = el.value;
	if (type.indexOf("Trailer") <= -1)
		document.getElementById("q3").innerHTML = "Where are you going to pen/moor it?";
	else
		document.getElementById("q3").innerHTML = "What are you going to tow it with?";
 }

 function preloadImg(src)
 {
 	var IMG = new Image();
 	IMG.src = src;
 }

 function swapImg(name, src)
 {
      document.images[name].src = src;
 }

 preloadImg('images/backArrowOn.png');
 preloadImg('images/homeOn.png');
