function addMore()
{
	window.document.Advert.action = "Advertise.asp?Action=Add";
	if (window.document.Advert.Seats.value == "")
	{
		window.document.Advert.Seats.value = "0";
	}
	if (window.document.Advert.Year.value == "")
	{
		window.document.Advert.Year.value = "0";
	}
	if (window.document.Advert.Asking.value == "")
	{
		window.document.Advert.Asking.value = "0";
	}


	window.document.Advert.submit();
}
function changeMenu(strOption)
{
strDiv = document.getElementById("RadioSelect");
	if (strOption == "bus")
	{
		 strHTML = '<INPUT TYPE=RADIO NAME="SearchType" VALUE="Make" onClick="javascript:showmake();" CHECKED>&nbsp;Make/Model&nbsp;<INPUT TYPE=RADIO NAME="SearchType" VALUE="Chassis" onClick="javascript:showchasndave();">&nbsp;Chassis&nbsp;<br><INPUT TYPE=RADIO NAME="SearchType" VALUE="Price" onClick="javascript:showprice();">&nbsp;Price&nbsp;<INPUT TYPE=RADIO NAME="SearchType" VALUE="Year" onClick="javascript:showyear();">&nbsp;Year&nbsp;';
		strDiv2 = document.getElementById("BusSearch");
		strDiv2.style.display = "block";
		strDiv2 = document.getElementById("CoachSearch");
		strDiv2.style.display = "none";
		strDiv2 = document.getElementById("BusChas");
		strDiv2.style.display = "block";
		strDiv2 = document.getElementById("CoachChas");
		strDiv2.style.display = "none";
		strDiv2 = document.getElementById("BusYear");
		strDiv2.style.display = "block";
		strDiv2 = document.getElementById("CoachYear");
		strDiv2.style.display = "none";
		strDiv2 = document.getElementById("MidiYear");
		strDiv2.style.display = "none";
		showmake();
	}
	if (strOption == "coach")
	{
		 strHTML = '<INPUT TYPE=RADIO NAME="SearchType" VALUE="Make" onClick="javascript:showmake();" CHECKED>&nbsp;Make/Model&nbsp;<INPUT TYPE=RADIO NAME="SearchType" VALUE="Chassis" onClick="javascript:showchasndave();">&nbsp;Chassis&nbsp;<br><INPUT TYPE=RADIO NAME="SearchType" VALUE="Price" onClick="javascript:showprice();">&nbsp;Price&nbsp;<INPUT TYPE=RADIO NAME="SearchType" VALUE="Year" onClick="javascript:showyear();">&nbsp;Year&nbsp;';
		strDiv2 = document.getElementById("BusSearch");
		strDiv2.style.display = "none";
		strDiv2 = document.getElementById("CoachSearch");
		strDiv2.style.display = "block";
		strDiv2 = document.getElementById("BusChas");
		strDiv2.style.display = "none";
		strDiv2 = document.getElementById("CoachChas");
		strDiv2.style.display = "block";
		strDiv2 = document.getElementById("BusYear");
		strDiv2.style.display = "none";
		strDiv2 = document.getElementById("CoachYear");
		strDiv2.style.display = "block";
		strDiv2 = document.getElementById("MidiYear");
		strDiv2.style.display = "none";

		showmake();
	}
	if (strOption == "midi")
	{
		 strHTML = '<INPUT TYPE=RADIO NAME="SearchType" VALUE="Price" onClick="javascript:showprice();" CHECKED>&nbsp;Price&nbsp;<INPUT TYPE=RADIO NAME="SearchType" VALUE="Year" onClick="javascript:showyear();">&nbsp;Year&nbsp;';
		strDiv2 = document.getElementById("BusYear");
		strDiv2.style.display = "none";
		strDiv2 = document.getElementById("CoachYear");
		strDiv2.style.display = "none";
		strDiv2 = document.getElementById("MidiYear");
		strDiv2.style.display = "block";

		showprice();	

	}
		strDiv.innerHTML = strHTML;

}
function changeType(strOption)
{
	if (strOption == "bus")
	{
		strDiv = document.getElementById("BodySelect");
		strDiv.style.display = "block";
		strDiv = document.getElementById("BodyText");
		strDiv.style.display = "none";
		strDiv = document.getElementById("ModelSelect");
		strDiv.style.display = "block";
		strDiv = document.getElementById("ModelText");
		strDiv.style.display = "none";
		strDiv = document.getElementById("ChassismanuSelect");
		strDiv.style.display = "block";
		strDiv = document.getElementById("ChassismanuText");
		strDiv.style.display = "none";
		strDiv = document.getElementById("ChassisSelect");
		strDiv.style.display = "block";
		strDiv = document.getElementById("ChassisText");
		strDiv.style.display = "none";

	}
	if (strOption == "coach")
	{
		strDiv = document.getElementById("BodySelect");
		strDiv.style.display = "block";
		strDiv = document.getElementById("BodyText");
		strDiv.style.display = "none";
		strDiv = document.getElementById("ModelSelect");
		strDiv.style.display = "block";
		strDiv = document.getElementById("ModelText");
		strDiv.style.display = "none";
		strDiv = document.getElementById("ChassismanuSelect");
		strDiv.style.display = "block";
		strDiv = document.getElementById("ChassismanuText");
		strDiv.style.display = "none";
		strDiv = document.getElementById("ChassisSelect");
		strDiv.style.display = "block";
		strDiv = document.getElementById("ChassisText");
		strDiv.style.display = "none";	

	}
	if (strOption == "midi")
	{
		strDiv = document.getElementById("BodySelect");
		strDiv.style.display = "none";
		strDiv = document.getElementById("BodyText");
		strDiv.style.display = "block";
		strDiv = document.getElementById("ModelSelect");
		strDiv.style.display = "none";
		strDiv = document.getElementById("ModelText");
		strDiv.style.display = "block";
		strDiv = document.getElementById("ChassismanuSelect");
		strDiv.style.display = "none";
		strDiv = document.getElementById("ChassismanuText");
		strDiv.style.display = "block";
		strDiv = document.getElementById("ChassisSelect");
		strDiv.style.display = "none";
		strDiv = document.getElementById("ChassisText");
		strDiv.style.display = "block";	


	}

}
function checkDetails()
{
	blerror = false;
	if (window.document.Advert.name.value == "")
	{
		blerror= true;
		strDiv = document.getElementById("CardName");
		
		strDiv.innerHTML = "<FONT COLOR=red>*Cardholder Name:</FONT>";
	}

	if (window.document.Advert.postcode.value == "")
	{
		blerror=true;
		strDiv = document.getElementById("Postcode");
		strDiv.innerHTML = "<FONT COLOR=red>*Postcode:</FONT>";
	}
	if (window.document.Advert.email.value == "")
	{
		blerror=true;
		strDiv = document.getElementById("Email");
		strDiv.innerHTML = "<FONT COLOR=red>*Email:</FONT>";
	}
	if (blerror == true)
	{
		strDiv = document.getElementById("ErrorDiv");
		strDiv.innerHTML = "<BR><FONT COLOR=red>You did not fill out the required fields</FONT>";
	}
	else
	{
		window.document.Advert.submit();
	}
	
}
function nextStep()
{
	window.document.Advert.action = "Advertise.asp?Action=Sub";
	if (window.document.Advert.Seats.value == "")
	{
		window.document.Advert.Seats.value = "0";
	}
	if (window.document.Advert.Year.value == "")
	{
		window.document.Advert.Year.value = "0";
	}
	if (window.document.Advert.Asking.value == "")
	{
		window.document.Advert.Asking.value = "0";
	}
	window.document.Advert.submit();
}
function nextCancel()
{
	window.document.Advert.action = "Advertise.asp?Action=Canc";
	window.document.Advert.submit();
}	

function showFull(strHeight,strWidth,strImage)
{
	strDiv = document.getElementById("DisplayDiv");
	strDiv.style.height = strHeight;
	strDiv.style.width = strWidth;
	strHTML = "<IMG SRC=\"Images/"+strImage+"\" Height="+strHeight+" Width="+strWidth+">";
	strDiv.innerHTML = strHTML;
	strDiv.style.display = "block";		

}

function closeAd()
{
	strDiv = document.getElementById("DisplayDiv");
	strDiv.style.display = "none";
}		

<!--

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
function Logon(strType,strID)
{
	document.getElementById("login").style.display = "block";
	if (strID != 0)
	{
		window.document.LoginForm.Page.value = strType;
		window.document.LoginForm.Page.ID = strID;
	}
	else
	{
		window.document.LoginForm.Page.value = strType;
	}
}
function closeLog()
{
	document.getElementById("login").style.display = "none";
}

function showmake()
{
	document.getElementById("MakeDiv").style.display = "block";
	document.getElementById("ChasDiv").style.display = "none";
	document.getElementById("PriceDiv").style.display = "none";
	document.getElementById("YearDiv").style.display = "none";
}
function showprice()
{
	document.getElementById("MakeDiv").style.display = "none";
	document.getElementById("ChasDiv").style.display = "none";
	document.getElementById("PriceDiv").style.display = "block";
	document.getElementById("YearDiv").style.display = "none";

}
function showyear()
{
	document.getElementById("MakeDiv").style.display = "none";
	document.getElementById("ChasDiv").style.display = "none";
	document.getElementById("PriceDiv").style.display = "none";
	document.getElementById("YearDiv").style.display = "block";

}
function showchasndave()
{
	document.getElementById("MakeDiv").style.display = "none";
	document.getElementById("ChasDiv").style.display = "block";
	document.getElementById("PriceDiv").style.display = "none";
	document.getElementById("YearDiv").style.display = "none";

}
function swapOptions2(the_array_name)
{
  var numbers_select = window.document.SearchForm.Model;
  var the_array = eval(the_array_name);
  var option_count = eval(the_array_name+'n');
  makeDiv2(option_count);
  setOptionText2(window.document.SearchForm.Model, the_array);
  setOptionValue2(window.document.SearchForm.Model, the_array);
}
function swapOptions(the_array_name)
{
  var numbers_select = window.document.SearchForm.Model;
  var the_array = eval(the_array_name);
  var option_count = eval(the_array_name+'n');
  makeDiv(option_count);
  setOptionText(window.document.SearchForm.Model, the_array);
  setOptionValue(window.document.SearchForm.Model, the_array);
}
function swapChassis(the_array_name)
{
  var numbers_select = window.document.SearchForm.ChassisName;
  var the_array = eval(the_array_name);
  var option_count = eval(the_array_name+'n');
  makeDiv3(option_count);
  setOptionText(window.document.SearchForm.ChassisName, the_array);
  setOptionValue(window.document.SearchForm.ChassisName, the_array);
}
function makeDiv3(option_count)
{
  var strDiv = document.getElementById("ChassisNameDiv");
  strHTML = '<select name="ChassisName"><OPTION value="">';
  for (i=0;i < option_count;i++)
  {
    strHTML = strHTML+'<OPTION value="">';
  }
 strHTML = strHTML+'</SELECT>';
 strDiv.innerHTML = strHTML;
} 
function makeDiv(option_count)
{
  var strDiv = document.getElementById("ModelDiv");
  strHTML = '<select name="Model"><OPTION value="">';
  for (i=0;i < option_count;i++)
  {
    strHTML = strHTML+'<OPTION value="">';
  }
 strHTML = strHTML+'</SELECT>';
 strDiv.innerHTML = strHTML;
} 
function setOptionText(the_select, the_array)
{
  for (loop=0; loop < the_select.options.length; loop++)
  {
    the_select.options[loop].text = the_array[loop];
  }
}

function setOptionValue(the_select, the_array)
{
  for (loop=0; loop < the_select.options.length; loop++)
  {
    the_select.options[loop].value = the_array[loop];
  }
}
function setHidden(strText)
{
	window.document.SearchForm.slMake.value = strText;
}
function swapChaOptions(the_array_name)
{
  var numbers_select = window.document.SearchForm.Chassis;
  var the_array = eval(the_array_name);
  var option_count = eval(the_array_name+'n');
  makeChaDiv(option_count);
  setChaOptionText(window.document.SearchForm.Chassis, the_array);
  setChaOptionValue(window.document.SearchForm.Chassis, the_array);
}
function swapOptions2(the_array_name)
{
  var numbers_select = window.document.SearchForm.Model;
  var the_array = eval(the_array_name);
  var option_count = eval(the_array_name+'n');
  makeDiv2(option_count);
  setOptionText2(window.document.SearchForm.Model, the_array);
  setOptionValue2(window.document.SearchForm.Model, the_array);
}
function makeDiv2(option_count)
{
  var strDiv = document.getElementById("ModelDiv");
  strHTML = '<select name="Model"><OPTION value="">';
  for (i=0;i < option_count;i++)
  {
    strHTML = strHTML+'<OPTION value="">';
  }
 strHTML = strHTML+'</SELECT>';
 strDiv.innerHTML = strHTML;
} 
function setOptionText2(the_select, the_array)
{
  for (loop=0; loop < the_select.options.length; loop++)
  {
    the_select.options[loop].text = the_array[loop];
  }
}

function setOptionValue2(the_select, the_array)
{
  for (loop=0; loop < the_select.options.length; loop++)
  {
    the_select.options[loop].value = the_array[loop];
  }
}
function setHidden2(strText)
{
	window.document.SearchForm.slMake.value = strText;
}
function swapChaOptions(the_array_name)
{
  var numbers_select = window.document.SearchForm.Chassis;
  var the_array = eval(the_array_name);
  var option_count = eval(the_array_name+'n');
  makeChaDiv(option_count);
  setChaOptionText(window.document.SearchForm.Chassis, the_array);
  setChaOptionValue(window.document.SearchForm.Chassis, the_array);
}
function makeChaDiv(option_count)
{
  var strDiv = document.getElementById("ChassisDiv");
  strHTML = '<select name="Chassis"><OPTION value="">';
  for (i=0;i < option_count;i++)
  {
    strHTML = strHTML+'<OPTION value="">';
  }
 strHTML = strHTML+'</SELECT>';
 strDiv.innerHTML = strHTML;
} 
function setChaOptionText(the_select, the_array)
{
  for (loop=0; loop < the_select.options.length; loop++)
  {
    the_select.options[loop].text = the_array[loop];
  }
}

function setChaOptionValue(the_select, the_array)
{
  for (loop=0; loop < the_select.options.length; loop++)
  {
    the_select.options[loop].value = the_array[loop];
  }
}

