// JavaScript Document
function loader() {
	MM_preloadImages('images/nav_global_home_on.gif','images/nav_global_job_on.gif','images/nav_global_ontact_on.gif','images/nav_about_on.gif','images/nav_programs_on.gif','images/nav_workshops_on.gif','images/nav_news_on.gif','images/nav_community_on.gif','images/nav_donate_on.gif');
	}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}

function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

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_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_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 clearemail()  {
	document.email.email.value="";	
}

//SCROLLER TEXT BOX 
<!-- start javascript --- 
 
/*
   Feel free to use this script in your own page, making changes were
   necessary, but do leave the following line in the code.  Thanks

   Copyright 1996, E.T. Smith Associates Brogue, Pennsylvania, USA 

   Special thanks to Andy Augustine for helping me rewrite the 
   script to be more readable and object oriented. Check out
   http://www.freqgrafx.com/411/ for javascript info and codes.
*/ 

/* The following set of parameters control the scrolling text and the
   box that contains it.

   bgn_ln   is the line which you want to appear in the box when the
            page loads, is only shown once. Leave blank if there is 
            to be no beginning line (though do leave the quotes).

   txt_ln   is the scrolling text. There is no real need to concatenate
            the line. Though for a long string of several messages it
            easier to edit the text using concatenation as shown.

   end_ln   is the text you want to appear the box when the scrolling 
            is over. Leave blank if there is to be no end message.

   speed    is the number of milliseconds for the line to move one 
            character.  A lower number will cause a higher speed. 
            Note: Higher speeds are limited by the speed of the user's
            cpu and other loads on it.

   box_lg   is the length of the text box (form input element) in
            which the scrolling text appears

   max      is the maximum number of scroll iterations to be done. To
            have a continuous scroll, just use rather large number(1000).
            I doubt everyone will be looking at it take long.

   the other variables: count; pos; stop; box_ln; msg_ln are used by the 
   script and should be left at their currently set initation values.

   The names of the form and box used for scrolling are scrlform and
   scrlbox.  I won't expect you to need different names, but if you do,
   make sure to change all occurances of these names in the following
   script and the script in the bottom half of the page.

   Also if the scrolling text is to be located such that it might not
   be seen when the page loads, please read the comments in the
   function scrlbox about preventing inadvertant stops by the user.

*/   
 

 function scrlbox() 
   { 
    /* if whole has been scrolled, reset to beginning of line */
    if( scrl.pos > scrl.msg_ln.length ){
      scrl.pos = 1;  
      scrl.count++; 
     } 
    
   /* construct display line using the line position property */
   scrl.box_ln = " "; 
   scrl.box_ln += scrl.msg_ln.substring(scrl.pos,scrl.msg_ln.length);  
   scrl.box_ln += scrl.msg_ln.substring(0,scrl.pos);  
 
   /* continue, if user hasn't unfocused the box */
   if( scrl.stop == 0 ) 
     {   
      /* The following sets focus on the scroll box, allowing the user to
         easy stop the text by clicking out of the box.  If scroll is to
         be located such that when the page is loaded the box may not be
         seen, the user may inadvertantly stop the text by clicking on
         the page before seeing the box. For this case you may wish to
         comment out the following line. The user will then have to click
         in the box and then out of the box to stop the text.
       */  
      document.scrlform.scrlbox.focus(); 

      /* continue if the maximum iterations have not been done */ 
      if( scrl.count < scrl.max ) 
        { 
         scrl.pos++; /* advance line postion for next iteration */
         document.scrlform.scrlbox.value = scrl.box_ln; /* display new line */
         time3 = window.setTimeout('scrlbox()',scrl.speed); /* restart function */
        } 
      else /* maximum iteration been done */ 
        { 
         if ( scrl.end_ln.length > 2 ){ /* display end message if any */
            time2 = window.setTimeout("document.scrlform.scrlbox.value ="+ 'scrl.end_ln',scrl.speed); 
           } 
         document.scrlform.scrlbox.blur(); /* remove focus, so user */
        }                                  /* can easily restart */ 
     } 
 
 
  } 
 /* restart function */
 function startscrl() 
  { 
   scrl.stop = 0; 
   scrl.pos = 0; 
   scrlbox(); 
  } 
 
/* stop function */ 
function stopscrl() 
 { 
  scrl.stop = 1; 
 } 
 

