function decidePage()
  {
	if(document.myForm.condition[0].checked == true)
	{
		document.myForm.action="step3.php";
		type=document.myForm.condition[0].value;
		return true;
	}
	else if(document.myForm.condition[1].checked == true)
	{
		document.myForm.action="step2.php";
		type=document.myForm.condition[1].value;
		return true;
	}
	else
	{
		alert("Please select the condtion of the truck!");
	}
	return false;
  }
function stepForm(e)
	{
		var sPath = window.location.pathname;
		var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
		var x = e.length;
		var y = "";
		if(e.length > 1)
		{
			for(var i = 0; i<x; i++)
			{
				if(e[i].checked == true)
				{
					y = 1;
				}
			}
			var pageNo = sPage.charAt(4);
			if(pageNo == '3')
			{
				pageNo = "4a";
			}
			else
			{
				pageNo++;
			}
			
			pageName = "step" + pageNo + ".php";
			
			if(y == 1)
			{
				document.myForm.action=pageName;
				return true;
			}
			else
			{
				alert("Please select one option");
				e[0].select();
				return false;
			}
		}
		else
		{
			alert("else");
			if(e.checked == true)
			{
				var pageNo = sPage.charAt(4);
				pageNo++;
				if(pageNo == '3')
				{
					pageNo = "4a"
				}
				pageName = "step" + pageNo + ".php";
				document.myForm.action=pageName;
				return true;
			}
			else
			{
				alert("Please select one option");
			}
		}
		return false;
	}

function ifempty(f)
	{
		var d = 0;
		for(var i =0; i<f.length; i++)
			{
				if(f[i].checked == true)
				{
					d = 1;
					break;
				}
			}
		if(d==1)
		{
			return true;
		}
		else
		{
			alert("Please select one option!");
			f[0].select();
		}
		return false;
	}
	
function check_box(c,page)
	{
		var dis=false;
		for(var i=0; i<c.length; i++)
		{
			if(c[i].checked)
			{
				dis = true;
			}
		}
		if(dis)
		{
			document.myForm.action= page+".php"
			return true;
		}
		else
		{
			alert("Please select atleast one option");
			return false;
		}
		
	}
function check_generator(field)
	{
		if(field[0].checked || field[1].checked)
		{
			return true;
		}
		else
		{
			alert("Please choose yes or no for supply generator");
			return false;
		}
	}