/********************************************************************
  Fading Scroller 
*********************************************************************/

var delay = 1100
var bcolor = "#ffffff"
var tcolor = "#004080"
var fcontent = new Array()
var fborder = 0
var fheight = 30
var fwidth = 600
begintag = '';
/*
fcontent[0] = '<p align="CENTER"><font face="Courier New" size="12">gfdgdfsg</font></p>';
*/
fcontent[0] = '<p><span style="font-face:verdana; font-color=#CC3333; font-size:11pt"><b>Audit Report 2006-07 Submitted to Government of Nagaland</b></span></p>';
fcontent[1] = '<p><span style="font-face:verdana; font-color=#CC3333; font-size:11pt"><b>Audit Report 2005-06 is published in this website</b></span></p>';
fcontent[2] = '<p><span style="font-face:verdana; font-size:10pt">GPF Statement for the year ending 31st March 2007 issued. </span></p>';
fcontent[3] = '<p><span style="font-face:verdana; font-size:10pt">Revision of pension cases of pre 01-06-1998 cases are being authorised in phases.</span></p>';
fcontent[4] = '<p><span style="font-face:verdana; font-size:10pt">Check for List of Pension cases Authorised under Facilitation in this website</span></p>';
fcontent[5] = '<p><span style="font-face:verdana; font-size:10pt">Revision of pension cases under objection - please find under Pension Facilitation in this website</span></p>';
fcontent[6] = '<p><span style="font-face:verdana; font-size:10pt">GPF Subscription status  upto the month of accounting can be view online!</span></p>';
fcontent[7] = '<p><span style="font-face:verdana; font-size:10pt">For Grievances, Contact Public Information Officers of Audit and A&E offices.</span></p>';
fcontent[8] = '<p><span style="font-face:verdana; font-size:10pt">Office hours : 9.00 am to 5.30pm.</span></p>';
fcontent[9] = '<p><span style="font-face:verdana; font-size:10pt">Working Days : Monday to Friday</span></p>';
fcontent[10] = '<p><span style="font-face:verdana; font-size:10pt">Public Interviews : From 12.00 noon to 2.30pm</span></p>';
fcontent[11] = '<p><span style="font-face:verdana; font-size:10pt">No Public interviews on Mondays and Thursdays</span></p>';
fcontent[12] = '<p><span style="font-face:verdana; font-size:10pt">No Public interviews on Pay disbursement day</span></p>';



closetag = '';


// You can changes these three values to modify the output:
var frame = 50;	// frame-range. standard = 50
var st = 30;	// milliseconds between frames. standard = 30
var wait = 50;	// value to display the full text without fade
			// 1 = approx. 60 milliseconds. standard = 50

ie4 = document.all&&!document.getElementById;
ns4 = document.layers;
DOM2 = document.getElementById;

bR = HexToR(bcolor);
bG = HexToG(bcolor);
bB = HexToB(bcolor);
tR = HexToR(tcolor);
tG = HexToG(tcolor);
tB = HexToB(tcolor);
bR_m = bR;
bG_m = bG;
bB_m = bB;
tR_m = tR;
tG_m = tG;
tB_m = tB;

function HexToR(h) { return parseInt((cutHex(h)).substring(0,2),16) }
function HexToG(h) { return parseInt((cutHex(h)).substring(2,4),16) }
function HexToB(h) { return parseInt((cutHex(h)).substring(4,6),16) }
function cutHex(h) { return (h.charAt(0)=="#") ? h.substring(1,7) : h}

dir = ((tR+tG+tB) > (bR+bG+bB)) ? "up" : "down";
dirback = ((tR+tG+tB) < (bR+bG+bB)) ? "up" : "down";
dir_m = dir;
index = 0;
frame_m = frame;
framehalf = frame / 2;
wait_m = wait;
stepR = Math.abs(tR - bR) / framehalf;
stepG = Math.abs(tG - bG) / framehalf;
stepB = Math.abs(tB - bB) / framehalf;
step = Math.min(Math.round(Math.max(stepR,Math.max(stepG,stepB))),(240/framehalf));

function fade() {
 if (index>=fcontent.length)
  index = 0;
  if (DOM2) {
   document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag;
   index++;
   colorfade();
  }
  else if (ie4) {
   document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
   index++;
   setTimeout("fade()",Math.max(delay,2500));
  }
  else if (ns4) {
   document.fscrollerns.document.fscrollerns_sub.document.write(begintag+fcontent[index]+closetag);
   document.fscrollerns.document.fscrollerns_sub.document.close();
   index++;
   setTimeout("fade()",Math.max(delay,2500));
  }
}

function colorfade() {
 if (frame>0) {
  if (frame==framehalf && wait>0) {
   document.getElementById("fscroller").style.color="rgb("+wR+","+wG+","+wB+")";
   wait--;
   setTimeout("colorfade()",50);
  }
  else {
   if (dir=="down") {
    if (bR>tR) bR-=step;
    if (bG>tG) bG-=step;
    if (bB>tB) bB-=step;
    bR = Math.max(bR,1);
    bG = Math.max(bG,1);
    bB = Math.max(bB,1);
    }
   else {
    if (bR<tR) bR+=step;
    if (bG<tG) bG+=step;
    if (bB<tB) bB+=step;
    bR = Math.min(bR,255);
    bG = Math.min(bG,255);
    bB = Math.min(bB,255);
   }
   document.getElementById("fscroller").style.color="rgb("+bR+","+bG+","+bB+")";
   if (frame==framehalf+1) {
    document.getElementById("fscroller").style.color="rgb("+tR+","+tG+","+tB+")";
    dir = dirback;
    wR = tR;
    wG = tG;
    wB = tB;
    tR = bR_m;
    tG = bG_m;
    tB = bB_m;
   }
   frame--;
   setTimeout("colorfade()",st);
  }
 }
 else {
  document.getElementById("fscroller").innerHTML=" ";
  dir = dir_m;
  frame = frame_m;
  wait = wait_m;
  tR = tR_m;
  tG = tG_m;
  tB = tB_m;
  bR = bR_m;
  bG = bG_m;
  bB = bB_m;
  setTimeout("fade()",delay);
 }
}


// write
if (navigator.appVersion.substring(0,1) < 5 && navigator.appName == "Netscape") 
{
   //var fwidth = screen.availWidth / 2;
   //var bwidth = screen.availWidth / 4;
   document.write('<ilayer id="fscrollerns" width='+fwidth+' height='+fheight+' left='+bwidth+' top=0><layer id="fscrollerns_sub" width='+fwidth+' height='+fheight+' left=0 top=0></layer></ilayer>');
   window.onload = fade;
   
}
else if (navigator.userAgent.search(/Opera/) != -1 || (navigator.platform != "Win32" && navigator.userAgent.indexOf('Gecko') == -1)) {
   document.open();
   document.write('<div id="fscroller" style="border:'+fborder+'px solid black;width:'+fwidth+' height:'+fheight+'px; padding:2px">');
   for(i=0; i < fcontent.length; ++i) {
      document.write(begintag+fcontent[i]+closetag+'<br>');
   }
   document.write('</div>');
   document.close();
   window.onload = fade;
   
}
else {
   
   document.write('<div id="fscroller" style="border:'+fborder+'px solid black;width:'+fwidth+'px; height:'+fheight+'px; padding:2px"></div>');
   window.onload = fade;
}
