/* public javascript code
 * based on	dynlite dhtml dom api
 * @author:  Peter Assenov- AIP Solutions Ltd.' 2001-2005
 * @version: 2.2.1.2/2005-03-20
 * !requires: dynlite.0.9.js 
 */
/* window positioning */
winh=(ns6)? window.innerHeight:document.body.offsetHeight;
if(winh<690)	document.write('<style>table.tableIndex{top:232px;}</style>')
onresize=function(){self.location.reload()}

/* debug functionality */
document.onkeyup=function(e)
{	if(!e) e=event;
	if(e.altKey&&e.ctrlKey&&e.keyCode==68)	// press Ctrl-Alt-D to visualize debug info
	{	log.push('--- dynlite log end ---');
		var err=log.join('<br>');
			err=err.replace(/#([^<]+)</gi,'<b class="debug"># $1</b><'); // status messages
			err=err.replace(/\!([^<]+)</gi,'<em class="debug">! $1</em><'); // error messages
		var el=obj("debug");	
			el.innerHTML=err;
			el.on();
			el.onclick=function(){this.off()}	
	}
};

/* div popup class */
function divPopup(id,cont,img)
{	this.id=id;
	this._img=new Image();
	this._contName=cont;
	this._imgName=img;
	this.cont=0;
	this.img=0;
}
/* div popup methods */
/* private */
_dp=divPopup.prototype;
_dp._show=function()
{	this.img.src=this._img.src;
	this.cont.className="enlargeBig";
	(ns6)? this.cont.style.MozOpacity="1":this.cont.filters.alpha.opacity="100";
}
/* public */
_dp.show=function(src,prTop)
{	if(!this.cont) this.cont=obj(this._contName);
	if(!this.img) this.img=obj(this._imgName);
	this._img.defsrc=this.img.getAttribute("defsrc",false);
	this.cont.style.top=prTop.parentNode.offsetTop;
	this._img.src=src;
	this._img.onload=function(){dp._show()};
	this.cont.on();
}
_dp.close=function()
{	this.cont.off();
	this.cont.className="enlarge";
	this.img.src=this._img.defsrc;
	(ns6)? this.cont.style.MozOpacity=".7":this.cont.filters.alpha.opacity="70";
}
/* static object creation */
dp=new divPopup('dp','enlarge','enlargePic');

function picOnload()
{ 	imobj.src=im.src;
	(ns6)? cont.style.MozOpacity="1":cont.filters.alpha.opacity="100";
}

//open privacy popup
function blockOpen(blockId){obj(blockId).on();}
function blockClose(blockId){obj(blockId).off();}

//show/hide left menu subcategories
function subcats(leftMenuArrId)
{	if(obj(leftMenuArrId).style.display=='block'){obj(leftMenuArrId).off();}
	else{obj(leftMenuArrId).on();}
}

//replace _en for changing language
function chngLang()
{	var page=self.location.href;
	if(page.indexOf('/news')==-1)
		if(page.indexOf('.html')==-1)
			self.location.href=page+'index_en.html';
		else
			self.location.href=(page.indexOf('_en')!=-1)? page.toString().replace(/_en\.html/,'.html'):page.toString().replace(/\.html/,'_en.html'); 
	else	
		self.location.href=(page.indexOf('_en_')!=-1)? page.toString().replace(/_en_/,'_'):page.toString().replace(/_/,'_en_'); 
}
//function init()
//{	try{
//		obj('jsHref').style.visibility="visible";
//	}catch(e){}
//	try{
//		page.css.attr("a.button","display","block")
//	}catch(e){}
//}
