// JavaScript Document
var haveerrors = 0;
function showImage(imagename, imageurl, errors) {
document[imagename].src = imageurl
if (!haveerrors && errors) haveerrors = errors;
}

function validateForm(f) {
haveerrors = 0;

(f.how.checked !== false && f.advertisement.value.length < 1) || (f.howa.checked !== false && f.retail.value.length < 1) || (f.howb.checked !== false && f.publication.value.length < 1) || (f.howc.checked !== false && f.eventname.value.length < 1) || (f.friend.checked !== true && f.nonprofit.checked !== true && f.doctor.checked !== true && f.how.checked !== true && f.howa.checked !== true && f.howb.checked !== true && f.howc.checked !== true && f.engine.checked !== true)// validate the hear about us fields when checked only
? showImage("howerror", "../images/gif/hearpic.gif", true)// no semi-colon after this line!
: showImage("howerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.how.checked !== false && f.advertisement.value.length < 1) || (f.howa.checked !== false && f.retail.value.length < 1) || (f.howb.checked !== false && f.publication.value.length < 1) || (f.howc.checked !== false && f.eventname.value.length < 1) || (f.friend.checked !== true && f.nonprofit.checked !== true && f.doctor.checked !== true && f.how.checked !== true && f.howa.checked !== true && f.howb.checked !== true && f.howc.checked !== true && f.engine.checked !== true)// validate the hear about us fields when checked only
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("howerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.how.checked !== false && f.advertisement.value.length < 1) || (f.howa.checked !== false && f.retail.value.length < 1) || (f.howb.checked !== false && f.publication.value.length < 1) || (f.howc.checked !== false && f.eventname.value.length < 1) || (f.friend.checked !== true && f.nonprofit.checked !== true && f.doctor.checked !== true && f.how.checked !== true && f.howa.checked !== true && f.howb.checked !== true && f.howc.checked !== true && f.engine.checked !== true)// validate the hear about us fields when checked only
? scroll (0,0)// no semi-colon after this line!
: showImage("howerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.ruusing[0].checked !== true && f.ruusing[1].checked !== true) // validate are you using radio buttons
? showImage("usingerror", "../images/gif/usingpic.gif", true)  // no semi-colon after this line!
: showImage("usingerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.ruusing[0].checked !== true && f.ruusing[1].checked !== true) // validate are you using radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("usingerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.ruusing[0].checked !== true && f.ruusing[1].checked !== true) // validate are you using radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("usingerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.other.checked !== false && f.otherlube.value.length < 1) || (f.id.checked !== true && f.omy.checked !== true && f.ky.checked !== true && f.forplay.checked !== true && f.summit.checked !== true && f.astroglide.checked !== true  && f.probe.checked !== true && f.eros.checked !== true && f.never.checked !== true && f.aqualube.checked !== true && f.elbowgrease.checked !== true && f.gunoil.checked !== true && f.jo.checked !== true && f.slipperystuff.checked !== true && f.wet.checked !== true && f.rain.checked !== true && f.generic.checked !== true && f.other.checked !== true)// validate the other lube field when checked only
? showImage("lubeerror", "../images/gif/lubricantspic.gif", true)   // no semi-colon after this line!
: showImage("lubeerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.other.checked !== false && f.otherlube.value.length < 1) || (f.id.checked !== true && f.omy.checked !== true && f.ky.checked !== true && f.forplay.checked !== true && f.summit.checked !== true && f.astroglide.checked !== true  && f.probe.checked !== true && f.eros.checked !== true && f.never.checked !== true && f.aqualube.checked !== true && f.elbowgrease.checked !== true && f.gunoil.checked !== true && f.jo.checked !== true && f.slipperystuff.checked !== true && f.wet.checked !== true && f.rain.checked !== true && f.generic.checked !== true && f.other.checked !== true)// validate the other lube field when checked only
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("lubeerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.other.checked !== false && f.otherlube.value.length < 1) || (f.id.checked !== true && f.omy.checked !== true && f.ky.checked !== true && f.forplay.checked !== true && f.summit.checked !== true && f.astroglide.checked !== true  && f.probe.checked !== true && f.eros.checked !== true && f.never.checked !== true && f.aqualube.checked !== true && f.elbowgrease.checked !== true && f.gunoil.checked !== true && f.jo.checked !== true && f.slipperystuff.checked !== true && f.wet.checked !== true && f.rain.checked !== true && f.generic.checked !== true && f.other.checked !== true)// validate the other lube field when checked only
? scroll (0,0)// no semi-colon after this line!
: showImage("lubeerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.where.checked !== false && f.otherstore.value.length < 1) || (f.grocery.checked !== true && f.mail.checked !== true && f.online.checked !== true && f.where.checked !== true  && f.pharmacy.checked !== true && f.adult.checked !== true && f.specialty.checked !== true  && f.purchased.checked !== true)// validate the other lube field when checked only
? showImage("whereerror", "../images/gif/wherepic.gif", true)   // no semi-colon after this line!
: showImage("whereerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.where.checked !== false && f.otherstore.value.length < 1) || (f.grocery.checked !== true && f.mail.checked !== true && f.online.checked !== true && f.where.checked !== true  && f.pharmacy.checked !== true && f.adult.checked !== true && f.specialty.checked !== true  && f.purchased.checked !== true)// validate the other lube field when checked only
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("whereerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.where.checked !== false && f.otherstore.value.length < 1) || (f.grocery.checked !== true && f.mail.checked !== true && f.online.checked !== true && f.where.checked !== true  && f.pharmacy.checked !== true && f.adult.checked !== true && f.specialty.checked !== true  && f.purchased.checked !== true)// validate the other lube field when checked only
? scroll (0,0)// no semi-colon after this line!
: showImage("whereerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.often[0].checked !== true && f.often[1].checked !== true && f.often[2].checked !== true && f.often[3].checked !== true && f.often[4].checked !== true) // validate "how often" radio buttons
? showImage("oftenerror", "../images/gif/oftenpic.gif", true)   // no semi-colon after this line!
: showImage("oftenerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.often[0].checked !== true && f.often[1].checked !== true && f.often[2].checked !== true && f.often[3].checked !== true && f.often[4].checked !== true) // validate "how often" radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("oftenerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.often[0].checked !== true && f.often[1].checked !== true && f.often[2].checked !== true && f.often[3].checked !== true && f.often[4].checked !== true) // validate "how often" radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("oftenerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.price[0].checked !== true && f.price[1].checked !== true && f.price[2].checked !== true && f.price[3].checked !== true && f.price[4].checked !== true && f.price[5].checked !== true) // validate "how often" radio buttons
? showImage("priceerror", "../images/gif/pricepic.gif", true)   // no semi-colon after this line!
: showImage("priceerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.price[0].checked !== true && f.price[1].checked !== true && f.price[2].checked !== true && f.price[3].checked !== true && f.price[4].checked !== true && f.price[5].checked !== true) // validate "how often" radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("priceerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.price[0].checked !== true && f.price[1].checked !== true && f.price[2].checked !== true && f.price[3].checked !== true && f.price[4].checked !== true && f.price[5].checked !== true) // validate "how often" radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("priceerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.longevity[0].checked !== true && f.longevity[1].checked !== true && f.longevity[2].checked !== true) // validate "longevity" radio buttons
? showImage("longerror", "../images/gif/longevitypic.gif", true)   // no semi-colon after this line!
: showImage("longerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.longevity[0].checked !== true && f.longevity[1].checked !== true && f.longevity[2].checked !== true) // validate "longevity" radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("longerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.longevity[0].checked !== true && f.longevity[1].checked !== true && f.longevity[2].checked !== true) // validate "longevity" radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("longerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.taste[0].checked !== true && f.taste[1].checked !== true && f.taste[2].checked !== true) // validate "taste" radio buttons
? showImage("tasteerror", "../images/gif/tastepic.gif", true)   // no semi-colon after this line!
: showImage("tasteerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.taste[0].checked !== true && f.taste[1].checked !== true && f.taste[2].checked !== true) // validate "taste" radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("tasteerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.taste[0].checked !== true && f.taste[1].checked !== true && f.taste[2].checked !== true) // validate "taste" radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("tasteerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.texture[0].checked !== true && f.texture[1].checked !== true && f.texture[2].checked !== true) // validate "texture" radio buttons
? showImage("textureerror", "../images/gif/texturepic.gif", true)   // no semi-colon after this line!
: showImage("textureerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.texture[0].checked !== true && f.texture[1].checked !== true && f.texture[2].checked !== true) // validate "texture" radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("textureerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.texture[0].checked !== true && f.texture[1].checked !== true && f.texture[2].checked !== true) // validate "texture" radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("textureerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.cost[0].checked !== true && f.cost[1].checked !== true && f.cost[2].checked !== true) // validate "cost" radio buttons
? showImage("costerror", "../images/gif/costpic.gif", true)   // no semi-colon after this line!
: showImage("costerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.cost[0].checked !== true && f.cost[1].checked !== true && f.cost[2].checked !== true) // validate "cost" radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("costerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.cost[0].checked !== true && f.cost[1].checked !== true && f.cost[2].checked !== true) // validate "cost" radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("costerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.availability[0].checked !== true && f.availability[1].checked !== true && f.availability[2].checked !== true) // validate "availability" radio buttons
? showImage("availerror", "../images/gif/availabilitypic.gif", true)   // no semi-colon after this line!
: showImage("availerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.availability[0].checked !== true && f.availability[1].checked !== true && f.availability[2].checked !== true) // validate "availability" radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("availerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.availability[0].checked !== true && f.availability[1].checked !== true && f.availability[2].checked !== true) // validate "availability" radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("availerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.ingredients[0].checked !== true && f.ingredients[1].checked !== true && f.ingredients[2].checked !== true) // validate "ingredients" radio buttons
? showImage("ingerror", "../images/gif/ingredientspic.gif", true)   // no semi-colon after this line!
: showImage("ingerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.ingredients[0].checked !== true && f.ingredients[1].checked !== true && f.ingredients[2].checked !== true) // validate "ingredients" radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("ingerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.ingredients[0].checked !== true && f.ingredients[1].checked !== true && f.ingredients[2].checked !== true) // validate "ingredients" radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("ingerror", "../images/gif/noerrorpic2.gif", false); // true = errors, false = no errors

(f.marital[0].checked !== true && f.marital[1].checked !== true && f.marital[2].checked !== true && f.marital[3].checked !== true) // validate "status" radio buttons
? showImage("statuserror", "../images/gif/statuspic.gif", true)   // no semi-colon after this line!
: showImage("statuserror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.marital[0].checked !== true && f.marital[1].checked !== true && f.marital[2].checked !== true && f.marital[3].checked !== true) // validate "status" radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("statuserror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.marital[0].checked !== true && f.marital[1].checked !== true && f.marital[2].checked !== true && f.marital[3].checked !== true) // validate "status" radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("statuserror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.gender[0].checked !== true && f.gender[1].checked !== true) // validate "gender" radio buttons
? showImage("gendererror", "../images/gif/genderpic.gif", true)   // no semi-colon after this line!
: showImage("gendererror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.gender[0].checked !== true && f.gender[1].checked !== true) // validate "gender" radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("gendererror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.gender[0].checked !== true && f.gender[1].checked !== true) // validate "gender" radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("gendererror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.orientation[0].checked !== true && f.orientation[1].checked !== true && f.orientation[2].checked !== true && f.orientation[3].checked !== true) // validate "orientation" radio buttons
? showImage("orientationerror", "../images/gif/orientationpic.gif", true)   // no semi-colon after this line!
: showImage("orientationerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.orientation[0].checked !== true && f.orientation[1].checked !== true && f.orientation[2].checked !== true && f.orientation[3].checked !== true) // validate "orientation" radio buttons
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("orientationerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.orientation[0].checked !== true && f.orientation[1].checked !== true && f.orientation[2].checked !== true && f.orientation[3].checked !== true) // validate "orientation" radio buttons
? scroll (0,0)// no semi-colon after this line!
: showImage("orientationerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.name.value.length < 1) // validate first name length
? showImage("nameerror", "../images/gif/namepic.gif", true)   // no semi-colon after this line!
: showImage("nameerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.name.value.length < 1) // validate first name length
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("nameerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.name.value.length < 1) // validate first name length
? scroll (0,0)// no semi-colon after this line!
: showImage("nameerror", "../images/gif/noerrorspic.gif", false); // true = errors, false = no errors

(f.email.value.search("@") == -1 || f.email.value.search("[.*]") == -1) // validate email
? showImage("emailerror", "../images/gif/emailpic.gif", true)
: showImage("emailerror", "../images/gif/noerrorspic.gif", false);

(f.email.value.search("@") == -1 || f.email.value.search("[.*]") == -1) // validate email
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("emailerror", "../images/gif/noerrorspic.gif", false);

(f.email.value.search("@") == -1 || f.email.value.search("[.*]") == -1) // validate email
? scroll (0,0)// no semi-colon after this line!
: showImage("emailerror", "../images/gif/noerrorspic.gif", false);

(f.street.value.length < 1) // validate address length
? showImage("addresserror", "../images/gif/streetpic.gif", true)
: showImage("addresserror", "../images/gif/noerrorspic.gif", false);

(f.street.value.length < 1) // validate address length
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("addresserror", "../images/gif/noerrorspic.gif", false);

(f.street.value.length < 1) // validate address length
? scroll (0,0)// no semi-colon after this line!
: showImage("addresserror", "../images/gif/noerrorspic.gif", false);

(f.city.value.length < 1) // validate city length
? showImage("cityerror", "../images/gif/citypic.gif", true)
: showImage("cityerror", "../images/gif/noerrorspic.gif", false);

(f.city.value.length < 1) // validate city length
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("cityerror", "../images/gif/noerrorspic.gif", false);

(f.city.value.length < 1) // validate city length
? scroll (0,0)// no semi-colon after this line!
: showImage("cityerror", "../images/gif/noerrorspic.gif", false);

(f.zip.value.length < 5) // validate zip code length
? showImage("ziperror", "../images/gif/zippic.gif", true)
: showImage("ziperror", "../images/gif/noerrorspic.gif", false);

(f.zip.value.length < 5) // validate zip code length
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("ziperror", "../images/gif/noerrorspic.gif", false);

(f.zip.value.length < 5) // validate zip code length
? scroll (0,0)// no semi-colon after this line!
: showImage("ziperror", "../images/gif/noerrorspic.gif", false);

(f.age.value.length < 2) // validate zip code length
? showImage("ageerror", "../images/gif/agepic.gif", true)
: showImage("ageerror", "../images/gif/noerrorspic.gif", false);

(f.age.value.length < 2) // validate zip code length
? showImage("noval", "../images/gif/validation.gif", true)// no semi-colon after this line!
: showImage("ageerror", "../images/gif/noerrorspic.gif", false);

(f.age.value.length < 2) // validate zip code length
? scroll (0,0)// no semi-colon after this line!
: showImage("ageerror", "../images/gif/noerrorspic.gif", false);

return (!haveerrors);
}

