
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


// JavaScript Document  For EDIT MEMBER  -editmember.php
function checkWholeForm() {

    var why = "";
  
    if (document.theForm.display.value.length < 3){
       why +=  "Invalid Display name.(Min length 3 chars.)\n\n";
    } 
	

	if (why != "") {
	
      var head ="Required information is missing: \n\n"	
	  head +="  _________________________________________  \n";
	  why += "  _________________________________________  ";
       alert(head+why);
       return false;
    }
return true;
}



function checkUpForm(theForm) {

    var why = "";
    $file = theForm.file.value;
    if ($file.length < 5){
       why +=  "Invalid filename\n\n";
    } 
			

	if (why != "") {
	
      var head ="Required information is missing: \n\n"	
	  head +="  _________________________________________  \n";
	  why += "  _________________________________________  ";
       alert(head+why);
       return false;
    }
return true;
}




function confirmPass(aForm) {
	
    var why = "";
  
    if (aForm.pass1.value.length < 5 || aForm.pass2.value.length < 5 || aForm.pass3.value.length < 5 ){
       why +=  "Invalid password.(Min length 5 chars.)\n\n";
	   //alert(why);
    } 
	

	if (aForm.pass2.value != aForm.pass3.value) {
		why += "Confirm your new password \n\n"
	}
	if (why != "") {
      var head ="Sorry, There's some problem\n";
	  head +="  _________________________________________  \n";
	  why += "  _________________________________________  ";
       alert(head+why);
       return false;
    }
return true;
}

// END  JavaScript Document  For EDIT MEMBER 

// Login Form
function checkLoginForm(aForm) {
	//alert(aForm);
    var why = "";
  
    if (aForm.uname.value.length < 4 || aForm.password.value.length < 5){
       why +=  "Invalid Username or Password.\n\n";
	   //alert(why);
    } 

	if (why != "") {
      var head ="Sorry, There's some problem\n";
	  head +="  _________________________________________  \n";
	  why += "  _________________________________________  ";
       alert(head+why);
       return false;
    }
return true;
}





// JavaScript Document  For JOIN FORM  -Joinmad.php
function checkJoinForm(theForm) {

    var why = "";
  
    if (theForm.name.value.length < 3){
       why +=  "You didn't enter a name.\n\n";
    } 
	
	 if (theForm.age.value.length < 2){
       why +=  "Enter a valid age.\n\n";
    } 
	
	 if (theForm.address.value.length < 10){
       why +=  "Enter a valid address.\n\n";
    } 
	
	
	var emailFilter=/^.+@.+\..{2,3}$/;
     if (!(emailFilter.test(theForm.email.value))) { 
      why += "Enter a valid email address.\n\n";
     }
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/;
	if (theForm.email.value.match(illegalChars)) {
      why += "The email address contains illegal characters.\n\n";
    }
	
    if (theForm.phone.value.length < 6){
       why +=  "Enter a valid Phone number.\n\n";
    } 	
	
	if (theForm.qualification.value.length < 2){
       why +=  "Enter your qualification.\n\n";
    } 
	
	 if (theForm.hours.value.length < 1){
       why +=  "Hours willing to spend with MAD .\n\n";
    } 
	if (theForm.about.value.length <25){
       why +=  "Why MAD? Please be descriptive.\n\n";
    } 


    if (why != "") {
	
      var head ="Required information is missing: \n"	
	  head +="_________________________________________  \n\n";
	  why += "_________________________________________  ";
       alert(head+why);
       return false;
    }
return true;
}
//END  JavaScript Document  For JOIN FORM  -Joinmad.php




// JavaScript For COMMENTS FORM In JOURNAL  -Journal.php
function checkCommentsForm() {

    var why = "";
  
    if (document.theForm.name.value.length < 3){
       why +=  "You didn't enter a name.\n\n";
    } 
	

	var emailFilter=/^.+@.+\..{2,3}$/;
     if (!(emailFilter.test(document.theForm.email.value))) { 
      why += "Enter a valid email address.\n\n";
     }
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/;
	if (document.theForm.email.value.match(illegalChars)) {
      why += "The email address contains illegal characters.\n\n";
    }
	
	
	if (document.theForm.comment.value == "Comments"){
       why +=  "You didn't enter the comment.\n\n";
    } 

    if (why != "") {
	
      var head ="Required information is missing: \n\n"	
	  head +="  _________________________________________  \n";
	  why += "  _________________________________________  ";
       alert(head+why);
       return false;
    }
return true;
}

//END  JavaScript For COMMENTS FORM In JOURNAL  -Journal.php




// JavaScript For DELETE FORMS
function confirmDel(url,msg)
{
	//alert(msg);
opt = confirm(msg);
if(opt)
 location = url; 
}


// For ADD JOURNAL FORM In  -member.php
function checkNewJournalForm(theForm) {

    var why = "";
  
    if (theForm.heading.value.length < 3){
       why +=  "Invalid heading.\n\n";
    } 

	if (theForm.content.value.length < 10){
       why +=  "You didn't enter the content.\n\n";
    } 
	

    if (why != "") {
	
      var head ="Required information is missing: \n\n"	
	  head +="  _________________________________________  \n";
	  why += "  _________________________________________  ";
       alert(head+why);
       return false;
    }
return true;
}




// JavaScript For DELETE JOURNAL FORM In  -member.php


function checkPassword(theForm) {

    var why = "";
  
    if (document.theForm.name.value.length < 3){
       why +=  "You didn't enter a name.\n\n";
    } 
	

	var emailFilter=/^.+@.+\..{2,3}$/;
     if (!(emailFilter.test(document.theForm.email.value))) { 
      why += "Enter a valid email address.\n\n";
     }
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/;
	if (document.theForm.email.value.match(illegalChars)) {
      why += "The email address contains illegal characters.\n\n";
    }
	
	
	if (document.theForm.comment.value == "Comments"){
       why +=  "You didn't enter the comment.\n\n";
    } 
	
 
    if (document.theForm.phone.value.length < 6){
       why +=  "Invalid Phone number.\n\n";
    } 
}