/* 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 */
//winw=(ns6)? window.innerWidth:document.body.offsetWidth;
//if(winw<780)	document.write('<style>div.content{left:381px;}</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)
{	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._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 privacyOpen(){obj('privacy').on();}
function privacyClose(){obj('privacy').off();}

//replace _en for changing language
function chngLang()
{	var page=self.location.href;
	if(page.indexOf('.html')==-1)	
		self.location.href=page+'index_en.html';
	else
		self.location.href=(page.indexOf('_en.html')!=-1)? page.toString().replace(/_en\.html$/,'.html'):page.toString().replace(/\.html$/,'_en.html'); 
}

//function init()
//{	try{
//		obj('jsHref').style.visibility="visible";
//	}catch(e){}
//	try{
//		page.css.attr("a.button","display","block")
//	}catch(e){}
//}