
/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Mike Hudson :: http://www.afrozeus.com */


function setupFadeLinks() {
  arrFadeLinks[0]  = "/news/files/006+lucent-interview.pdf";
  arrFadeTitles[0] = "LUCENT INTERVIEW";
  arrFadeDates[0]  = "September 2011";
  arrFadeTxts[0]   = "With the stock market turmoil that has occurred over the summer months, many investors are now looking for a non correlated investment opportunity that can avoid such turbulence. The Lucent StrategicLand Fund (LSLF) offers such an alternative. We spoke to Lucent Group’s Chris Westerman.";
  
  arrFadeLinks[1]  = "/news/files/013   InCapThematic_171011.pdf";
  arrFadeTitles[1] = "8th In-Cap Coupon Paid out this year";
  arrFadeDates[1]  = "October 2011";
  arrFadeTxts[1]   = "In-Cap Thematic issue CE0075KAT, issued in October 2009 paid its second Annual Coupon of 9%, with investors receiving an average income of approximately USD 7,356.- each.";
  
  arrFadeLinks[2]  = "/news/files/031_InCapThematic_301211.pdf";
  arrFadeTitles[2] = "9th In Cap Coupon Paid Out this Year.";
  arrFadeDates[2]  = "January 2012";
  arrFadeTxts[2]   = "In-Cap Thematic issue KBC001, issued in December 2009 paid its second Annual Coupon of 9%, with investors receiving an average income of approximately USD 11,570.- each.";
  
  arrFadeLinks[3]  = "/news/files/page January 26 Noticeboard forex.pdf";
  arrFadeTitles[3] = "Over 60 financial advisors take part in Alternative Fund Management seminar.";
  arrFadeDates[3]  = "February 2012";
  arrFadeTxts[3]   = "OVER 60 leading Independent Finan-cial Advisors (IFAs) and investment fund professionals from around the world (including Cyprus, Hong Kong, US, UK, Scandinavia, Greece, and Australia) attended the PCP Funds.com Alternative Fund Management seminar in Limassol last week. The PCP event focusing on Alternative As-set Classes was endorsed by the Cy-prus International Financial Services Association (CIFSA).";
  
  arrFadeLinks[4]  = "/data/032_LampFund_150212.html";
  arrFadeTitles[4] = "Q1 Promotion";
  arrFadeDates[4]  = "February 2012";
  arrFadeTxts[4]   = "Introducing a London property fund with a difference...<p>LAMP Fund taps residential opportunity with new liquidity model...<p>Launching 2nd April, the London Actively Managed Property (LAMP) Fund provides investors with access to attractive returns generated from property trading opportunities in London and the South East.";
  
}

// You can also play with these variables to control fade speed, fade color, and how fast the colors jump.

var m_bFadeOut = false;


// fade using opacity instead of the color...
var m_fromOpacity = 0;
var m_toOpacity   = 100;
var m_time        = 1500;
var m_fps         = 25;
var m_waitTime    = 500;


window.onload = Fadewl;

var arrFadeLinks;
var arrFadeTitles;
var arrFadeDates;
var arrFadeTxts;
var arrFadeCursor   = 0;
var arrFadeMax;

function Fadewl() 
{
//  m_iFadeInterval = setInterval(fade_ontimer_opaq, 10);
  arrFadeLinks  = new Array();
  arrFadeTitles = new Array();
  arrFadeDates  = new Array();
  arrFadeTxts   = new Array();
  setupFadeLinks();
  arrFadeMax = arrFadeLinks.length-1;
  setFadeLink();
  fade_ontimer_opaq();
}

function setFadeLink() {
  var ilink = document.getElementById("fade_link");
  var iDate = document.getElementById("fade_date");
  var iTxt  = document.getElementById("fade_txt");
  ilink.innerHTML = arrFadeTitles[arrFadeCursor];
//  ilink.innerHTML = arrFadeTitles[arrFadeCursor] + " <img src=\"images/arrow.r.gif\" width=\"10\" height=\"10\" border=\"0\" align=\"absmiddle\" />";
  ilink.href      = arrFadeLinks[arrFadeCursor];
  iDate.innerHTML = arrFadeDates[arrFadeCursor];
  iTxt.innerHTML  = arrFadeTxts[arrFadeCursor];
}



function SetOpacity(elem, opacityAsInt)
{
  var opacityAsDecimal = opacityAsInt;
  
  if(opacityAsInt > 100)
  {
    opacityAsInt = opacityAsDecimal = 100;
  }
  else if(opacityAsInt < 0)
  {
    opacityAsInt = opacityAsDecimal = 0;
  }

  opacityAsDecimal /= 100;
  if(opacityAsInt < 1)
  {
    opacityAsInt = 1; // IE7 bug, text smoothing cuts out if 0
  }

  elem.style.opacity = (opacityAsDecimal);
  elem.style.filter = "alpha(opacity=" + opacityAsInt + ")";
}


function FadeOpacity(fromOpacity, toOpacity, time, fps)
 {
     var steps = Math.ceil(fps * (time / 1000));
     var delta = (toOpacity - fromOpacity) / steps;
     
     FadeOpacityStep(0, steps, fromOpacity, 
                     delta, (time / steps));
 }
 
function FadeOpacityStep(stepNum, steps, fromOpacity, delta, timePerStep)
 {

  SetOpacity(document.getElementById("fade_away"), Math.round(parseInt(fromOpacity) + (delta * stepNum)));
    
   if (stepNum < steps)
   {
     setTimeout("FadeOpacityStep(" + (stepNum+1) + ", " 
								   + steps       + ", " 
								   + fromOpacity + ", " 
								   + delta       + ", " 
								   + timePerStep + ");", timePerStep);
	}
	else // swap values
	{
	  var tmp       = m_fromOpacity;
	  m_fromOpacity = m_toOpacity;
	  m_toOpacity   = tmp;

	  if(m_bFadeOut)
	  {
        arrFadeCursor++;
        if(arrFadeCursor > arrFadeMax)
        {
          arrFadeCursor=0;
        }
        setFadeLink();
	  }

	  m_bFadeOut = !m_bFadeOut;
      setTimeout(fade_ontimer_opaq, m_waitTime);

	}
}



function fade_ontimer_opaq() 
{
  FadeOpacity(m_fromOpacity, m_toOpacity, m_time, m_fps);
}



