<!-- Start of ImageWindow Code -->
function breakframe() {
if (parent.frames.length > 0) {
parent.location.replace(location.href) 
}}
function wopen(url, name, w, h) {
w += 10;
h += 115;
 var win = window.open(url,name,'width='+w+',height='+h+','+'location=no,directories=no,menubar=no,'+'status=yes,toolbar=no,scrollbars=no,resizable=no');
 win.resizeTo(w, h);
 win.focus();
}
<!-- End of ImageWindow Code -->

<!-- Start of CheckForm code -->
function checkcom() {
if (document.com.yourname.value=='') {
alert('Please enter your name.');
document.com.yourname.focus();
return false;
}
else if (document.com.email.value=='') {
alert('Please enter your email address.');
document.com.email.focus();
return false;
}
else if (document.com.comment.value=='') {
alert('Please enter your question or comment.');
document.com.comment.focus();
return false;
}}
<!-- End of CheckForm code -->

<!-- Start of CheckQuote code -->
function checkquote() {
if (document.com.type.value=='') {
alert('Please enter the type of vehicle you are interested in.');
document.com.type.focus();
return false;
}
else if (document.com.firstname.value=='') {
alert('Please enter your first name.');
document.com.firstname.focus();
return false;
}
else if (document.com.lastname.value=='') {
alert('Please enter your last name.');
document.com.lastname.focus();
return false;
}
else if (document.com.email.value=='') {
alert('Please enter your email address.');
document.com.email.focus();
return false;
}
else if (document.com.preference[1].checked)  {
if (document.com.phone.value=='') {
alert('Please enter your phone number if you wish to be contacted by phone.');
document.com.phone.focus();
return false;
}}}
<!-- End of CheckQuote code -->

<!-- Start of CheckAdd code -->
function checkadd() {
if (document.com.photoid.value=='') {
alert('Please enter the name or stock # for this vehicle.');
document.com.photoid.focus();
return false;
}
else if (document.com.description.value=='') {
alert('Please enter the description for this vehicle.');
document.com.description.focus();
return false;
}}
<!-- End of CheckAdd code -->

<!-- Start of CheckSale code -->
function checksale() {
if (document.com.keyword.value=='') {
alert('Please enter the keyword for this sale.');
document.com.keyword.focus();
return false;
}
else if (document.com.name.value=='') {
alert('Please enter the name for this sale.');
document.com.name.focus();
return false;
}
else if (document.com.shortdesc.value=='') {
alert('Please enter the homepage text for this sale.');
document.com.shortdesc.focus();
return false;
}
else if (document.com.longdesc.value=='') {
alert('Please enter the text for this sale.');
document.com.longdesc.focus();
return false;
}}
<!-- End of CheckSale code -->

<!-- Start of CheckAdvertiser code -->
function checkadvertiser() {
if (document.com.name.value=='') {
alert('Please enter the name for this advertiser.');
document.com.name.focus();
return false;
}
else if (document.com.code.value=='') {
alert('Please enter the tracking code for this advertiser.');
document.com.code.focus();
return false;
}}
<!-- End of CheckAdvertiser code -->

<!-- Start of CheckEdit code -->
function checkedit(e) {
if (!(e)) {
return false;
}}
<!-- End of CheckEdit code -->

<!-- Start of ImageSwitch code -->
function imageswitch(sdir,sphoto,scount,ssizew,ssizeh,salt,stitle) {
if (scount != 0) {
document.getElementById('switch').innerHTML='<img src="/images/'+sdir+'/'+sphoto+'-'+scount+'.jpg" width="'+ssizew+'" height="'+ssizeh+'" alt="'+salt+'" title="'+stitle+'" border="2">'; 
} else {
document.getElementById('switch').innerHTML='<img src="/images/'+sdir+'/'+sphoto+'.jpg" width="'+ssizew+'" height="'+ssizeh+'" alt="'+salt+'" title="'+stitle+'" border="2">'; 
}
var i = 0;
while (document.getElementById('switch'+i)) {
   if (i == scount) {
   document.getElementById('switch'+i).style.borderColor='#ff0000';
   } else {
   document.getElementById('switch'+i).style.borderColor='';
   }
   i++;
}
return false;
}
<!-- End of ImageSwitch code -->

<!-- Start of InventoryNav code -->
function OnChange(dropdown)
{
    var myindex  = dropdown.sortvehicles.selectedIndex;
    var SelValue = dropdown.sortvehicles.options[myindex].value;
    var myindex2  = dropdown.sortprice.selectedIndex;
    var SelValue2 = dropdown.sortprice.options[myindex2].value;
    var myindex3  = dropdown.sortperpage.selectedIndex;
    var SelValue3 = dropdown.sortperpage.options[myindex3].value;
    var baseURL  = "http://www.sirwaltertrucks.com/vehicles.php";
	top.location.href = baseURL + "?sortvehicles=" + SelValue + "&sortprice=" + SelValue2 + "&sortperpage=" + SelValue3;
	return false;
}
<!-- End of InventoryNav code -->

<!-- Start of StockBox code -->
function showtext(thetext,thecount) {
if (!document.getElementById) return false;
var thetoggle = "toggle"+thecount;
alert("Stock #s: " + thetext);
return false;
// document.getElementById(thetoggle).innerHTML = thetext;
}
<!-- End of StockBox code -->
