
// music to play when home page loads
var music = "mag_intro.wav";

// mini-contraction rollover images
var doesnt = null;
var wont = null;
var dont = null;

function ctx_over(contraction, out_others) {

   doesnt = document.getElementById("doesnt");
   wont = document.getElementById("wont");
   dont = document.getElementById("dont");

   // hide billboard if it exists
   bb = document.getElementById("billboard");
   if (bb) { 
      bb.style.visibility = "hidden"; 
   }

   switch (contraction) {
      case "doesnt":
         doesnt.style.visibility = "visible";
         doesnt.style.zIndex = 10;   
         if (out_others) {
            wont.style.visibility = "hidden";
            dont.style.visibility = "hidden";
         }
         break;
      case "wont":
         wont.style.visibility = "visible";
         wont.style.zIndex = 4;   
         if (out_others) {
            doesnt.style.visibility = "hidden";
            dont.style.visibility = "hidden";
         }
         break;
      case "dont":
         dont.style.visibility = "visible";
         dont.style.zIndex = 7;   
         if (out_others) {
            doesnt.style.visibility = "hidden";
            wont.style.visibility = "hidden";
         }
         break;
   }
}

function ctx_out(contraction) {
   var elem = document.getElementById(contraction);
   elem.style.visibility = "hidden";

   // show billboard if it exists
   bb = document.getElementById("billboard");
   if (bb) { 
      bb.style.visibility = "visible"; 
   }
}

function ctx_intro() {

   // mini rollover objects for future access
   doesnt = document.getElementById("doesnt");
   wont = document.getElementById("wont");
   dont = document.getElementById("dont");

   // don't play music if came here from elsewhere within the site
   if (document.referrer && (document.referrer != '')) {
      var domain_re = new RegExp(document.domain);
      if (document.referrer.match(domain_re)) {
         return;
      }
   }

 // bring up the mini contractions 'in sync' w/ music
   ctx_over('doesnt', 0);
   setTimeout("ctx_over('wont', 1)", 2300);
   setTimeout("ctx_over('dont', 1)", 3600);
   setTimeout("ctx_out('dont', 1)", 5500);
}
