function show_title()
{
	var titleArr = document.title.split("::");
	return titleArr[0];
}

function menuOverByMcS(parentli)
{
	var uls = parentli.getElementsByTagName('UL');
	uls[0].style.visibility = 'visible';
}
function menuOutByMcS(parentli)
{
	var uls = parentli.getElementsByTagName('UL');
	uls[0].style.visibility = 'hidden';
}

function oImPUbyMcS(imgPath, title)
{
	var win = window.open('','preview','width=50,height=50,left=0,top=0,screenX=0,screenY=0,resizable=0,scrollbars=yes,status=0');
	var winDoc = win.document;
	if (title == undefined) title = 'Click to Close';
	var content = '<html><head><title>' + title + '</title>' + '<style>body{overflow:auto;margin:0;background-color:black;} img{border:0;} table{width:100%;height:100%;border-collapse:collapse;} td {padding:0;text-align:center;vertical-align:middle;}</style>' + '</head><body><table><tr><td><a href="javascript:self.close()">' + '<img alt="Закрыть окно" id="image" src="' + imgPath + '" /></a></td></tr></table>';
	win.document.write(content);
	winDoc.body.onload = function()
	{
		var obj = winDoc.getElementById('image');
		var w = obj.width, h = obj.height;
		var iHeight= document.body.clientHeight, iWidth = self.innerWidth;
		var left = (self.opera ? iWidth : screen.availWidth)/2 - w/2;
		var top = (self.opera ? iHeight : screen.availHeight)/2 - h/2;
		win.resizeTo(w+27, h+59);
		win.moveTo(left, top);
	}
	win.onload = winDoc.body.onload;
	win.document.close();
	win.focus();
}

function FotoTeleByMcS(pth,qnt)
{
	this.pth = pth;
	this.qnt = qnt;
	this.cnt = 1;
    this.preloadedImages = new Array();
	this.showImage = showImage;
	this.slideShowPlay = slideShowPlay;
	this.slideShowStop = slideShowStop;
	this.go = go;
	function showImage()
	{
		this.slideShowStop();
		if (this.cnt > this.qnt)
		{
			this.cnt = 1;
		}
		var image = document.getElementById('foto_tele_foto').firstChild;
		if (navigator.appName == 'Microsoft Internet Explorer')
		{
			image.filters.blendTrans.apply();
			image.src = this.preloadedImages[this.cnt].foto.src;
			image.width = this.preloadedImages[this.cnt].foto.width;
			image.filters.blendTrans.play();
		}
		else
		{
			image.src = this.preloadedImages[this.cnt].foto.src;
		}
		this.slideShowPlay();
	}
	function slideShowPlay()
	{
		this.timer = window.setInterval("fotoTele.cnt++; fotoTele.showImage();", 5000);
	}
	function slideShowStop()
	{
	    window.clearInterval(this.timer);
	}
	function go()
	{
		var foto_tele_foto = document.getElementById('foto_tele_foto');
		foto_tele_foto.innerHTML = '';
		var image = foto_tele_foto.appendChild(document.createElement('IMG'));
		image.src = this.preloadedImages[1].foto.src;
		var foto_tele_thum = document.getElementById('foto_tele_thum');
		for (var i=1; i<=this.qnt; i++)
		{
			foto_tele_thum.appendChild(this.preloadedImages[i].thum);
		}
		this.slideShowPlay();
	}
	for(var i=1; i<=this.qnt; i++)
	{
		this.preloadedImages[i] = new Object();
		this.preloadedImages[i].foto = document.createElement('IMG');
		this.preloadedImages[i].foto.src = this.pth + i + '.jpg';
		this.preloadedImages[i].thum = document.createElement('IMG');
		this.preloadedImages[i].thum.src = this.pth + i + '_resize.jpg';
		this.preloadedImages[i].thum.onclick = new Function ('fotoTele.cnt = ' + i + '; fotoTele.showImage()');
	}
	document.write('<div id="foto_tele_foto">loading images...</div><div id="foto_tele_thum"></div>');

	this.preloadedImages[this.qnt].foto.onload = new Function('fotoTele.go()');
	//this.go();
	//window.onload = new Function('fotoTele.go()');
}

function fotoTbyMcS(pth,qnty,ttl)
{
	document.write('<div class="foto_tape"><table><tr>');
	for(var i=1; i<=qnty; i++)
	{
		document.write('<td><a href="" onclick="oImPUbyMcS(\''+pth+i+'.jpg\', \''+ttl+'\'); return false;"><img src="'+pth+i+'_resize.jpg" /></a></td>');
	}
	document.write('</tr></table></div>');
}

function fotoInExpByMcS(pth,qnty,ttl)
{
	document.write('<div style="text-align: center;">');
	for(var i=1; i<=qnty; i++)
	{
		document.write('<img style="float: none; cursor: pointer; border: none; display: inline; margin: 2px;" src="' + pth + i + '_resize.jpg" onclick="oImPUbyMcS(\'' + pth + i + '.jpg\', \'' + ttl +'\');">');
	}
	document.write('</div>');
}