// JavaScript Document
//from new JavaScript text
window.onload = initImages;

function initImages() {
	for (var i=0; i<document.images.length; i++) {
		document.images[i].ondblclick = newWindow;
	}
}

function newWindow() {
	var imgName = "images/" + this.id + ".jpg"
	var imgWindow = window.open(imgName, "imgWin", "width=330,height=250,scrollbars=no")
}


<!-- Greeting Cards-->
	function OpenNewWindow1()
		{
		greeting1Window = window.open('images/Cards-1-Order-Page-Button.jpg', 'Greeting_Cards_1', 'status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=0, width=660, height=500')
		}
		
		function OpenNewWindow2()
		{
		greeting2Window = window.open('images/Cards-2-Order-Page-Button.jpg', 'Greeting_Cards_2', 'status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=0, width=660, height=500')
		}
		
		function OpenNewWindow3()
		{
		greeting3Window = window.open('images/Cards-3-Order-Page-Button.jpg', 'Greeting_Cards_3', 'status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=0, width=660, height=500')
		}
		
		function OpenNewWindow4()
		{
		greeting4Window = window.open('images/Cards-4-Order-Page-Button.jpg', 'Greeting_Cards_4', 'status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=0, width=660, height=500')//size was previously width=330, height=250
		}


//

// Check for valid email address: look for @ and .
function isEmail(elm) {
    if (elm.value.indexOf("@") != "-1" &&
        elm.value.indexOf(".") != "-1") {
        return true;
    }
    else {
        return false;
    }
}

// Check for blank fields
function isFilled(elm) {
    if (elm.value == "" || elm.value == null) {
        return false;
    }
    else {
        return true;
    }
}
// Check entire form
function isReady(form) {
    if (isEmail(form.email) == false) {          // A real email address?
        alert("Please enter a valid email address.");
        form.email.focus();
        return false;
    }

    if (isFilled(form.name) == false) {        // A name?
        alert("Please enter your name.");
        form.name.focus();
        return false;
    }

    if (isFilled(form.address) == false) {         // A postal address
        alert("Please enter your postal address.");
        form.address.focus();
        return false;
    }

    return true;
}
