function makemail( a, s, q ) {
  /* Set the default values */
  xa = "info";
  xs = "ladyjae.com";
  xq = "Lady Jae Design Web Inquiry";
  /* if the user didn't give me data, use the defaults */
  if (a.length == 0) a = xa;
  if (s.length == 0) s = xs;
  if (q.length == 0) q = xq;
  /* construct the address and kick it off */
  x = "mailto:" + a + "@" + s + "?subject=" + q;
  document.location.href = x;
}


function MakeArray(n) {
 this.length = n
 return this
}


function trimString(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}


function checkMail(addr)
{
    // Tests email address for valid syntax, returns TRUE if not valid //
    var filter  =
/^([a-zA-Z0-9_\.\-])+([a-zA-Z0-9])\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
        if (filter.test(addr)) return false;
        else return true;
}


function getRadioButtonValue (radio)
{  var result = ""; 
   for (var i = 0; i < radio.length; i++) {   
          if (radio[i].checked) {
                        result =  radio[i].value;
                        break 
          }
    }
    return result
}

function setRadioButtonValue (radio, newValue)
{   
	if (!radio) { return; }

	var radioLength = radio.length;
	if ( radioLength == undefined ) { radio.checked = ( radio.value == newValue.toString() );
		return;
		}

	for(var i = 0; i < radioLength; i++) {
		if( radio[i].checked == true ) { radio[i].value = newValue.toString(); }
		}
    return 
}

function clearDefault(el) {

	if (el.defaultValue==el.value) el.value = ""
		
}


function nextPage() {
	var nextpg
	thispage=ipage
	
	nextpg = thispage + 1
	if ( nextpg >= 6 ) { nextpg = 0 }
	
	toggleBox(cLayer[thispage],0)
	toggleBox(cLayer[nextpg],1)

	ipage = nextpg
	return true	

}


function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}



//////////////////////////////////////////////////////////////////
// The preloadImages() function preloads all the "flipped" images
// so that when a user mouses over a navigation button,
// the rollover takes place immediately.  (If you do not
// preload images, the first time a user mouses over each
// navigation button the "mouseover" image must TRavel
// from the Web server, causing an unatTRactive delay.
///////////////////////////////////////////////////////////////////

function preloadImages() {

    // If there are images embedded in the document...

    if (document.images) {

       // Set the imgFiles variable equal to an array of all the
       // image files passed as arguments to the preloadImages() function.

       var imgFiles = preloadImages.arguments;

       // Create a new array called preloadArray

       var preloadArray = new Array();

       // For each image file sent as an argument to preloadImages()
       // (all of them)...

       for (var i=0; i < imgFiles.length; i++) {

            // Create a new Image object in the preloadArray array 
            // and associate it with a source file, thus loading
            // that image into memory.

            preloadArray[i] = new Image;
            preloadArray[i].src = imgFiles[i];
       }
    }
}


function swap(id, newsrc) {
// This function is called to swap out an image being displayed 

  var theImage = locateImage(id);
  if (theImage) { // if an image was found
      theImage.src = newsrc;   //swap it out
      }

}


function locateImage(name) {
// Start with a blank variable called theImage
   var theImage = false;
   
// If there are images defined for this document . . .

   if (document.images) {
// Assign the image we're looking for to theImage
      theImage = document.images[name];
      }

// If theImage exists, return it to the calling function
   if (theImage) {
       return theImage;
       }
// Otherwise, return false(0) to the calling function
   return (false);
}

function submitForm(what) {
	if (checkData(what)) { what.submit(); }
	}


function checkData (what) {
	if (what.email.value == "") {
		alert("Please fill in your E-Mail Address.");
		what.email.focus();
		return false;
   		}
	else if (checkMail(what.email.value)) {
			alert("E-Mail Address entered is not valid.");
         	what.email.focus();
         	return false;
          	}
	orderDate = new Date()
	what.orderdate.value = orderDate.toGMTString()
	return true;
	}

function checkClear(what) {
	alert (what.value);
	if (!what._haschanged) {  
		what.value = '';
		}
	what._haschanged = true;
	}
	
function checkContact () {

// Checking Information - Business Rules

// Checking the Contact Info

       if (document.orderform.firstname.value == "") {
          alert("Please enter your first name.");
          document.orderform.firstname.focus();
          return false
       }

       if (document.orderform.lastname.value == "") {
          alert("Please enter your last name.");
          document.orderform.lastname.focus();
          return false
       }

       if (document.orderform.email.value == "") {
        	alert("Please fill in your E-Mail Address.");
         	document.orderform.email.focus();
        	return false
           	}
      	else if (checkMail(document.orderform.email.value)) {
          	alert("E-Mail Address entered is not valid.");
         	document.orderform.email.focus();
         	return false
          	}

       if (document.orderform.phone.value == "") {
			alert("Please enter a telephone number where we can call you to follow up on your inquiry.");
			document.orderform.phone.focus();
			return false
			}

		if (document.orderform.BillCity.value == "") {
			alert("Please enter the name of the city or town where you live.");
			document.orderform.BillCity.focus();
			return false
			}

		if (document.orderform.BillState.value == "") {
			alert("Please enter the name of the state or province where you live.");
			document.orderform.BillState.focus();
			return false
			}

		if (document.orderform.BillZip.value == "") {
			alert("Please enter the Zip Code or Postal Code where you live.");
			document.orderform.BillZip.focus();
			return false
			}

		if (document.orderform.BillCountry.value == "") {
			alert("Please enter the country where you live.");
			document.orderform.BillCountry.focus();
			return false
			}

		var contactAddress2 = document.orderform.BillCity.value + ", " + document.orderform.BillState.value + " " + document.orderform.BillZip.value + " " + document.orderform.BillCountry.value;
		var contactAddress = "";
		if ((document.orderform.BillAddr1.value != "") || (document.orderform.BillAddr2.value != "")) {
			if ((document.orderform.BillAddr1.value != "") && (document.orderform.BillAddr2.value != "")) {
				contactAddress = document.orderform.BillAddr1.value + ", " + document.orderform.BillAddr2.value
				}
			else {
				if (document.orderform.BillAddr1.value != "") { contactAddress = document.orderform.BillAddr1.value }
				else { contactAddress = document.orderform.BillAddr2.value }
				}
			}

		var mailingList = "No";
		if  ( document.orderform.mlist.checked == true ) { mailingList = "Yes" }

		var contactDealer = "No";
		if  ( document.orderform.dealer.checked == true ) { contactDealer = "Yes" }

// Confirming Request

		if ( !confirm ("The following request was received.\nPlease confirm that this is correct.\n"
			+ "\nYour Name                  : " + document.orderform.firstname.value + " " + document.orderform.lastname.value
			+ "\nYour Phone Number    : " + document.orderform.phone.value
			+ "\nYour Email                   : " + document.orderform.email.value
			+ "\nYour Street Address   : " + contactAddress
			+ "\nYour City/State           : " + contactAddress2
			+ "\nMailing List                  : " + mailingList
			+ "\nContact Dealer           : " + contactDealer
			+ "\nYour Question            : " + document.orderform.question.value
			)) {
			return false
			}

	orderDate = new Date()
	document.orderform.orderdate.value = orderDate.toGMTString()

	return true
	
	}
	
function isNumber(n) {  
	return !isNaN(parseFloat(n)) && isFinite(n);
	}

<!-- Original:  Nannette Thacker -->
<!-- http://www.shiningstar.net/articles/articles/javascript/checkNumeric.asp?ID=ROLLA -->
<!-- Begin
function checkNumeric(objName, minval, maxval, comma, period, hyphen, fieldname) {
	var numberfield = objName;
	if (chkNumeric(objName,minval,maxval,comma,period,hyphen, fieldname) == false) {
		numberfield.select();
		numberfield.focus();
		return false;
		}
	else {
		return true;
		}
	}

function chkNumeric(objName,minval,maxval,comma,period,hyphen,fieldname) {
// only allow 0-9 be entered, plus any values passed
// (can be in any order, and don't have to be comma, period, or hyphen)
// if all numbers allow commas, periods, hyphens or whatever,
// just hard code it here and take out the passed parameters
	var checkOK = "0123456789" + comma + period + hyphen;
	var checkStr = objName;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	var chkstrName = checkStr.name;
	if ( fieldname != "" ) { chkstrName = fieldname; }

	for (i = 0;  i < checkStr.value.length;  i++) {
		ch = checkStr.value.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
			break;
		if (j == checkOK.length) {
			allValid = false;
			break;
			}
		if (ch != ",")
			allNum += ch;
		}
	if (!allValid) {	
		alertsay = "Please enter only these values \""
		alertsay = alertsay + checkOK + "\" in the \"" + chkstrName + "\" field."
		alert(alertsay);
		return (false);
		}

// set the minimum and maximum
	var chkVal = allNum;
	var prsVal = parseInt(allNum);
	if (chkVal != "" && !(prsVal >= minval && prsVal <= maxval)) {
		alertsay = "Please enter a value greater than or "
		alertsay = alertsay + "equal to \"" + minval + "\" and less than or "
		alertsay = alertsay + "equal to \"" + maxval + "\" in the \"" + chkstrName + "\" field."
		alert(alertsay);
		return (false);
		}
	}

