function setFontSize(num) {
	var loc=window.location.href;
	if(loc.indexOf('fontsize=')>=0) {
		window.location=loc.replace(/fontsize=\d/,'fontsize='+num);
	} else {
		if(loc.indexOf('?')>=0) window.location=loc+'&fontsize='+num;
		else window.location=window.location+'?fontsize='+num;
	}
}
function toggleMenu(id){
var el=document.getElementById(id);
if(el.style.display=='none')el.style.display='';
else el.style.display='none';

}
var allowMove=false;
function galMove(dir){
    var id='gallery_container';
    var el=document.getElementById(id);
    var galW=el.offsetWidth;
    var contenerW=document.getElementById('gal_center').offsetWidth;
    //alert(galW);
    var galL=el.style.left;
    var newGalL=0;
    galL=galL.split('px');
    galL=galL[0].split('%');
    galL=galL[0]*1;
    if(dir=='left')newGalL=galL-5;
    else newGalL=galL+5;
    var rightCorner=galL+galW;
    var leftCorner=galL;
    //block left scrolling
    
    if((dir=='left' && rightCorner<=(contenerW-20)) || (dir=='right' && galL>=20) )allowMove=false;
    if(allowMove)el.style.left=newGalL+'px';
    if(allowMove)setTimeout('galMove(\''+dir+'\');',50);
}
function startGalMove(dir){
  allowMove=true;
  galMove(dir);
}
function stopGalMove(){
  allowMove=false;
}
function hideDiv(id){
  document.getElementById(id).style.display='none';
}
function showDiv(id){
  document.getElementById(id).style.display='';
}

function blockMainTbl(){
    var dim=$('mainTable').getDimensions();
    if(dim.width>1700){
        if($('mainTable'))$('mainTable').setStyle({
        width:1700+'px'
    });
    }

}
window.onresize=blockMainTbl;
window.onload=blockMainTbl;