var message=new Array()
message[0]="С целью реализации областной программы ипотечного жилищного кредитования Правительством Нижегородской области в лице Министерства имущественных отношений было учреждено Государственное предприятие «Нижегородский ипотечный корпоративный альянс»."
message[1]="С целью реализации областной программы ипотечного жилищного кредитования Правительством Нижегородской области в лице Министерства имущественных отношений было учреждено Государственное предприятие «Нижегородский ипотечный корпоративный альянс»."
message[2]="С целью реализации областной программы ипотечного жилищного кредитования Правительством Нижегородской области в лице Министерства имущественных отношений было учреждено Государственное предприятие «Нижегородский ипотечный корпоративный альянс»."
message[3]="С целью реализации областной программы ипотечного жилищного кредитования Правительством Нижегородской области в лице Министерства имущественных отношений было учреждено Государственное предприятие «Нижегородский ипотечный корпоративный альянс»."


// the URLs of your messages
var messageurl=new Array()
messageurl[0]="http://scriptweb.boom.ru"
messageurl[1]="http://scriptweb.boom.ru"
messageurl[2]="http://scriptweb.boom.ru/java/jindex.html"

// the targets of the links
// accepted values are '_blank' or '_top' or '_parent' or '_self'
// or the name of your target-window (for instance 'main')
var messagetarget=new Array()
messagetarget[0]="_blank"
messagetarget[1]="_blank"
messagetarget[2]="_blank"
messagetarget[3]="_blank"

// font-color of messages
var messagecolor= new Array()
messagecolor[0]="#86D7E2"
messagecolor[1]="#86D7E2"
messagecolor[2]="#86D7E2"
messagecolor[3]="#86D7E2"

// distance of the scroller to the left margin of the browser-window (pixels) -----------------------
var scrollerleft=210

// distance of the scroller to the top margin of the browser-window (pixels) -----------------------
var scrollertop=100

// speed 1: lower means faster
var pause=20

// speed 2: higher means faster -------------------
var step=2

// font-size
var fntsize=8

// font-family
var fntfamily="Arial"

// font-weight: 1 means bold, 0 means normal
var fntweight=1

// do not edit the variables below
var scrollerwidth=750 //---------------------------------------
var scrollerheight=20
var scrollerleft_in=scrollerleft+16
var scrollertop_in=scrollertop+12
var clipleft,clipright,cliptop,clipbottom
var i_message=0
var timer
var textwidth
var textcontent=""
if (fntweight==1) {fntweight="700"}
else {fntweight="100"}

function init() {
 gettextcontent()
 
    if (document.all) {
  text.innerHTML=textcontent
  textwidth=text.offsetWidth
  document.all.text.style.posTop=scrollertop_in
        document.all.text.style.posLeft=scrollerleft_in+scrollerwidth

  clipleft=0
  clipright=0
  cliptop=0
  clipbottom=scrollerheight
  document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
        scrolltext()
    }
 if (document.layers) {
  document.text.document.write(textcontent)
  document.text.document.close()
  textwidth=document.text.document.width
  document.text.top=scrollertop_in
  document.text.left=scrollerleft_in+scrollerwidth
  
  document.text.clip.left=0
  document.text.clip.right=0
  document.text.clip.top=0
  document.text.clip.bottom=scrollerheight

        scrolltext()
    }
}

function scrolltext() {
    if (document.all) {
  if (document.all.text.style.posLeft>=scrollerleft_in-textwidth) {
   document.all.text.style.posLeft-=step
   clipright+=step
   if (clipright>scrollerwidth) {
    clipleft+=step
   }
   document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
   
   var timer=setTimeout("scrolltext()",pause)
  }
  else {
   changetext()
  }
 }
   if (document.layers) {
  if (document.text.left>=scrollerleft_in-textwidth) {
   document.text.left-=step
   document.text.clip.right+=step
   if (document.text.clip.right>scrollerwidth) {
    document.text.clip.left+=step
   }
   var timer=setTimeout("scrolltext()",pause)
  }
  else {
   changetext()
  }
 }
}

function changetext() {
    i_message++
 if (i_message>message.length-1) {i_message=0}
 gettextcontent()
 if (document.all) {
  text.innerHTML=textcontent
  textwidth=text.offsetWidth
  
        document.all.text.style.posLeft=scrollerleft_in+scrollerwidth
  clipleft=0
  clipright=0
  document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
  
        scrolltext()
 }

 if (document.layers) {
     document.text.document.write(textcontent)
  document.text.document.close()
  
 
  textwidth=document.text.document.width

  document.text.left=scrollerleft_in+scrollerwidth
  document.text.clip.left=0
  document.text.clip.right=0
  
        scrolltext()
 }
}

function gettextcontent() {
 textcontent="<span style='position:relative;font-size:"+fntsize+"pt;font-family:"+fntfamily+";font-weight:"+fntweight+"'>"
 textcontent+="<nobr><font color="+messagecolor[i_message]+">"+message[i_message]+"</font></nobr></span>"
}

window.onresize=init;

// - End of JavaScript - -->





//date function
RightNow=new Date();
var themonth;
var month=RightNow.getMonth()+1;
if (month==1) themonth = "January";
if (month==2) themonth = "February";
if (month==3) themonth = "March";
if (month==4) themonth = "April";
if (month==5) themonth = "May";
if (month==6) themonth = "June";
if (month==7) themonth = "July";
if (month==8) themonth = "August";
if (month==9) themonth = "September";
if (month==10) themonth = "October";
if (month==11) themonth = "November";
if (month==12) themonth = "December";

var date=RightNow.getDate();
var year=RightNow.getYear();
var day=RightNow.getDay();
if (year==100){year="2000";}
if (year==101){year="2001";}
if (year==102){year="2002";}
if (year==103){year="2003";}
if (year==104){year="2004";}
if (year==105){year="2005";}


function page(u)
{
  document.all['form_url'].value = u;
  document.all['form_query'].submit();
}

//set up layer call
var isIE, isNS, isNS6, isDOM, lR, sR, vis, invis, myTimeOut, goName;
	if (document.all) {isIE= true;lR="document.all.";sR=".style";vis="visible";invis="hidden";}
	if (document.layers){isNS = true;lR="document.layers.";sR="";vis="show";invis="hide";}
	if (document.getElementById &&!isIE) {isDOM=true;lR = "document.getElementById('";sR = "').style";invis ="hidden";vis = "visible"}
	if (isDOM == true && navigator.appName =="Netscape") isNS6 = true;
	
var oldwhich = 0;
var x=0;
var layerTimer;
	
//turn on layer and rollover
function layOver(which, item, color)
{
	changebg(item, color);
	x=0;
	l = eval(lR + "l" + which + sR);
	if (oldwhich != which)
	{
		ol = eval(lR + "l" + oldwhich + sR);
		ol.visibility = invis;
	}
	l.visibility = vis;
	oldwhich = which;
	clearTimeout(layerTimer);
}
	
//turn off layer and rollover if user is completely off nav 
function stopOver(item, color)
{
	changebg(item, color);
	if (x<5) x++;
	else
	{
		ol = eval(lR + "l" + oldwhich + sR);
		ol.visibility = invis;
		x=0;
	}
	layerTimer = setTimeout("stopOver('"+item+"','"+color+"')",150);
}
	
//reset the timer
function startOver(item, color)
{
	x=0; 
	clearTimeout(layerTimer);
	changebg(item, color);
}
	
//change subnav background color (ie5+ ns6+)
function changebg(item, color)
{
	if (document.getElementById)
	{
		theone = eval("document.getElementById('"+item+"')");
		theone.style.background = color;
	}	
}


//netscape resize bug fix
function NSresize() {
  if (document.FIX.NSfix.initWindowWidth != window.innerWidth || document.FIX.NSfix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function NSCheck() {
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.FIX == 'undefined'){
      document.FIX = new Object;
    }
    if (typeof document.FIX.FIX_scaleFont == 'undefined') {
      document.FIX.NSfix = new Object;
      document.FIX.NSfix.initWindowWidth = window.innerWidth;
      document.FIX.NSfix.initWindowHeight = window.innerHeight;
    }
    window.onresize = NSresize;
  }
}

NSCheck()



var goTimer = 0;
var goNum = 1;
var animLayerCount = 5;
var pauseCount = 100;

function setUp()
	{
		for (i=1; i < animLayerCount; i++){
		layer = eval(lR + "z" + i + sR);
		if (isIE) layer.pixelLeft = -320;
		else layer.left = -320;
		layer.visibility = vis;
		}
	}
	
var timer;


function moveIt(whichLayer, toWhere, speed)
{
layer = eval(lR + whichLayer + sR);

if (isIE) theleft = parseInt(layer.pixelLeft)
else theleft = parseInt(layer.left)

// calculate the distance remaining
rDistance = toWhere - theleft;
// set the speed to a fraction of the remaining distance
speed = rDistance * .05;
// create a pocket buffer just a short distance before destination
toWhereBuffer = toWhere - 6;
// if object has not reached the buffer zone
if ( theleft <= 152) 
{
	if(isIE) layer.pixelLeft = parseInt(layer.pixelLeft) + speed
	else layer.left = parseInt(layer.left) + speed
}
else
{
	// if object has reached buffer zone, set object to destination
	return;
}
//loop
harold = "\"moveIt('" + whichLayer + "', 172, 2)\"";
eval ("timer= setTimeout(" + harold + ", 1)")

}

function textAnimate (){
	if (goNum >= animLayerCount){
	clearTimeout (myTimeOut);
	return;
	} else {
	goName = "z" + goNum;
	moveIt(goName, 152, 2);
	pauseCount=pauseCount+300;
	
	
	if (goName=="z3") pauseCount = 300
	goNum++;
	}
	myTimeOut = setTimeout("textAnimate()", pauseCount);
}
