function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }
  return elements;
}

function getContent(p){
document.current_page=p;
$('getContent').src="/getContent?page="+p;
}

function recastLinks(){
    var allLinks = document.getElementsByTagName('a');
    for (var i=0;i<allLinks.length;i++) {
    var lnk = allLinks[i];
     if(lnk.className=="lang"){
        lnk.onclick=function(){
window.location=document.current_page+this.search;
        return false;
        }
     } else if(lnk.href&&lnk.href.indexOf(window.location.hostname)!=-1&&lnk.href.indexOf("#")==-1&&lnk.href.indexOf("@")==-1&&!lnk.onclick&&lnk.target==""){
//&&(("/"+lnk.pathname!=location.pathname)&&lnk.pathname!=location.pathname||lnk.search)
        lnk.onclick=function(){
//alert(this.pathname+" | "+this.href+" | "+this.search);

page=this.pathname.split("/");
page.push(1);
page=page[0]?page[0]:page[1];
if(!page) page="main";

getContent(this.href);
window.document.header.SetVariable('_root.mustGoOn',page);
        return false;
        }
      }
    }

}

function getClientWidth(){
return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

window.onload=function(){
document.current_page=location.pathname;
recastLinks();
//window.document.header.SetVariable('_root.brWidth',getClientWidth());
}

getPageSize = function(){
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) { // all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth;
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
	windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
		// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = xScroll;
	} else {
		pageWidth = windowWidth;
	}
		var arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
	return arrayPageSize;
}

function openGallery(){
$('gallery').src='/gallery';
$('shadow').style.display='block';
PageSize=getPageSize();
$('shadow').style.height=PageSize[1];
$('gallery').style.display='block';
return false;
}

function closeGallery(){
$('shadow').style.display='none';
$('gallery').style.display='none';
}

function closeBigPhoto(){
$('bigPhoto').src="/images/123504810299.gif";
$('bigPhoto').style.display='none';
$('photos').className="";
}

function openBigPhoto(src,w){
$('bigPhoto').src=src;
$('bigPhoto').style.display='inline';
$('bigPhoto').style.marginLeft=-Math.ceil(w/2);
$('photos').className="alp20";
}



<!-- processing 0.00595998764038 sec. sql 0.000502109527588 sec. See you later! -->