/* welcome to basic javascript.js file */
function checkCapture() {
        var n = document.getElementById("name");
        var e = document.getElementById("email");
        var errorlist = "";
	var errortitle = "Please correct the following errors:\n\n";

   if ( n.value == '' ) errorlist += "You must enter your name!\n";
   if ( e.value  == '' ){
	 errorlist += "You must enter your email address!\n";
   }else{
	errorlist  += validateEmail(e.value);
   }

   if ( errorlist == '' ) {
        return true;
  }else{
	errortitle += errorlist;
	alert(errortitle);     
        return false;
  }
}// end function

function checkLogin() {
        var n = document.getElementById("login");
        var e = document.getElementById("pass");
        var errorlist = "";
        var errortitle = "Please correct the following errors:\n\n";

   if ( n.value == '' ) errorlist += "You must enter your username!\n";
   if ( e.value  == '' ){
         errorlist += "You must enter your password!\n";
   }

   if ( errorlist == '' ) {
        return true;
  }else{
        errortitle += errorlist;
        alert(errortitle);
        return false;
  }
}// end function

function pop(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=480,height=200');");
}


function validateEmail(noun){
//noun.
  var atsign = noun;
  var atcount = atsign.split("@");
  if(atcount.length==2){
      //alert(atcount["1"]);
      var domain = atcount["1"].split(".");
      //alert(domain);
      //alert(domain.length);
      if(domain.length>=2){
         return '';
      }else{ 
         return ('Missing Email Address Ending!\n');       }

   }
   else{  
   	return ('Missing @ sign in email address!\n');   
   }
}// end function

function showDetail(id){
  new Effect[Element.visible('detail'+id) ? 'BlindUp' : 'BlindDown']('detail'+id, {duration: 0.25});
} 

