
function investor_validate() {

    if (document.getElementById('invlogin').Email.value == "") {
        alert ("You must fill in your email address");
        return false;

    } else {
		var tstEmailStr = new String(document.getElementById('invlogin').Email.value)
		var strPntr1 = tstEmailStr.indexOf("@");
		var strPntr2 = tstEmailStr.indexOf(".", strPntr1);
		if (strPntr1 == -1 || strPntr2 == -1) {
			alert ("The Email entry is invalid! Cannot submit this request.");
			return false;
		}
		
		
    }   

   if (document.getElementById('invlogin').Password.value == "") {
        alert ("Please fill in your password");
        return false;

    } 
    return true;
}

function investor(){

   hidePanel();
   varR1=' ';
   varR2=' ';
   var mainDiv = document.getElementById("main");
   var oldpanel = document.getElementById("newsPanel");
   if(oldpanel){
	mainDiv.removeChild(oldpanel);
   }



   var panel = document.createElement("div");
	panel.id = 'newsPanel';
   	panel.style.left='200px';
   	panel.style.top='75px';
   	panel.style.width='240px';
   	panel.style.position='absolute';
   	panel.style.zIndex=99;
   	mainDiv.appendChild(panel);

    var newHTML = "<div><div class=close><a onclick=hidePanel();>Close X</a></div>";
        newHTML = newHTML + "<div class=subtitle>Investor Login</div>";
          newHTML = newHTML + "<div class=summary><p>If you are an Aeroclave investor, please login to the investor’s portal below:</p>";
          newHTML = newHTML + "<form id='invlogin' name='invlogin' action='../investor/index.php' method='post' onSubmit='return investor_validate()'>";
          newHTML = newHTML + "<p><table class='FormLayout'>";
          newHTML = newHTML + "<tr><td>Email</td> <td><input name='Email' id='Email' value='' size=20></td></tr>";
          newHTML = newHTML + "<tr><td>Password</td> <td><input name='Password' id='Password'  value='' size=20></td></tr>";
          newHTML = newHTML + "<tr><td colspan=2 align=right><input type='submit' value='Login'></td></tr>";
 
          newHTML = newHTML + "<tr><td colspan=2><HR></td></tr>";
          newHTML = newHTML + "<tr><td colspan=2><B>Corporate Office</B><br>Toll Free: 800-788-9119<br>Telephone: 407-788-3300<br>FAX:  407-339-0119</td></tr>";
          newHTML = newHTML + "</table></form>";

   panel.innerHTML=newHTML;
   panel.scrollIntoView(showAtTop=0);
   panel.style.visibility='visible';
}

function hidePanel(){
   var mainDiv = document.getElementById("main");
   var panel = document.getElementById('newsPanel');
   if(panel) {
	 mainDiv.removeChild(panel);
   }
}
