﻿function swapmenupic(image, changeto) {
  image.src = '/Media/Images/Common/' + changeto;
}
function swaphomepic(image, changeto) {
  image.src = '/Media/Images/HomePage/' + changeto;
}

function swapapppic(image, changeto) {
  image.src = '/Media/Images/AppForm/' + changeto;
}

function swapcareerspic(image, changeto) {
  image.src = '/Media/Images/Careers/' + changeto;
}
function showcontactnav() {
  document.getElementByID('ContactBlock').visibility = 'visible';
}
function hideDiv() {
  if (document.getElementById) {
    // DOM3 = IE5, NS6
    document.getElementById('ctl00_ctl00_hideShow').style.display = 'none';
  }
  else {
    if (document.layers) {
      // Netscape 4
      document.ctl00_ctl00_hideShow.visibility = 'hidden';
    }
    else {
      // IE 4
      document.all.ctl00_ctl00_hideShow.style.visibility = 'hidden';
    }
  }
}
function showDiv() {
  if (document.getElementById) {
    // DOM3 = IE5, NS6
    document.getElementById('ctl00_ctl00_hideShow').style.display = 'block';
  }
  else {
    if (document.layers) {
      // Netscape 4
      document.ctl00_ctl00_hideShow.visibility = 'visible';
    }
    else {
      // IE 4
      document.all.ctl00_ctl00_hideShow.style.visibility = 'visible';
    }
  }
}
function ShowThumbs(status) {
  if (status == 1) {
    document.getElementById('AdvertThumbs').style.display = 'block';
  }
  else {
    document.getElementById('AdvertThumbs').style.display = 'none';
  }
}
function OpenContactWin(theurl, thename, thewidth) {
  var openstring;
  openstring = 'width=' + thewidth + ',height=500,scrollbars=1';
  window.open(theurl, thename, openstring);
}
function showContacts(event) {
  $find('pce').showPopup();
  if (document.getElementById('ctl00_ctl00_btnContact') != null) {
    document.getElementById('ctl00_ctl00_btnContact').src = '/Media/Images/Common/btnContactUs_over.gif';
  }
  else {
    document.getElementById('ctl00_btnContact').src = '/Media/Images/Common/btnContactUs_over.gif';
  }
}
function hideContacts(e) {
  var toElement = e.relatedTarget || e.toElement;
  if (toElement != null) {
    if (toElement.tagName != "A" && toElement.tagName != "LI") {
      $find('pce').hidePopup();
      if (document.getElementById('ctl00_ctl00_btnContact') != null) {
        document.getElementById('ctl00_ctl00_btnContact').src = '/Media/Images/Common/btnContactUs_off.gif';
      }
      else {
        document.getElementById('ctl00_btnContact').src = '/Media/Images/Common/btnContactUs_off.gif';
      }
    }
  }
}
function hideTabs() {
  for (tabno = 1; tabno <= 4; tabno = tabno + 1) {
    var IdString = 'HPtab' + tabno;
    var PicIDString = 'pnltab' + tabno;
    var PicSrcOff = '/Media/Images/HomePage/pnl_hd_' + tabno + '.jpg';
    if (document.getElementById) {
      // DOM3 = IE5, NS6
      document.getElementById(IdString).style.display = 'none';
      document.getElementById(PicIDString).src = PicSrcOff;
    }
    else {
      if (document.layers) {
        // Netscape 4
        document.IdString.visibility = 'hidden';
        document.PicIDString.src = PicSrcOff;
      }
      else {
        // IE 4
        document.all.IdString.style.visibility = 'hidden';
        document.all.PicIDString.src = PicSrcOff;
      }
    }
  }
}
function showTab(id) {
  var IdString = 'HPtab' + id;
  var PicIDString = 'pnltab' + id;
  var PicSrcOn = '/Media/Images/HomePage/pnl_hd_' + id + '_over.jpg';

  if (document.getElementById) {
    // DOM3 = IE5, NS6
    document.getElementById(IdString).style.display = 'block';
    document.getElementById(PicIDString).src = PicSrcOn;
  }
  else {
    if (document.layers) {
      // Netscape 4
      document.IdString.visibility = 'visible';
      document.PicIDString.src = PicSrcOn;
    }
    else {
      // IE 4
      document.all.IdString.style.visibility = 'visible';
      document.PicIDString.src = PicSrcOn;
    }
  }
}





function createCookie(name, value, days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
    var expires = "; expires=" + date.toGMTString();
  }
  else var expires = "";
  document.cookie = name + "=" + value + expires + "; path=/";
}
function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for (var i = 0; i < ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0) == ' ') c = c.substring(1, c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
  }
  return null;
}
function eraseCookie(name) {
  createCookie(name, "", -1);
}
function loadTextSize() {
  resizeText(readCookie('fontsize'));
}
function setTextSize(multiplier) {
  if (ReadCookie("RHPCookiesAllowed") == null) {
    alert('This feature uses cookies, until you agree to accept cookies above you cannot use this feature');
  }else{
    eraseCookie('fontsize');
    createCookie('fontsize', multiplier, 365);
    resizeText(multiplier);
   }
 }

function resizeText(multiplier) {
  if (multiplier == 'normal') {
    document.body.style.fontSize = "1em";
  }
  if (multiplier == 'large') {
    document.body.style.fontSize = "1.1em";
  }
  if (multiplier == 'larger') {
    document.body.style.fontSize = "1.2em";
  }
}
