// Display image script

function display(imgname){ 
win2=window.open("","","width=142,height=126") 
if (win2){
win2.document.open()
win2.document.write("<head><title>"+imgname+"</title></head>")
win2.document.write("<body background="+'"'+imgname+'"'+">") 
win2.document.write("</body>")
win2.document.close()
}
else
alert("Failed in spawning a new window!")
}

// Input fields clear value

function clearEmail(Email){
if (Email.defaultValue==Email.value)
Email.value = ""
}

function clearName(Name){
if (Name.defaultValue==Name.value)
Name.value = ""
}

function clearTelephone(Telephone){
if (Telephone.defaultValue==Telephone.value)
Telephone.value = ""
}

// Order validation script

function validateForm() {
with (document.RB) {
var alertMsg = "The following REQUIRED fields\nhave been left empty:\n";
radioOption = -1;
for (counter=0; counter<Lining.length; counter++) {
if (Lining[counter].checked) radioOption = counter;
}
if (radioOption == -1) alertMsg += "\nLining";
if (RomanBlindWidth.value == "") alertMsg += "\nRomanBlindWidth";
if (RomanBlindDrop.value == "") alertMsg += "\nRomanBlindDrop";
radioOption = -1;
for (counter=0; counter<WindowRecess.length; counter++) {
if (WindowRecess[counter].checked) radioOption = counter;
}
if (radioOption == -1) alertMsg += "\nWindowRecess";
radioOption = -1;
for (counter=0; counter<Cleat.length; counter++) {
if (Cleat[counter].checked) radioOption = counter;
}
if (radioOption == -1) alertMsg += "\nCleat";
if (Name.value == "") alertMsg += "\nName";
if (Address.value == "") alertMsg += "\nAddress";
if (Email.value == "") alertMsg += "\nEmail";
if (Telephone.value == "") alertMsg += "\nTelephone";
if (DeliveryAddress.value == "") alertMsg += "\nDeliveryAddress";
if (alertMsg != "The following REQUIRED fields\nhave been left empty:\n") {
alert(alertMsg);
return false;
} else {
return true;
} } }
