<!--
/* Global code */

// Get navigator related infornation
var agt=navigator.userAgent.toLowerCase();
var appVer = navigator.appVersion.toLowerCase();
var is_minor = parseFloat(appVer);
var is_major = parseInt(is_minor);
var iePos = appVer.indexOf('msie');
if (iePos !=-1)
{
  is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
  is_major = parseInt(is_minor);
}
var is_ie = ((iePos!=-1));
var is_ie6 = (is_ie && is_major == 6);

/* Attach appropriate event handlers for IE, Firefox, Opera and Safari */

if (typeof window.addEventListener != 'undefined')
{
  window.addEventListener("load", changeDivHeight, false);
  window.addEventListener("resize", changeDivHeight, false);
}
else if (typeof document.addEventListener != 'undefined')
{
  document.addEventListener("load", changeDivHeight, false);
  document.addEventListener("resize", changeDivHeight, false);
}
else if (typeof window.attachEvent != 'undefined')
{
  window.attachEvent("onload", changeDivHeight);
  window.attachEvent("onresize", changeDivHeight);
}

/* Cross browser height method */

function getHeight()
{
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    return window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    return document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientHeight ) ) {
    //IE 4 compatible
    return document.body.clientHeight;
  }
  return 768;
}

/* Cross browser separator height fix */

function changeDivHeight()
{
  var seperator = document.getElementById('seperator');
  if (seperator)
  {
    if (typeof window.addEventListener != 'undefined')
    {
      seperator.style.height = (getHeight() - 320) + "px";
    }
    else if (typeof document.addEventListener != 'undefined')
    {
      seperator.style.height=(getHeight() - 320)+"px";
    }
    else if (typeof window.attachEvent != 'undefined')
    {
      // IE6
      seperator.style.height=(getHeight() - 320);
    }
  }

  // In case op IE 6 fix client height as well. non Quirks mode
  if (is_ie6)
  {
    fixIE6ClientHeight();
  }
}

/* IE6 specific fixes */

function fixIE6()
{
  fixIE6Transparency();
  fixIE6ClientHeight();
}

/* Fix transparency op logo in IE6 */

function fixIE6Transparency()
{
  var element = document.getElementById('hdrlogo');
  var source = "/data/images/hdr_logo-trans.png";
  element.src = "/data/images/blank.gif";
  element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft." +
          "AlphaImageLoader(src='" + source + "',sizingMethod='scale')";
}

function fixIE6ClientHeight()
{
  document.body.style.height = getHeight() - 282;
}

/* visibility */

function toggleVisibility(ctrl, divid)
{
  var element = document.getElementById(divid);
  if (element.style.display == 'block')
  {
    element.style.display = 'none';
    ctrl.className = 'detailsclosed';
  }
  else
  {
    element.style.display = 'block';
    ctrl.className = 'detailsopen';
  }

  return false;
}

/* ANTI spam harvesting */

function InjectEmailAdresses()
{
  var email = "info"
  var domain = "peopleserve.nl"

  var emailElement = document.getElementById("email");
  if (emailElement)
  {
    anchor1 = document.createElement("a");
    anchortext=document.createTextNode(email + "@" + domain)
    anchor1.appendChild(anchortext);
    anchor1.setAttribute('href',"mail" + "to:" + email + "@" + domain);
    emailElement.appendChild(anchor1);
  }
}


/* Menu subsititution */


replaceImages = new Array(
  'home|mnu_home.png|12|209',
  'People Serve Dienstverlening|mnu_dienstverlening.png|15|209',
  'People Serve ICT|mnu_ict.png|14|209',
  'vacaturebank|mnu_vacaturebank.png|12|209',
  'over People Serve|mnu_over.png|14|209',
  'oplossingen voor u|mnu_oplossingen.png|15|209',
  'werken bij People Serve|mnu_werkenbij.png|15|209',
  'contact|mnu_contact.png|11|209',
  'over People Serve ICT|mnu_over_ict.png|14|209',
  'diensten|mnu_diensten.png|12|209',
  'voor professionals|mnu_professionals.png|14|209',
  'detacheren|col_detacheren.png|19|202',
  'outsourcing|col_outsourcing.png|24|202',
  'werving & selectie|col_wervingenselectie.png|31|202',
  'chauffeursdiensten|col_chauffeursdiensten.png|19|202',
  'projectteams|col_projectteams.png|31|202'
  );

function firdom(){
  if(document.getElementsByTagName && document.createElement){
    var achors=document.getElementsByTagName('a');
    scanandreplace(achors);
  }
}

function highlight()
{
}

function addEvent( obj, type, fn )
{
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}


function scanandreplace(achors){
  for(var i=0;i<achors.length;i++){
    var thisanchor=achors[i];

    if (thisanchor.parentNode.parentNode.className != 'submenu')
    {
      var selected = false;

      if (thisanchor.className == 'selected')
      {
        selected = true;
      }

      for(var f=0;f<replaceImages.length;f++){
        var chunks=replaceImages[f].split('|');
        if(thisanchor.firstChild.nodeValue==chunks[0]){

          var newImg=document.createElement('img');
          newImg.setAttribute('alt',chunks[0])
          if (!selected)
          {
            newImg.setAttribute('src', '/data/images/' + chunks[1]);
            newImg.setAttribute('height', chunks[2]);
            newImg.setAttribute('width', chunks[3]);

            var element = newImg;
            addEvent(element, 'mouseover',
              function()
              {
                 var src = this.getAttribute('src');
                 var part = src.substring(3,0);
                 if (part != 'hl_')
                 {
                   var data = src.split('/');
                   data[data.length-1] = "hl_" + data[data.length-1];

                   var newsrc = "";
                   for(i=0;i<=data.length-2;i++){
                      newsrc += data[i] + '/';
                   }
                   newsrc += data[data.length-1];

                  this.setAttribute('src', newsrc)
                 }
              });
            addEvent(newImg, 'mouseout',
              function()
              {
                 var src = this.getAttribute('src');
                 this.setAttribute('src', src.replace("hl_",""))

              });
          }
          else
          {
            newImg.setAttribute('src', '/data/images/' + "hl_" + chunks[1]);
            newImg.setAttribute('height', chunks[2]);
            newImg.setAttribute('width', chunks[3]);
          }

          thisanchor.replaceChild(newImg,thisanchor.firstChild)
        }
      }
    }
  }
}


/* File upload */

function displayFilename(fName)
{
  fullName = fName;
  shortName = fullName.match(/[^\/\\]+$/);

  var element = document.getElementById("filename");
  element.value = shortName;
}

/* Main entry point */

function initializePage()
{
  InjectEmailAdresses();
  firdom();

  if (is_ie6)
    fixIE6();
}



//-->

