/*NOTES: 
Tthe following items are dynamically generated from CSX:
LoadContent() 
aContent[]
*/  

function gotoConfPage()
{csxOpenPage('macroecon.pclsConferences','pageconferences','','');
}

// var for mpi icon (icon4) click routine
var mpiclick = 0;

// various working vars
var  pageLoaded = false;
var lastLoaded=-1;
var JS = Boolean(1 + 0)
var NS4 = Boolean(document.layers);
var IE4 = Boolean(document.all);
var IE5 = Boolean(navigator.appVersion.indexOf('MSIE 5') > 0)
var safeResizeNS4_widthCheck
var safeResizeNS4_heightCheck
var writeToLayer_layers = new Array
var hexValue_hexChar="0123456789ABCDEF";



        //var for sticky icons
        var SelectedIcon = null;
        var lockIcon = -1;
        
        var aImg = new Array();
          aImg[0] = document.Icon0;
          aImg[1] = document.Icon1;
          aImg[2] = document.Icon2;
          aImg[3] = document.Icon3;
          aImg[4] = document.Icon4;
        
        var aImgSrcOn = new Array();
          aImgSrcOn[0] = '../images/homeicons/recentreportson.gif';
          aImgSrcOn[1] = '../images/homeicons/nextconferenceon.gif';
          //aImgSrcOn[2] = '../images/homeicons/chartofthedayon.gif';
          aImgSrcOn[2] = '../images/homeicons/EakinFPIon.gif';
          aImgSrcOn[3] = '../images/homeicons/publicreadingroomon.gif';
          aImgSrcOn[4] = '../images/homeicons/MeyersMPIon.gif';
        
        var aImgSrcOff = new Array();
          aImgSrcOff[0] = '../images/homeicons/recentreportsoff.gif';
          aImgSrcOff[1] = '../images/homeicons/nextconferenceoff.gif';
          //aImgSrcOff[2] = '../images/homeicons/chartofthedayoff.gif';
          aImgSrcOff[2] = '../images/homeicons/EakinFPIoff.gif';
          aImgSrcOff[3] = '../images/homeicons/publicreadingroomoff.gif';
          aImgSrcOff[4] = '../images/homeicons/MeyersMPIoff.gif';
        
        var aIcons = new Array();
        aIcons[0] = new makeIcon(0);
        aIcons[1] = new makeIcon(1);
        aIcons[2] = new makeIcon(2);
        aIcons[3] = new makeIcon(3);
        aIcons[4] = new makeIcon(4);
        
       function makeIcon(i)
        {       
          this.img = aImg[i];
          this.content = aContent[i];
          this.srcOn = aImgSrcOn[i];
          this.srcOff = aImgSrcOff[i];
        }         

        
        function IconOver(i){
          aIcons[i].img.src = aIcons[i].srcOn;  
          LoadContent(i);
        }
        
        function IconOut(i){
          if (i== -1) return false;
            aIcons[i].img.src = aIcons[i].srcOff;
        }


// functions
function safeResizeNS4(state) {
  if (NS4 && state) {
    safeResizeNS4_widthCheck = window.innerWidth;
    safeResizeNS4_heightCheck = window.innerHeight;
    window.onResize = resizeFixNS4;
  }
}

function resizeFixNS4() {
  // reload a page (NS not happy with relative layer writes/refreshes)
  
  if (safeResizeNS4_widthCheck != window.innerWidth || safeResizeNS4_heightCheck != window.innerHeight) {
    document.location.href = document.location.href;
    document.location.reload(true);
  } 
}

function writeToLayer(layid, text, topOffset, leftOffset) {   
  // for relative layers, mostly to accomodate NS issues - cache to avoid flicker
  
  if (writeToLayer_layers[layid] == text) {
    return false
  } else {
    writeToLayer_layers[layid] = text
  }

  if (IE4) {eval('document.all.' + layid + '.innerHTML = text');}

  if (NS4) {
    xAll(layid).setInnerHTML(text);
  }
}

function IEOrNSTag(IE4Tag, NS4Tag, parms, innerHTML) {
  // produces a tagset as desired for either IE or NS
  var sTag = '';
  var sout = '';
  
  if (IE4) {sTag = IE4Tag} else {if (NS4) {sTag = NS4Tag}}

  sout = '<' + sTag
  if (parms) {
    sout += ' ' + parms
  }
  sout += '>'
  if (innerHTML) {
    sout += innerHTML 
  }
  sout += '</' + sTag + '>'
  return sout;
}

function purch(productID)
{
sendMessage('Macroecon.pclsPurchase','msgStartPurchase',productID)
}

function underline(obj)
{
obj.style.textDecoration='underline';
obj.style.cursor = 'hand';
}

function noUnderline(obj)
{
obj.style.textDecoration='none'
}

function changeMPIPicLink()
{
if (mpiclick != 0) {
	mpiclick = mpiclick + 1 
	location.href = "http://www.meyersmpi.com";
} else {
	
  mpiclick = mpiclick + 1
	}
}