function InsertFlash()
{
  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="501" height="376" id="photos" align="middle">\n');
  document.write('<param name=""allowFullScreen" value="false" />\n');
  document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
  document.write('<param name="movie" value="photos.swf" />\n');
  document.write('<param name="quality" value="high" />\n');
  document.write('<param name="bgcolor" value="#FFFFFF" />\n');
  document.write('<embed src="photos.swf" quality="high" bgcolor="#FFFFFF" width="501" height="376" name="photos" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowFullScreen="false" />\n');
  document.write('</object>\n');
}

var win= null;
function NewWindow(mypage,myname,w,h,scroll){
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings ='height='+h+',';
	settings +='width='+w+',';
	settings +='top='+wint+',';
	settings +='left='+winl+',';
	settings +='scrollbars='+scroll+',';
	settings +='resizable=no';
	win=window.open(mypage,myname,settings);
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
function MM_openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}
var win= null;
function NewWindowWithScroll(mypage,myname,w,h,scroll){
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings ='height='+h+',';
	settings +='width='+w+',';
	settings +='top='+wint+',';
	settings +='left='+winl+',';
	settings +='scrollbars='+scroll+',';
	settings +='resizable=no';
	win=window.open(mypage,myname,settings);
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
function MM_openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}
function MM_openBrWindow(theURL,winName,features) {
	window.open(domain_url,winName,features);
}

function maximize() {
   	window.moveTo(0,0)
   	window.resizeTo(screen.availWidth, screen.availHeight)
}

function PlayFlashAudio()
{
	var flashMovie=getFlashMovieObject("audio");
	flashMovie.Play();
	//embed.nativeProperty.anotherNativeMethod();
}

function RewindFlashAudio()
{
	var flashMovie=getFlashMovieObject("audio");
	flashMovie.Rewind();
}

function StopFlashAudio()
{
	var flashMovie=getFlashMovieObject("audio");
	flashMovie.StopPlay();
}

function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
    return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}

function validateAudioRequestPageForm(Form_AudioRequest)
{

	if (!validEmail(Form_AudioRequest.email_address,"E-mail Address",true))
		return false;
	if (!validInquiry(Form_AudioRequest.inquiry,"Audio Request"))
		return false;
	
	return true;
}

function validateIndexPageForm(Form_Signup)
{

	if (!validEmail(Form_Signup.email_address,"E-mail Address",true))
		return false;
	
	return true;
}

function validateUnscribePageForm(Form_Unsubscribe)
{

	if (!validEmail(Form_Unsubscribe.email_address,"E-mail Address",true))
		return false;
	
	return true;
}

function validateContactPageForm(Form_Inquiry)
{

	if (!validFullName(Form_Inquiry.full_name,"First and Last Name",true))
		return false;
	if (!validEmail(Form_Inquiry.email_address,"E-mail Address",true))
		return false;
	if (!validInquiry(Form_Inquiry.inquiry,"Inquiry / Message"))
		return false;
	
	return true;
}

function validFullName(formField,fieldLabel)
{
	var result = true;
	
	if ((formField.value == "") || (formField.value.length <6 ))
	{
		alert('Please enter a value of 6 characters or more for the "' + fieldLabel +'" field.');
		formField.focus();
		result = false;
	}
	
	return result;
}

function validEmail(formField,fieldLabel,required)
{
	var result = true;
	
	if (required && !validEmail_Required(formField,fieldLabel))
		result = false;

	if (result && ((formField.value.length < 3) || !isEmailAddr(formField.value)) )
	{
		alert("Please enter your correct e-mail address (i.e.) yourname@yourdomain.com");
		formField.focus();
		result = false;
	}
   
  return result;

}

function validEmail_Required(formField,fieldLabel)
{
	var result = true;
	
	if (formField.value == "")
	{
		alert('Please enter a value for the "' + fieldLabel +'" field.');
		formField.focus();
		result = false;
	}
	
	return result;
}

function isEmailAddr(email)
{
  var result = false;
  var theStr = new String(email);
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function validInquiry(formField,fieldLabel)
{
	var result = true;
	
	if ((formField.value == "") || (formField.value.length <5 ))
	{
		alert('Please enter a value of 5 characters or more for the "' + fieldLabel +'" field.');
		formField.focus();
		result = false;
	}
	
	return result;
}

function validateResume(Form_Resume)
{
	if (!validResumeSubmission(Form_Resume.resume_submit,"Resume Submission"))
		return false;
	
	return true;
}

function validResumeSubmission(formField,fieldLabel)
{
	var result = true;
	
	if ((formField.value == "") || (formField.value.length <6 ))
	{
		alert('Please attach your resume to submit in the "' + fieldLabel +'" field.');
		formField.focus();
		result = false;
	}
	
	return result;
}
