
/***********************************************
* Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var delay = 5000; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=40; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(255,255,255); // start color (red, green, blue)
var endcolor=new Array(153,153,153); // end color (red, green, blue)
var fcontent=new Array();
begintag='<div>'; //set opening tag, such as font declarations
//fcontent[0]="<a href='#' class=message02 onclick=window.open('http://www.spml.co.in/mediaroom/news46.htm','news','top=0,left=0,width=269,height=551,scrollbars=yes,toolbars=no')>SPML wins at ENERTIA AWARDS 2008 - India's Awards For Sustainable Energy & Power</a>";
//fcontent[1]="<a href=http://www.spml.co.in/mediaroom/pressreleases/SPR_Crossing_1000_Crores.pdf target=_blank class=message02>SPML crosses Rs 1000 crore mark in FY 07- 08 with an order book worth more than INR 2500 crores</a>";
//fcontent[2]="<a href=http://www.spml.co.in/mediaroom/pressreleases/SPR_Rs.318_Crore_Order.pdf target=_blank class=message02>New project by Public Health Engineering Dept.(PHED),Basni, Jodhpur, Government of Rajasthan of Rs. 318 crores</a>";
//fcontent[3]="<a href=http://www.spml.co.in/financials/SPML_annual_report_2007_08.pdf target=_blank class=message02>View our Annual Results 2007-08</a>";
//fcontent[4]="<a href='http://www.spml.co.in/mediaroom/pressreleases/SPML Q2 Net Sales up.doc' target=_blank class=message02>SPML Infra Limited., Q2 Net Sales  up by 11% to Rs.254 Crs.</a>";
/**/
fcontent[0]="<a href='../../mediaroom/pressreleases/Concession.pdf' target='_blank' class=message02>Concession Agreement signed for JAIPUR-BHILWARA BOT ROAD PROJECT with Rajasthan Government in the presence of Hon'ble PWD Minister, Mr. Pramod Jain 'Bhaya'</a>";


fcontent[1]="<a href='../../mediaroom/pressreleases/PressReleaseProjectInaugurationRamgarh14May_2010.doc' class=message02>Shri. Ashok Gehlot, Hon'ble Chief Minister of Rajasthan. inaugurates the Balance of Plant (BOP Pkg) for 160 MW Combined Cycle Power Project, Stage - III, Ramgarh, Jaisalmer, Rajasthan.</a>";


fcontent[2]="<a href='../../mediaroom/pressreleases/PressReleaase_KalisindhCivilorkJhalawar_4May2010.doc' class=message02>SPML wins Rs. 457.2 crore order for the construction works of Kalisindh Gravity Dam in Jhalawar Dist., Rajasthan</a>";


fcontent[3]="<a href='../../mediaroom/pressreleases/SubhashProjectsAndMarketingisnowSPMLInfraLimited_15April2010.doc' class=message02>Subhash Projects And Marketing is now SPML Infra Limited</a>";

fcontent[4]="<a href='../../mediaroom/pressreleases/SPMLwinsorderworthRs6319crore_Orissa.doc' class=message02>SPML wins order worth Rs. 63.19 crore for ex-works services to Orissa Power Transmission Corporation Limited [OPTCL]</a>";


fcontent[5]="<a href='../../mediaroom/pressreleases/SSPMLwinsorderworthRs220crore_PHEDGovtofBihar.doc' class=message02>SPML wins order worth Rs. 220 crore - awarded by Public Health Engineering Dept., Government of Bihar</a>";


fcontent[6]="<a href='../../mediaroom/pressreleases/SPMLwinprestigiousBOPorderworth_Rs210crore_RamgarhDis_Rajasthan31March2010.doc' class=message02>SPML wins a prestigious BOP order worth Rs. 210 crore at Ramgarh Dist, Rajasthan</a>";


fcontent[7]="<a href='../../mediaroom/pressreleases/SPMLwinsordeRs250crore_23March2010.doc' class=message02>SPML wins a prestigious road infrastructure order of Rs. 250 crore  from Govt. of Rajasthan</a>";


fcontent[8]="<a href='../../mediaroom/pressreleases/SPMLwinsorderworthRs440crore_JVforWaterSupplyProject.doc' class=message02>SPML wins order worth Rs 440 crore, in JV, for a Prestigious Water Supply Project</a>";


fcontent[9]="<a href='../../mediaroom/pressreleases/SPMCalcuttaNGOs_Kolkata_3March2010_FinalVersion.doc' class=message02>SPML, in association with Calcutta NGOs hosts 'The Clean Connect',  for a clean and green Kolkata</a>";


fcontent[10]="<a href='../../mediaroom/pressreleases/anilsethiaward_pacific2009.doc' class=message02>Mr. Anil Sethi, Chairman, SPML conferred Outstanding Entrepreneur Award - Asia Pacific - 2009, by Enterprise Asia</a>";

fcontent[11]="<a href='../../mediaroom/pressreleases/SPML wins consolidated orders worth Rs 278 crore for water and sewage projects-Nov09.doc' class=message02>SPML wins consolidated orders worth Rs 278 crore for water & sewage projects</a>";

fcontent[12]="<a href='../../mediaroom/pressreleases/spml_2009_cwaward.doc' class=message02>SPML conferred as the fastest emerging Infrastructure company (Large Category) for the year-2008-09, at the 7th Construction World Annual Awards 2009 presented by the chief guest Shri Kamal Nath, Hon'ble Union Minister for Road Transport and Highways.</a>";

fcontent[13]="<a href='../../mediaroom/pressreleases/SPML_Newtwn_supaul.doc' class=message02>SPML wins consolidated orders worth Rs 151.79 crore from Bihar State Electricity Board and PHED, Govt. of West Bengal</a>";

fcontent[14]="<a href='#' class=message02 onclick=window.open('http://www.spml.co.in/mediaroom/news46.htm','news','top=0,left=0,width=269,height=551,scrollbars=yes,toolbars=no')>SPML wins at ENERTIA AWARDS 2008 - India's Awards For Sustainable Energy & Power</a>";

fcontent[15]="<a href='../../mediaroom/pressreleases/SPML secures Rs 526 crore order.pdf' target=_blank class=message02>SPML secures Rs.526 crore worth underground sewerage project for Mira Bhayandar, Maharashtra</a>";

fcontent[16]="<a href='../../mediaroom/pressreleases/SPML wins consolidated order worthrs105.doc' class=message02>SPML wins consolidated order worth Rs. 105 crore from NTPC for Simhadri Super Thermal Power Project</a>";

fcontent[17]="<a href='../../mediaroom/pressreleases/siww.pdf' target='_blank' class=message02>SPML participated at the Singapore International Water Week; 23-25 June 2009</a>";

fcontent[18]="<a href='../../mediaroom/pressreleases/DWMintensive_awareness.doc' class=message02>DWM's intensive awareness programmes to accomplish MCD's door-to-door collection mandate for Commonwealth Games</a>";

closetag='</div>';

var fwidth='500px'; //set scroller width
var fheight=''; //set scroller height

var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////


var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;


/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
  if (index>=fcontent.length)
    index=0
  if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
  index++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step){
  var obj=document.getElementById("fscroller").getElementsByTagName("A");
  if (obj.length>0){
    for (i=0;i<obj.length;i++)
      obj[i].style.color=getstepcolor(step);
  }
}

/*Rafael Raposo edited function*/
var fadecounter;
function colorfade(step) {
  if(step<=maxsteps) {	
    document.getElementById("fscroller").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter);
    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
    setTimeout("changecontent()", delay);
	
  }   
}

/*Rafael Raposo's new function*/
function getstepcolor(step) {
  var diff
  var newcolor=new Array(3);
  for(var i=0;i<3;i++) {
    diff = (startcolor[i]-endcolor[i]);
    if(diff > 0) {
      newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
    } else {
      newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
  }
  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}

if (ie4||DOM2)
  document.write('<div id="fscroller" style="width:'+fwidth+';height:'+fheight+'"></div>');

if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent
