// JavaScripts (Copyright by Andre Abt | Monobasic Audio & Web Development | www.monobasic.com)

// Script for open a new Window
function openWin(sFile,sName,iWidth,iHeight) {
	window.open(sFile,sName,"width="+iWidth+",height="+iHeight+",screenX=50,screenY=50");
}

// Function to check entered form data
function formcheck() 
  {
  
  var sName = document.form.name;
  var sEmail = document.form.email;
  var sComments = document.form.comments;
  var sErrorcolor = "#ffff00";

  aErrors = new Array();
  
  
  sName.style.background = "transparent";
  sEmail.style.background = "transparent";
  sComments.style.background = "transparent";
  
  
     if ( sName.value.length < 2)
        {
          sName.style.background = sErrorcolor;
          aErrors.push("name");   
        }
      
     if ( sEmail.value.length < 8 || sEmail.value.indexOf("@") <= 0 || sEmail.value.indexOf(".") <= 0)
        {
          sEmail.style.background = sErrorcolor;
          aErrors.push("email");
	    }
        
     if ( sComments.value.length < 1)
        {
          sComments.style.background = sErrorcolor;
          aErrors.push("comments");
	    }
     
     if ( aErrors.length != 0)
        {
	      alert("Please fill in the following fields: " + aErrors );
	      return false;
        }
 
      
      //alert("all ok form will be sent...");
      return true;
            
  }
