// I decided to use an external file for organizing all javascript code to keep things clean

<!-- For maximum compadibility we define javascripts like this  ******* i need to make sure that i'm doing this right since im using functions here.  Maybe I can put the padding code once around all of the functions instead of one for each. !!!!! Now that I think about it, I assume I dont need it at all here. -->
/* <! [CDATA{ */
	 	  
	   // This function opens  a  welcome popup page,
	   function openWelcomePopup(){	
	   // I like the way UML has thier popup when we log in so I'll put mines up at the top left corner of the screen.
				
		  window.open("http://ceweb.uml.edu/atodm699/welcome.html","Welcome","toolbar=no, menubar=no,location=no,scrollbars=no, resizable=no,width=250,height=250, screenX=100,left=100,screenY=50,status=yes" );
	   }
	/* ]]> */ 
	
	function openShowsPopup(){
		
		// links to my google calendar
	    window.open("http://www.google.com/calendar/embed?src=mysoundlab@googlemail.com","Events","toolbar=no, menubar=no,location=no,scrollbars=no, resizable=no,width=500,height=500, screenX=100,left=100,screenY=50,status=yes" );

	}
   
   
	   	   // This function opens  a  welcome popup page,
	   function openDownloadPopup(){	
	   // I like the way UML has thier popup when we log in so I'll put mines up at the top left corner of the screen.
		  window.open("download.html","Welcome","toolbar=no, menubar=no,location=no,scrollbars=no, resizable=no,width=250,height=250, screenX=100,left=100,screenY=50,status=yes" );
	   }
	   
	   // Check for correct email value or show alert .   I FORGOT TO ADD the .value  ** REMEMBER THAT
	   function validateContactForm(){
		   isErrors = false;
		   errorMessage = "To send feedback, please fix the following errors:\n\n";  // append to the message if errors are detected
		  
		  var theForm = document.forms["contactForm"];
		  
		  /*  Since I cant log errors, I'll echo veriables out to an alert prompt  */
		  // errorMessage += theForm.subjectSending.value;
		  // errorMessage += theForm.messageFromSender.value;
		  // errorMessage += theForm.nameOfSender.value;
		   
		   
		   
		  // Make sure name is not empty
		  if( theForm.nameOfSender.value== "" ){
				errorMessage += "Your name cannot be blank.\n";	 //  add to error message 
				isErrors = true;
				theForm.nameOfSender.focus(); // set the focus to this input

		   }
		 
		  // Make sure email is correct
		    if(  theForm.emailOfSender.value==""  ){
				errorMessage += "Your email address cannot be blank.\n";	 //  add to error message 
				isErrors = true;
				
				theForm.emailOfSender.focus(); // set the focus to this input

		   }
		  
		  // Make sure subject is correct
		  if(  theForm.subjectSending.value=="" ){
				errorMessage += "The subject cannot be blank.\n";	 //  add to error message 
				isErrors = true;
				theForm.subjectSending.focus(); // set the focus to this input

		  }
		  
		  // Make sure message is correct
		  if(  theForm.messageFromSender.value==""  ){
				errorMessage += "The message cannot be blank.\n";	 //  add to error message 
				isErrors = true;				
				theForm.messageFromSender.focus(); // set the focus to this input

		  }
		  
		  // Make sure the message is not too short
		   if(  theForm.messageFromSender.value.length < 4  ){
				errorMessage += "The message is too short.\n";	 //  add to error message 
				isErrors = true;				
				theForm.messageFromSender.focus(); // set the focus to this input

		  }
		  
		  
		  // ****** MY EMAIL IS i@INSIGHT.FM so I wont check for com.  I could possible check the length of the last few characters after the .
		    if ( theForm.emailOfSender.value.indexOf("@") < 1  ||   theForm.emailOfSender.value.indexOf(".") < 3 ){

				errorMessage += "The email address is not valid.\n";	 //  add to error message 
				isErrors = true;				
				theForm.messageFromSender.focus(); // set the focus to this input

 
 			} 
		 
			
		   
		    if (isErrors == true){
			 alert(errorMessage);
			  return false;
		     } 
		  
		  
		// SEND THE MESSAGE using my php page 'andresEmailer' !
 		subject = theForm.subjectSending.value;
		message =  theForm.messageFromSender.value;
		senderemail = theForm.nameOfSender.value;
		
		
		   
		return true;
			  
			  
		  
	   }
	    
	   
	   	// This function handles the youTube popup // to do: used entered link as an argument
	   function openYouTubeVideoPopUp(){
		   
		   // The area for our video should be in the center of the screen and be very big for the viewers attention.
		  window.open("beatSequencerVideo1.html","Video","toolbar=no, menubar=no,location=no,scrollbars=no, resizable=no,width=850,height=650, screenX=100,left=100,screenY=50,status=yes" );
		   
	   }
	   
	    // This function handles the youTube popup // to do: used entered link as an argument
	   function openBeatSequencerBasicVideoPopUp(){
		   
		   // The area for our video should be in the center of the screen and be very big for the viewers attention.
		  window.open("beatSequencerBasicVideo.html","Video","toolbar=no, menubar=no,location=no,scrollbars=no, resizable=no,width=850,height=650, screenX=100,left=100,screenY=50,status=yes" );
		   
	   }
	   
	   	// This function handles the youTube popup // to do: used entered link as an argument
	   function openCircluesVideoPopUp(){
		   
		   // The area for our video should be in the center of the screen and be very big for the viewers attention.
		  window.open("circluesVideo.html","Video","toolbar=no, menubar=no,location=no,scrollbars=no, resizable=no,width=850,height=650, screenX=100,left=100,screenY=50,status=yes" );
		   
	   }
	   




