//inserts flash into templates

function writeFlash(width,height,location,transparent)
{
if (transparent=='yes'){trans1='<param name="wmode" value="transparent" />'; trans2='wmode="transparent" ';}
else {trans1='';trans2='';}
if (width=='') {width='100%';}
if (height=='') {height='100%';}
document.write('<object name=indexflash classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'"><param name="allowScriptAccess" value="sameDomain" />'+trans1+'<param name="movie" value="'+location+'" /><param name="quality" value="best" /><embed src="'+location+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'"  height="'+height+'" allowScriptAccess="sameDomain" '+trans2+'></embed></object>');
  }
  
  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 playMovie(frame,movieName)
{
	var flashMovie=getFlashMovieObject(movieName);
	flashMovie.GotoFrame(frame);		
}



//verify contact form fields
function verifyContact(){
var email=document.ContactForm.email.value;
var apos=email.indexOf("@");
var dotpos=email.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{
    alert("Please fill in a valid email address. Ex: email@emailprovider.com");
    return false
    }
    else if(document.ContactForm.email.value=="" || document.ContactForm.email.value==null)
        {
           alert("Please fill in a valid email address. Ex: email@emailprovider.com");
           return false
        }
else if (document.ContactForm.name.value=="" || document.ContactForm.name.value==null)
{
    alert("Please fill in your name");
    return false
    }
       else
        {
            return true
        }
}
