

function showPortrait(){
newWindow=window.open("lucPortrait.html","portrait","width=192,height=348,location=no,status=no,directories=no,toolbar=no,scrollbars=no,menubar=no,resizable=no,top=38,left=420");
newWindow.focus()
}

function showPriv(){
newWindow=window.open("privacy.html","privacy","width=290,height=380,location=no,status=no,directories=no,toolbar=no,scrollbars=yes,menubar=no,resizable=no,top=38,left=420");
newWindow.focus()
}


// Check for blank fields
function isFilled(elm) {
    if (elm.value == "" || elm.value == null) {
        return false;
    }
    else {
        return true;
    }
}

// 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;
    }
}
// count words
function wordCount(strTextValue) {

    strTextValue = strTextValue.replace(/^\s+/, '').replace(/\s+$/, '');
    var strSplit = strTextValue.split(/\s+/g);

    var intWordCount = strSplit.length;
	
   if (intWordCount > 350){
        return true;
   }
	
  }


// Check entire form
function isReady(form) {
	 if (isFilled(form.fullname) == false) {        
        alert("Please enter your name.");
        form.fullname.focus();
        return false;
    }
	
    if (isEmail(form.address) == false) {          
        alert("Please enter a valid email address.");
        form.address.focus();
        return false;
    }
	
	if (isFilled(form.subject) == false) {        
        alert("Please state the subject.");
        form.subject.focus();
        return false;
    }

    if (isFilled(form.opinion) == false) {         
        alert("Please enter your comment.");
        form.opinion.focus();
        return false;
    }
	
	if (wordCount(mailForm.opinion.value)==true){
		alert("Your feedback exceeds 350 word limit");
		form.opinion.focus();
        return false;
	}
	
}