function doMenuJump(theMenu)
{	
	if (theMenu.selectedIndex)
		window.location = theMenu.options[theMenu.selectedIndex].value;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_displayStatusMsg(msgStr) { //v1.0
 	status=msgStr;
 	document.MM_returnValue = true;
}
	
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
 	var ok=false; document.MM_returnValue = false;
 	with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
   	ok=(plugins && plugins[plgIn]);
 	} else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
   	if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
   else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
   else ok=autoGo; }
 if (!ok) theURL=altURL; if (theURL) window.location=theURL;
 }
 
function MM_displayStatusMsg(msgStr) { //v1.0
 	status=msgStr;
 	document.MM_returnValue = true;
}
	
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
 	var ok=false; document.MM_returnValue = false;
 	with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
   	ok=(plugins && plugins[plgIn]);
 	} else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
   	if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
   else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
   else ok=autoGo; }
 if (!ok) theURL=altURL; if (theURL) window.location=theURL;
 }


function openIt(url)
{
   var newWin = window.open(url,"","resizable=yes,menubar=yes,toolbar=yes,width=600,height=450,scrollbars=yes");
        
}

function openIt2(url)
{
   var newWin = window.open(url,"","resizable=yes,menubar=yes,toolbar=yes,width=550,height=400,scrollbars=yes");
        
}

function checkIt()
  {
  var lb_badinput = 0
  ls_msg='Please enter the following:\n'
  if (document.INFO.NAME.value == '' )
    {
    ls_msg += '\n\tName'
    lb_badinput = 1
    }
  if (document.INFO.EMAIL.value == '' )
    {
    ls_msg += '\n\tEmail Address'
    lb_badinput = 1
    }
  if (document.INFO.TITLE.value == '' )
    {
    ls_msg += '\n\tPosition'
    lb_badinput = 1
    }
  if (document.INFO.DIOCESE.value == '' )
    {
    ls_msg += '\n\tDiocese'
    lb_badinput = 1
    }
  if (document.INFO.SCHOOL.value == '' )
    {
    ls_msg += '\n\tSchool/Parish'
    lb_badinput = 1
    }
  if (document.INFO.ADDRESS.value == '' )
    {
    ls_msg += '\n\tAddress'
    lb_badinput = 1
    }
  if (document.INFO.CITY.value == '' )
    {
    ls_msg += '\n\tCity'
    lb_badinput = 1
    }
  if (document.INFO.STATE.selectedIndex == 0)
    {
    ls_msg += '\n\tState'
    lb_badinput = 1
    }
  if (document.INFO.ZIP.value == '' )
    {
    ls_msg += '\n\tZip Code'
    lb_badinput = 1
    }
  if (lb_badinput==1)
    {
    alert(ls_msg)
    return
    }
  document.forms[0].submit()
  }


function mailIt()
  {
  var msg="Is this information correct?\n\n"

  msg += "Profession: " 
  for ( i=0; i<document.forms[0].PROFESSION.length;i++)
    {
    if (document.forms[0].PROFESSION[i].checked)
      {    
      msg +=document.forms[0].PROFESSION[i].value;
      }
    } 

  msg += "\nName: " 
  msg += document.forms[0].NAME.value;
  msg += "\nTitle: " 
  msg += document.forms[0].TITLE.value
  msg += "\nSchool: " 
  msg += document.forms[0].SCHOOL.value
  msg += "\nAddress: " 
  msg += document.forms[0].ADDRESS.value
  msg += "\nCity: " 
  msg += document.forms[0].CITY.value
  msg += "\nDaytime Phone: " 
  msg += document.forms[0].PHONE.value
  msg += "\nE-mail: " 
  msg += document.forms[0].EMAIL.value
  msg += "\nGrade Level: " 
  msg += document.forms[0].GRADELEVEL.value
  if (confirm(msg)) document.forms[0].submit(); 
  }


function checkForm()
  {      
  var x=0; 
  var i;
  var blank_areas = "";
  var bFoundProf = 0;
  //alert (document.forms[0].PROFESSION== null)

  for ( i=0; i<document.forms[0].PROFESSION.length;i++)
    {
    if (document.forms[0].PROFESSION[i].checked) bFoundProf = 1;
    }
  if (bFoundProf ==0)
      {    
      blank_areas += "Profession \n";
      x = 1;
      }
    
  if (document.forms[0].NAME.value == "")
    {
    x=1
    blank_areas += "Name \n";
    }

  if (document.forms[0].TITLE.value == "")
    {
    x=1;
    blank_areas += "Title \n";
    }
           
  if (document.forms[0].SCHOOL.value == "")
    {
    x=1;
    blank_areas += "Parish/School \n";
    }
         
  if (document.forms[0].ADDRESS.value == "")
    {
    x=1;
    blank_areas += "Address \n";
    }
    
  if (document.forms[0].CITY.value == "")
    {
    x=1;
    blank_areas += "City, State, Zip \n";
    }

  if (document.forms[0].PHONE.value == "")
    {
    x=1;
    blank_areas += "Daytime Phone \n";
    }
  if (document.forms[0].STORY.value == "")
    {
    x=1;
    blank_areas += "Story \n";
    }


  if (x == 1)
    {
    alert("The following field(s) need to be filled in:\n\n" + blank_areas);                        
    }
  else
    {
    mailIt();
    }   
                                             
 }

function openPic(PictureURL)
        {
        browserName = navigator.appName;
        browserVersion = parseFloat(navigator.appVersion); 
        if (browserName == "Netscape" && browserVersion >= 4.0)
        {
                echeck = 'true';
        }
        else if (browserName == "Microsoft Internet Explorer" && browserVersion >= 3.0)
       {
                echeck = 'true';
        }
        else
        {
                echeck = 'false';
        }
        if (echeck == 'true')   
                {
                        var newWin = window.open(PictureURL,"Picture","width=170,height=170,resizable=no,scrollbars=no,menubar=no,toolbar=no");
                }
        else
                {
                        var newWin = window.open(PictureURL,"Picture","width=190,height=190,resizable=no,scrollbars=no,menubar=no,toolbar=no");
                }
        }
		
function check_email(){
var x = 0;
        if (document.postcard.from.value == ""){
                        alert("Enter your name please.");
                        x++;
   }
        if (document.postcard.to.value == ""){
                        alert("Enter the recipient's name please.");
                        x++;
   }
        if (document.postcard.from_email.value == ""){
                        alert("Enter your email address.");
                        x++;
   }
        if (document.postcard.to_email.value == ""){
                        alert("Enter recipient's email address.");
                        x++;
   }   
        if (document.postcard.from_email.value != ""){
                var emailFrom = new String(document.postcard.from_email.value);
                var find = emailFrom.indexOf("@");
                if (find == -1){
                        alert("Your email address is wrong!");
                        x++;
                }
        }
        if (document.postcard.to_email.value != ""){
                var emailTo = new String(document.postcard.to_email.value);
                var find = emailTo.indexOf("@");
                if (find == -1){
                        alert("Recipient's email address is wrong!");
                        x++;
                }
        }
   if (x == 0) {
   document.postcard.submit();
   }
}       
