var ie=document.all?1:0;
var n=document.layers?1:0;
var timSpeed=1;
var contHeight=175;
var cityArr=new Array(),oScroll,oScroll2;

function autoclose(){
  if (ie){
    self.close();
  }
}

function makeScrollObj(obj,nest){
  nest=(!n) ? '':'document.'+nest+'.';
  this.css=(n) ? eval(nest+'document.'+obj):eval('document.all.'+obj+'.style');
	this.scrollHeight=n?this.css.document.height:eval('document.all.'+obj+'.offsetHeight');
  this.top=b_gettop;
  return this;
}


function b_gettop(){
  var gleft=(n) ? eval(this.css.top):eval(this.css.pixelTop);
  return gleft;
}



//Variables

var scrollTim;

var active=0;

function scroll(speed){
  if(oScroll==undefined) return;
  clearTimeout(scrollTim);
  way=speed>0?1:0;
  if((!way && oScroll[active].top()>-oScroll[active].scrollHeight+contHeight) || (oScroll[active].top()<0 && way)){
    oScroll[active].css.top=oScroll[active].top()+speed;
    scrollTim=setTimeout("scroll("+speed+")",timSpeed);
  }
}


function noScroll(){
  clearTimeout(scrollTim);
}



function scrollInit(){
  oScroll=new Array();
  oScroll[0]=new  makeScrollObj('divScroll1','divCont');
  oScroll[0].css.visibility='visible';
}


var scrollTim2;

var active2=0;

function scroll2(speed){
  clearTimeout(scrollTim2);
  way=speed>0?1:0;
  if((!way && oScroll2[active2].top()>-oScroll2[active2].scrollHeight+contHeight) || (oScroll2[active2].top()<0 && way)){
    oScroll2[active2].css.top=oScroll2[active2].top()+speed;
    scrollTim2=setTimeout("scroll2("+speed+")",timSpeed);
  }
}


function scrollInit2(){
  if(oScroll2==undefined) return;
  oScroll2=new Array();
  oScroll2[0]=new  makeScrollObj('divScroll2','divCont2');
  oScroll2[0].css.visibility='visible';
}