function openWindow(url, w, h, sb) {
  var options = "width=" + w + ",height=" + h + ",";
  options += "resizable=no, status=no,";
  options += "menubar=no, toolbar=no, location=no, directories=no,";
  options += "scrollbars=" + sb;
  var newWin = window.open(url, 'newWin', options);
}

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 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);


/*
        -------------------------------------------------------------------------------------------------
        Random Image/Link JavaScript(tm) by Jim Matvichuk

        This code may be used freely as long as this copyright notice
        remains with the code.
        
                        Copyright© 1997, Jim Matvichuk
                        Jim_Matvichuk@compuserve.com
                        All rights reserved

        Last Revision: August 19, 1997  
        -------------------------------------------------------------------------------------------------
        Instructions:
        There are two Script sections on this page to create the
        Random Image/Link. This section (which should be placed between
        your HEAD tags, after the title and any meta tgas) and the section 
        in the body of this document.
 
        You will need both sections to display the Image/link.
   
        Change the array elements:     ae_('your href and/or image');
        in this section AND place the Javascript section in the body of this 
        document between your BODY tags where you want it to appear.

*/

// Global vars----
G_total_sa = 0;                                 // total random elements
G_day = new Date();                             // date for seed
G_seed = G_day.getTime();                       // G_seed for random number


//---CHANGE THESE ARRAY ELEMENTS TO YOUR LINK/IMAGE
//---ADD/SUBTRACT AS MANY AS YOU NEED
// Just replace your URL and image tags between the single quotes:  ae_('   your stuff here   ');

ae_('<a href="http://www.xcelenergy.com/" target="_blank"><img src="../images/sponsors/xcel.jpg" width="233" height="197" border="0"></a>');
ae_('<a href="http://www.firstnetimpressions.com/" target="_blank"><img src="../images/sponsors/fni.jpg" width="233" height="197" border="0"></a>');
ae_('<a href="http://www.northwesternbank.com/" target="_blank"><img src="../images/sponsors/nw_bank.jpg" width="233" height="197" border="0"></a>');
ae_('<a href="http://www.rooneyprinting.com/" target="_blank"><img src="../images/sponsors/rooney.jpg" width="233" height="197" border="0"></a>');
ae_('<a href="http://www.leadertelegram.com/" target="_blank"><img src="../images/sponsors/leader_telegram.jpg" width="233" height="197" border="0"></a>');
ae_('<a href="http://www.clearchannel.com/" target="_blank"><img src="../images/sponsors/clear_channel.jpg" width="233" height="197" border="0"></a>');
ae_('<a href="http://www.realityworks.com/" target="_blank"><img src="../images/sponsors/realityworks.jpg" width="233" height="197" border="0"></a>');
ae_('<a href="http://www.swimrite4fun.com/" target="_blank"><img src="../images/sponsors/swim_rite.jpg" width="233" height="197" border="0"></a>');
ae_('<a href="http://www.firstnetimpressions.com/" target="_blank"><img src="../images/sponsors/fni.jpg" width="233" height="197" border="0"></a>');
ae_('<a href="http://www.j-ots.com/" target="_blank"><img src="../images/sponsors/jenno.jpg" width="233" height="197" border="0"></a>');

//------------------------------------------------------------------------------------
// Function to Create image/link Object Array
//------------------------------------------------------------------------------------
function ae_ (description) {
        G_total_sa++;
        sa [G_total_sa] = description;
}

//-------------------------------------------------------------------------------------
// function to create a random number from 1 to total number
// of array elements
//-------------------------------------------------------------------------------------
function rand() {
RN = parseInt(((G_seed - (parseInt(G_seed/1000,10) * 1000))/10)/100*G_total_sa + 1,10);
        return RN;
}

///////////////////////////////////////////////////////////////////
// CREATE THE image/link OBJECT ARRAY
function sa () {}


//-------------------------------
//  Top bar random photo picker
//-------------------------------
G_total_sa1 = 0;                                 // total random elements
G_day1 = new Date();                             // date for seed
G_seed1= G_day1.getTime();                       // G_seed for random number

//ae1_('<a href="http://www.substanceec.org" target="_blank"><img src="/images/top_bar_photos/phil_wickham.jpg" width="565" height="98" border="0" align="top"></a>');
// REPLACE THESE TWO LINKS ONCE THE RANDOM REFRESH IS NEEDED AGAIN
//ae1_('<a href="http://www.trinity-ec.com/trinity_services/boarding.phtml"><img src="/images/top_bar_photos/winter_boarding.jpg" width="565" height="98" align="top" border="0"></a>');
//ae1_('<a href="http://www.trinity-ec.com/trinity_services/thursdays_at_trinity.phtml"><img src="/images/top_bar_photos/thursdays_at_trinity.jpg" width="565" height="98" align="top" border="0"></a>');
//ae1_('<a href="http://www.trinity-ec.com/trinity_services/healing_with_horses.phtml"><img src="/images/top_bar_photos/TherapyRidingBanner.jpg" width="565" height="98" align="top" border="0"></a>');
//ae1_('<a href="http://www.trinity-ec.com/trinity_services/ranch_care.phtml"><img src="/images/top_bar_photos/tec_ranchcare_banner.jpg" width="565" height="98" align="top" border="0"></a>');
//these 4 were current, prior to Spring Celebration Update
//ae1_('<a target="_blank" href="http://www.trinity-ec.com/pdf/Trinity_DeSpooking.pdf"><img src="/images/top_bar_photos/de-spooking.jpg" width="565" height="98" align="top" border="0"></a>');
//ae1_('<a target="_blank" href="http://www.trinity-ec.com/trinity_services/therapeutic_riding.phtml#forms"><img src="/images/top_bar_photos/Therapy2011Banner.jpg" width="565" height="98" align="top" border="0"></a>');
//ae1_('<a target="_blank" href="http://www.trinity-ec.com/trinity_services/therapeutic_riding.phtml#forms"><img src="/images/top_bar_photos/HWH2011_banner.jpg" width="565" height="98" align="top" border="0"></a>');
ae1_('<a target="_blank" href="http://www.trinity-ec.com/trinity_services/therapeutic_riding.phtml#forms"><img src="/images/top_bar_photos/HWH_2012.jpg" width="565" height="98" align="top" border="0"></a>');
ae1_('<a target="_blank" href="http://www.trinity-ec.com/trinity_services/therapeutic_riding.phtml#forms"><img src="/images/top_bar_photos/HWHAutism.jpg" width="565" height="98" align="top" border="0"></a>');
//ae1_('<a target="_blank" href="http://www.trinity-ec.com/trinity_services/eap.phtml"><img src="/images/top_bar_photos/EAGALAbanner.jpg" width="565" height="98" align="top" border="0"></a>');
ae1_('<a target="_blank" href="http://www.trinity-ec.com/pdf/Operation_WECARE.pdf"><img src="/images/top_bar_photos/OperationWeCareBanner.jpg" width="565" height="98" align="top" border="0"></a>');
ae1_('<img src="/images/top_bar_photos/thanksgiving.jpg" width="565" height="98" align="top" border="0">');
ae1_('<a href="http://www.trinity-ec.com/trinity_services/sponsor_a_veteran.phtml"><img src="/images/top_bar_photos/sponsor_a_vet.jpg" width="565" height="98" align="top" border="0"></a>');
//ae1_('<a target="_blank" href="http://www.trinity-ec.com/pdf/FallFunFest2011.pdf"><img src="/images/top_bar_photos/FallFestBanner.jpg" width="565" height="98" align="top" border="0"></a>');
//ae1_('<a target="_blank" href="http://www.trinity-ec.com/trinity_services/ranch_care.phtml"><img src="/images/top_bar_photos/2011RanchCareBanner.jpg" width="565" height="98" align="top" border="0"></a>');
//ae1_('<a target="_blank" href="http://www.trinity-ec.com/pdf/2011_Horse_Camp.pdf"><img src="/images/top_bar_photos/HorseCampBanner.jpg" width="565" height="98" align="top" border="0"></a>');
//ae1_('<a target="_blank" href="http://www.trinity-ec.com/pdf/Horsepower_for_Veterans.pdf"><img src="/images/top_bar_photos/HFV_banner.jpg" width="565" height="98" align="top" border="0"></a>');
//ae1_('<a target="_blank" href="http://www.trinity-ec.com/pdf/RanchCare_SpringCelebration.pdf"><img src="/images/top_bar_photos/RanchCare_Spring.jpg" width="565" height="98" align="top" border="0"></a>');

// Create image/link object array
function ae1_ (description) {
        G_total_sa1++;
        sa1 [G_total_sa1] = description;
}

// Create a random number from 1 to total number of array elements
function rand1() {
RN1 = parseInt(((G_seed1 - (parseInt(G_seed1/1000,10) * 1000))/10)/100*G_total_sa1 + 1,10);
        return RN1;
}

// Create the image/link object array
function sa1 () {}



//-------------------------------
//  Home page sponsors
//-------------------------------
G_total_sa2 = 0;                                 // total random elements
G_day2 = new Date();                             // date for seed
G_seed2= G_day2.getTime();                       // G_seed for random number

ae2_('<a href="http://www.xcelenergy.com/" target="_blank"><img src="images/sponsors/home/xcel.jpg" width="208" height="180" border="0"></a>');
ae2_('<a href="http://www.firstnetimpressions.com/" target="_blank"><img src="images/sponsors/home/fni.jpg" width="208" height="180" border="0"></a>');
ae2_('<a href="http://www.northwesternbank.com/" target="_blank"><img src="images/sponsors/home/nw_bank.jpg" width="208" height="180" border="0"></a>');
ae2_('<a href="http://www.rooneyprinting.com/" target="_blank"><img src="images/sponsors/home/rooney.jpg" width="208" height="180" border="0"></a>');
ae2_('<a href="http://www.leadertelegram.com/" target="_blank"><img src="images/sponsors/home/leader_telegram.jpg" width="208" height="180" border="0"></a>');
ae2_('<a href="http://www.clearchannel.com/" target="_blank"><img src="images/sponsors/home/clear_channel.jpg" width="208" height="180" border="0"></a>');
ae2_('<a href="http://www.realityworks.com/" target="_blank"><img src="images/sponsors/home/realityworks.jpg" width="208" height="180" border="0"></a>');
ae2_('<a href="http://www.swimrite4fun.com/" target="_blank"><img src="images/sponsors/home/swim_rite.jpg" width="208" height="180" border="0"></a>');
ae2_('<a href="http://www.firstnetimpressions.com/" target="_blank"><img src="images/sponsors/home/fni.jpg" width="208" height="180" border="0"></a>');


// Create image/link object array
function ae2_ (description) {
        G_total_sa2++;
        sa2 [G_total_sa2] = description;
}

// Create a random number from 1 to total number of array elements
function rand2() {
RN2 = parseInt(((G_seed2 - (parseInt(G_seed2/1000,10) * 1000))/10)/100*G_total_sa2 + 1,10);
        return RN2;
}

// Create the image/link object array
function sa2 () {}

//////////////////////////
// Email Obfuscator
// <a href="/site_map.phtml" onMouseOver="SetHREF(this, 'kyle', 'firstnetimpressions', 'com', 'FNI - Website Inquiry')" onFocus="SetHREF(this, 'kyle', 'firstnetimpressions', 'com', 'FNI - Website Inquiry')"><script>address("kyle", "firstnetimpressions", "com");< /script></a>
//////////////////////////

function address(name, dom, tld)
{
  var addr = name + '@' + dom + '.' + tld;
  document.write(addr);
}

function SetHREF(obj, box, dom, tld, sbj)
{
  var addr = 'mailto:' + box + '@' + dom + '.' + tld;
  addr = (sbj != null) ? addr + '?subject=' + sbj : addr;
  obj.href = addr;
}
