var min=8;
var max=16;
function increaseFontSize() {
   var p = document.getElementsByTagName('div');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('div');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}



var timer = 0;
var delay = 4; //msec
var scrollOffset = 25; //pixel
var docBody;

function initscroll() {
docBody = document[getDocElName()];
}

function goDown(targetYPos) {
var y = docBody.scrollTop;
if (y<targetYPos){
window.scrollBy(0, scrollOffset);
timer = setTimeout('goDown('+targetYPos+')', delay);
}
else clearTimeout(timer);
return false;
}

function goUp(targetYPos) {
var y = docBody.scrollTop;
if (y>targetYPos){
window.scrollBy(0, -scrollOffset);
timer = setTimeout('goUp('+targetYPos+')', delay);
}
else clearTimeout(timer);
return false;
}

function goRight(targetXPos) {
var x = docBody.scrollLeft;
if (x<targetXPos){
window.scrollBy(scrollOffset, 0);
timer = setTimeout('goRight('+targetXPos+')', delay);
}
else clearTimeout(timer);
return false;
}

function goLeft(targetXPos) {
var x = docBody.scrollLeft;
if (x>targetXPos){
window.scrollBy(-scrollOffset, 0);
timer = setTimeout('goLeft('+targetXPos+')', delay);
}
else clearTimeout(timer);
return false;
}

function getDocElName(){
return (document.compatMode && document.compatMode == "CSS1Compat") ? "documentElement" : "body";
}

function marklinks(){
	aarr = document.getElementsByTagName("a");
	for(i=0;i<aarr.length;i++){
		if(aarr[i].className == 'advert'){
			aarr[i].onclick = function(){
				return false;
			}
		}
	}
}

function redrawblock(city,sg_id) {
	$(document).ready(function() {
		$("#wtb").fadeOut("fast",getIndexObject3('http://turafisha.ua/js/gen_wtb.php?sg_id=' + sg_id + '&city='+ city,'','wtb',''));
	});
	
	//alert('http://turafisha.ua/js/gen_wtb.php?sg_id=' + sg_id + '&city='+ city);
		
}
