﻿// JScript File

AC_FL_RunContent = 0;

// =======================================
// set the following variables
// =======================================
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array(); // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
var total=50;
var n=0;
for (var i=0;i<total; i++)
{
n=i+1;
Pic[i] = 'ad_images/p'+n+'.png';
}
// =======================================
// do not edit anything below this line
// =======================================
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++){
   preLoad[i] = new Image();
   preLoad[i].src = Pic[i];
}
function runSlideShow(){
    if (document.all){
        document.images.SlideShow.style.filter="blendTrans(duration=2)"
         document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
        document.images.SlideShow.filters.blendTrans.Apply()      
    }
    document.images.SlideShow.src = preLoad[j].src
    if (document.all){
        document.images.SlideShow.filters.blendTrans.Play()
    }
    j = j + 1
    if (j > (p-1)) j=0
    t = setTimeout('runSlideShow()', slideShowSpeed)
}
function changeImage(imgName, newSrc)
{
    var img = document.getElementById(imgName);
    if(img)
    {
        img.src = newSrc;
    }
}
function ToggleDisplay(id,imgId)
{
    var elem = document.getElementById(id);
    var img = document.getElementById(imgId);
    if (elem)
    {
      if (elem.style.display != 'block')
      {
        elem.style.display = 'block';
        elem.style.visibility = 'visible';
        img.src = 'images/minus.jpg'; 
      }
      else
      {
        elem.style.display = 'none';
        elem.style.visibility = 'hidden';
        img.src = 'images/plus.jpg'; 
      }
    }
}
function Popup(source)
{
    var smallImages = document.getElementById("roll-over-images");
    var largeImage = document.getElementById("pop-up-image");
    var image = document.getElementById("pop-up-display-image");
    if (smallImages)
    {
      smallImages.style.display = 'none';
      smallImages.style.visibility = 'hidden';
      largeImage.style.display = 'block';
      largeImage.style.visibility = 'visible';
      image.src=(source);
    }
}
function Popdown()
{
    var smallImages = document.getElementById("roll-over-images");
    var largeImage = document.getElementById("pop-up-image");
    var image = document.getElementById("pop-up-display-image");
    if (smallImages)
    {
      largeImage.style.display = 'none';
      largeImage.style.visibility = 'hidden';
      smallImages.style.display = 'block';
      smallImages.style.visibility = 'visible';
      image.src=("");
    }
}
//******
//dropDownActivate
//  This function turns on the dropdown menu portion of a navigation element
//******
//navBarElement - id of the element in the top level navigation bar
//dropDownElement - id of the dropdown element corresponding to
//the navBarElement
//******
function dropDownActivate(navBarElement, dropDownElement)
{
    var navBar = document.getElementById(navBarElement);
    var dropDown = document.getElementById(dropDownElement);
    RemoveClassName(navBar,"navmenu-dropdown-top");
    AddClassName(navBar,"navmenu-dropdown-top-active",1);
    dropDown.style.display = 'block';
    dropDown.style.visibility = 'visible';
}
//******
//dropDownDeactivate
//  This function turns off the dropdown menu portion of a navigation element
//******
//navBarElement - id of the element in the top level navigation bar
//dropDownElement - id of the dropdown element corresponding to
//the navBarElement
//******
function dropDownDeactivate(navBarElement, dropDownElement)
{
    var navBar = document.getElementById(navBarElement);
    var dropDown = document.getElementById(dropDownElement);
    RemoveClassName(navBar,"navmenu-dropdown-top-active");
    AddClassName(navBar,"navmenu-dropdown-top",1);
    dropDown.style.display = 'none';
    dropDown.style.visibility = 'hidden';

}
//******
//navMenuHoverOver
//  This function alters the background of a passed element
//******
//navBarElement - id of the target element
//******
function navMenuHoverOver(navBarElement)
{
    var navBar = document.getElementById(navBarElement);
    navBar.style.backgroundColor = "#FBDCD6";
}
//******
//navMenuHoverOut
//  This function alters the background of a passed element
//******
//navBarElement - id of the target element
//******
function navMenuHoverOut(navBarElement)
{
    var navBar = document.getElementById(navBarElement);
    navBar.style.backgroundColor = "White";
}


//******
//Javascript included to help with class manipulations
//******

// ----------------------------------------------------------------------------
// HasClassName
//
// Description : returns boolean indicating whether the object has the class name
//    built with the understanding that there may be multiple classes
//
// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to add
//
function HasClassName(objElement, strClass)
   {

   // if there is a class
   if ( objElement.className )
      {

      // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // get uppercase class for comparison purposes
      var strClassUpper = strClass.toUpperCase();

      // find all instances and remove them
      for ( var i = 0; i < arrList.length; i++ )
         {

         // if class found
         if ( arrList[i].toUpperCase() == strClassUpper )
            {

            // we found it
            return true;

            }

         }

      }

   // if we got here then the class name is not there
   return false;

   }


// ----------------------------------------------------------------------------
// AddClassName
//
// Description : adds a class to the class attribute of a DOM element
//    built with the understanding that there may be multiple classes
//
// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to add
//
function AddClassName(objElement, strClass, blnMayAlreadyExist)
   {

   // if there is a class
   if ( objElement.className )
      {

      // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // if the new class name may already exist in list
      if ( blnMayAlreadyExist )
         {

         // get uppercase class for comparison purposes
         var strClassUpper = strClass.toUpperCase();

         // find all instances and remove them
         for ( var i = 0; i < arrList.length; i++ )
            {

            // if class found
            if ( arrList[i].toUpperCase() == strClassUpper )
               {

               // remove array item
               arrList.splice(i, 1);

               // decrement loop counter as we have adjusted the array's contents
               i--;

               }

            }

         }

      // add the new class to end of list
      arrList[arrList.length] = strClass;

      // add the new class to beginning of list
      //arrList.splice(0, 0, strClass);
      
      // assign modified class name attribute
      objElement.className = arrList.join(' ');

      }
   // if there was no class
   else
      {

      // assign modified class name attribute      
      objElement.className = strClass;
   
      }

   }


// ----------------------------------------------------------------------------
// RemoveClassName
//
// Description : removes a class from the class attribute of a DOM element
//    built with the understanding that there may be multiple classes
//
// Arguments:
//    objElement              - element to manipulate
//    strClass                - class name to remove
//
function RemoveClassName(objElement, strClass)
   {

   // if there is a class
   if ( objElement.className )
      {

      // the classes are just a space separated list, so first get the list
      var arrList = objElement.className.split(' ');

      // get uppercase class for comparison purposes
      var strClassUpper = strClass.toUpperCase();

      // find all instances and remove them
      for ( var i = 0; i < arrList.length; i++ )
         {

         // if class found
         if ( arrList[i].toUpperCase() == strClassUpper )
            {

            // remove array item
            arrList.splice(i, 1);

            // decrement loop counter as we have adjusted the array's contents
            i--;

            }

         }

      // assign modified class name attribute
      objElement.className = arrList.join(' ');

      }
   // if there was no class
   // there is nothing to remove

   }

function PopulateCategory(strSelection) {
   
   var strHTML = "";

   switch (strSelection) {
       case "FireService":
            strHTML = "<ul> " +
			"<li>Aviation Rescue and Fire Fighting</li>" +
			"<li>Country Fire Authority - Victoria</li>" +
			"<li>Hong Kong Fire Services</li>" +
			"<li>Metropolitan Fire Brigade - Melbourne</li>" +
			"<li>Queensland Fire and Rescue Service - Queensland</li>" +
			"<li>Rural Fire Service - New South Wales</li>" +
		"</ul>";

           break;
       case "TrainingCompanies":
           strHTML = "<ul> " +
			"<li>Adgat - Iceland</li>" +
			"<li>M&O Global - New Zealand</li>" +
			"<li>ParCor</li>" +
			"<li>Queensland Training Services Pty Ltd</li>" +
			"<li>Safety Direct Solutions</li>" +
			"<li>Salamander Consulting</li>" +
			"<li>SGS</li>" +
			"<li>Total Hazard Solutions</li>" +
		"</ul>";
           break;
       case "Hospitality&Entertainment":
           strHTML = "<ul> " +
			"<li>American Museum of Natural History</li>" +
			"<li>Bellagio Hotel and Casino</li>" +
			"<li>Cirque Du Soleil</li>" +
			"<li>ESPN</li>" +
			"<li>Hamilton Island Resort</li>" +
			"<li>Mirage Casino</li>" +
			"<li>NASCAR</li>" +
			"<li>NBC</li>" +
			"<li>Vail Resorts</li>" +
			"<li>Warner Bros.</li>" +
			"<li>Wynn</li>" +
		"</ul>";
           break;
       case "Travel":
            strHTML = "<ul> " +
			"<li>Alaska Airlines</li>" +
			"<li>Jet Blue</li>" +
			"<li>Newark Airport</li>" +
			"<li>Portland Intl Airport</li>" +
			"<li>Qantas</li>" +
			"<li>Sun Country Airlines</li>" +
			"<li>Tucson Airport</li>" +
			"<li>WestJet</li>" +
		"</ul>";
           break;
       case "Healthcare":
            strHTML = "<ul> " +
			"<li>Bendigo Healthcare</li>" +
			"<li>Calvary Hospital</li>" +
			"<li>Princess Margaret Hospital</li>" +
			"<li>Queensland Health</li>" +
			"<li>Subiaco and Wangaratta Hospital</li>"
			"<li>Townsville Health Service District</li>" +
			"<li>Wollongong Hospital</li>" +
		"</ul>";
           break;
       case "Pharmaceutical":
            strHTML = "<ul> " +
			"<li>Astra Zeneca</li>" +
			"<li>Bayer Pharmaceutical</li>" +
			"<li>Eli Lilly</li>" +
			"<li>GlaxoSmithKline</li>" +
			"<li>Merck Sharp & Dohme</li>" +
			"<li>Pfizer</li>" +
			"<li>Wyeth Pharmaceutical</li>" +
		"</ul>";
           break;
       case "Colleges":
            strHTML = "<ul> " +
			"<li>Australian National University</li>" +
			"<li>Ballarat University</li>" +
			"<li>College of Australian Training</li>" +
			"<li>Melbourne University</li>" +
			"<li>RMIT University</li>" +
			"<li>University of New England - Australia</li>" +
		"</ul>";
           break;
       case "Manufacturing":
            strHTML = "<ul> " +
			"<li>AK Steel</li>" +
			"<li>Alcoa</li>" +
			"<li>Carter Holt Harvey Australia</li>" +
			"<li>Constellation Wines South Australia</li>" +
			"<li>CSBP Western Australia</li>" +
			"<li>General Electric</li>" +
			"<li>Luxfer Gas Cylinder</li>" +
			"<li>Mittal Steel</li>" +
			"<li>Rohm & Haas</li>" +
			"<li>Toyota Australia</li>" +
		"</ul>";
           break;
       case "Government":
            strHTML = "<ul> " +
			"<li>Australian Army</li>" +
			"<li>Australian Navy - Transfield Services</li>" +
			"<li>Corrections New South Wales</li>" +
			"<li>Corrections New Zealand</li>" +
			"<li>Corrections Victoria</li>" +
			"<li>Emergency Management Queensland</li>" +
			"<li>Queensland Department of Mines & Energy (Simtars)</li>"
            "<li>Queensland Government Health</li>" +
			"<li>RAAF</li>" +
		"</ul>";
           break;
       case "Energy":
            strHTML = "<ul> " +
			"<li>BHP Billiton</li>" +
			"<li>British Petroleum</li>" +
			"<li>DeBeers</li>" +
			"<li>Downer EDI Mining</li>" +
			"<li>HWE Mining</li>" +
			"<li>NSW Mine Rescue</li>" +
			"<li>Paramount</li>" +
			"<li>Phelps Dodge</li>" +
			"<li>PXP</li>" +
			"<li>Rio Tinto</li>" +
			"<li>Xcel Energy</li>" +
		"</ul>";
           break;
       default:
           strHTML = "";
           break;
    }
    return strHTML;
}

function so_clearInnerHTML(obj) {
   if (obj.innerHTML != "") {
       // perform a shallow clone on obj
       nObj = obj.cloneNode(false);
       // insert the cloned object into the DOM before the original one
       obj.parentNode.insertBefore(nObj, obj);
       // remove the original object
       obj.parentNode.removeChild(obj);
       nObj.innerHTML = "";
       obj.innerHTML = "";
   }
}

function CheckBrowser()
{
    if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
    { //test for MSIE x.x;
        var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
        if (ieversion>=7)
        {
            //Use 24 bit alpha blend
            alert("IE7 Detected");
            
        }
        else
        {
            //use 8 bit
            window.location = 'http://www.google.com';
            
        }
    }
    else
    {
        //Use 24 bit alpha blend
    }
    //alert(strNewImage);
}

