// For preview animation
var previewInitInterval = 0;
var previewStepInterval = 30;

var stepTimer = null; // global, IE fix
lenta = { // Namespace
	// Properties
		// -> base
	marginLeft : 0, // px
	marginRightLimit : 0,
	lentaWidth : 0, // px
	contWidth :0, // px
	curMohth : 0,
	monthCount : 12, // [num]
	inited : false,
	frameObj : null,
	moveObj : null,
	lineObj : null,
		// -> scroll
	scrollObj : null,
	scrollPadding : 20, // px
	scrItemWidth : 0, // px
	scrWidth : 0, // px
	scrollLeft : 0, // px
	wasScrollLeft : 0,
		// -> scroll move
	moveInit : false,
	moveX0 : 0,
	moveX : 0,
	initTimeout : 150,
	stepTimeout : 10,
	lentaStep : 50, // px
	direction : false,
		// -> comments animation
	coms : [],
	isComShow : [],
	comTimers : [],
	comTimeout : 10,
	comSteps : 7,
	nowCommentShow : [],
	nowCommentHide : [],
		// -> hide
	fadeInterval : 50,
	fadeStep : 10,
	// Methods
	init : function() {
		if (!this.inited) {
			// Objects detect
			if(!(this.frameObj = $("lentaFrameId"))) {alert("lentaFrameId is not found"); return;}
			if(!(this.moveObj = $("lentaMoveId"))) {alert("lentaMoveId is not found"); return;}
			if(!(this.lineObj = $("lentaLineId"))) {alert("lentaLineId is not found"); return;}
			if (!(this.scrollObj = $("lentaScrollId"))) {alert("lentaScrollId is not found"); return;}
			// Add handlers
			addHandler(window, "resize", function() {lenta.scrollDefine();})
			addHandler(document, "mousemove", function(evt) {lenta.moveHandler(evt);})
			addHandler(document, "mouseup", lenta.clearMove);
			if (this.scrollObj = document.getElementById("lentaScrollId")) {
				addHandler(lenta.scrollObj, "mousedown", function(evt) {
					evt = evt || window.event;
					if(evt.preventDefault) evt.preventDefault();
		       		evt.returnValue = false;
					lenta.moveInit = true;
					lenta.moveX0 = defPosition(evt).x;
					lenta.wasScrollLeft = lenta.scrollLeft;
				});
			}
			this.elHoverInit();
			this.inited = true;
		}
		// Init
		this.scrollDefine();
		return false;
	},
	hide : function() {
		if (this.wasHide) return;
		this.wasHide = true;
		$('lenta-fade').style.display = "block";
		fadeOut('lenta-fade', 0, this.fadeStep, this.fadeInterval);
	},
	show : function() {
		if (!this.wasHide) return false;
		$('map-fade3').style.display = "block";
		fadeOut('map-fade3', 0, this.fadeStep, this.fadeInterval);
		return false;
	},
	elHoverInit : function() {
		var el, com;
		for (var i = 0; i <= 72; i++) {
			if (el = $("elId_" + i)) {
				el.onmouseover = lenta.elMouseOver;
				el.onmouseout = lenta.elMouseOut;
				el.index = i;
				if (com = $("comId_" + i)) {
					com.h = com.offsetHeight;
					com.index = i;
					//com.onmouseover = lenta.comMouseMove;
					//com.onmouseout = lenta.comMouseMove;
					com.onmousemove = lenta.comMouseMove;
				}
			}
		}
	},
	killFreezed : function(index) {
		for (var i = 0; i < this.isComShow.length; i++) {
			if (i == index) continue;
			if (this.isComShow[i] && !this.nowCommentShow[i] && !this.nowCommentHide[i]) {
				this.nowCommentHide[i] = true;
				comment = $("comId_" + i);
				this.comShow(i, comment.h, comment.h, 1);
			}
		}
	},
	elMouseOver : function() {
		var comment;
		fixClassName(this, "active");
		if (comment = $("comId_" + this.index)) {
			if (lenta.nowCommentShow[this.index] || lenta.nowCommentHide[this.index]) return;
			if (lenta.isComShow[this.index]) return;
			clearTimeout(lenta.comTimers[this.index]);
			lenta.comTimers[this.index] = setTimeout("lenta.comShow("+this.index+", 0, "+comment.h+")", 100);
		}
	},
	elMouseOut : function(evt) {
		evt = evt || window.event;
		var comment;
		fixClassName(this, 0, "active");
		if (comment = $("comId_" + this.index)) {
			if (/*lenta.nowCommentShow[this.index] || */lenta.nowCommentHide[this.index]) return;
			//if (!lenta.isComShow[this.index]) return;
			var rel = evt.relatedTarget ? evt.relatedTarget : evt.toElement;
			try {if (
				rel.className == "comment" ||
				rel.parentNode.className == "comment" ||
				rel.parentNode.parentNode.className == "comment" ||
				rel.parentNode.parentNode.parentNode.className == "comment"
			) return;} catch(e) {}
			clearTimeout(lenta.comTimers[this.index]);
			lenta.isComShow[this.index] = false;
			lenta.nowCommentShow[this.index] = false;
			lenta.comTimers[this.index] = setTimeout("lenta.comShow("+this.index+", "+comment.h+", "+comment.h+", 1)", 50);
		}
	},
	comMouseMove : function() {
		if (!lenta.nowCommentShow[this.index] && !lenta.nowCommentHide[this.index]) {
			clearTimeout(lenta.comTimers[this.index]);
			lenta.comTimers[this.index] = null;
		}
	},
	comShow : function(index, cur, limit, minus) {
		var comment = $("comId_" + index)
		comment.style.visibility = "visible";
		var wrap = $('elId_'+index).firstChild.nodeType == 1 ? $('elId_'+index).firstChild : $('elId_'+index).firstChild.nextSibling;
		var height = cur + (minus ? (-1)*limit : limit) / this.comSteps;
		
		if (minus) height = height < 0 ? 0 : height;
		else height = height < limit ? height : limit;
		
		var wrapY = 5 * height / limit;
		wrap.style.top = wrapY + "px";
		
		if (height == limit && typeof minus == "undefined") {
			this.isComShow[index] = true;
			this.nowCommentShow[index] = false;
			clearTimeout(this.comTimers[index]);
			this.comTimers[index] = null;
		} else if (height == 0 && minus) {
			this.isComShow[index] = false;
			this.nowCommentHide[index] = false;
			clearTimeout(this.comTimers[index]);
			this.comTimers[index] = null;
			comment.style.visibility = "hidden";
		} else {
			if (minus) this.nowCommentHide[index] = true;
			else this.nowCommentShow[index] = true;
			clearTimeout(this.comTimers[index]);
			this.comTimers[index] = setTimeout("lenta.comShow("+index+","+height+","+limit+(minus ? ", 1" : "")+")", this.comTimeout);
			//this.killFreezed(index);
		}
		comment.style.height = height + "px";
	},
	clearMove : function() {
		lenta.moveInit = false;
		if (stepTimer != null) {
			clearInterval(stepTimer);
			stepTimer = null;
			if (lenta.direction == 'r') lenta.showNext();
			else lenta.showPrevious();
		}
	},
	showNext : function() {
		this.marginLeft -= this.lentaStep;
		this.marginLeft = this.marginLeft < this.marginRightLimit ? this.marginRightLimit : this.marginLeft;
		this.setMargin();
		return false;
	},
	showPrevious : function() {
		this.marginLeft += this.lentaStep;
		this.marginLeft = this.marginLeft >= 0 ? 0 : this.marginLeft;
		this.setMargin();
		return false;
	},
	setMargin : function() {
		this.moveObj.style.marginLeft = this.marginLeft + "px";
		this.scrollLeftDefine();
	},
	selectMonth : function(num) {
		this.curMohth = num;
		if (this.curMohth >= this.monthCount) return;
		var block;
		if (block = $("monthId_" + this.curMohth)) {
			this.marginLeft = (-1) * block.offsetLeft;
			this.setMargin();
		}
	},
	scrollDefine : function() {
		try {
			this.scrWidth = Math.floor(this.frameObj.offsetWidth) - 2 * this.scrollPadding;
			//this.scrItemWidth = this.scrWidth / this.monthCount;
			this.scrItemWidth = this.scrWidth / (this.lineObj.offsetWidth / this.frameObj.offsetWidth);
			this.scrollObj.style.width = this.scrItemWidth + "px";
			this.marginRightLimit = (-1) * (this.lineObj.offsetWidth - this.frameObj.offsetWidth);
			this.scrollLeftDefine()
		} catch(e) {}
	},
	scrollLeftDefine : function() {
		this.scrollLeft = Math.abs(this.marginLeft) / (this.lineObj.offsetWidth - this.frameObj.offsetWidth);
		this.scrollLeft = this.scrollPadding + this.scrollLeft * (this.scrWidth - this.scrItemWidth);
		this.scrollObj.style.left = this.scrollLeft + "px";
	},
	scrollInit : function(order) {
		this.direction = order;
		stepTimer = setInterval("lenta.scrollRepeat()", this.initTimeout);
	},
	scrollRepeat : function() {
		if (this.direction == 'r') this.showNext();
		else this.showPrevious();
		if (stepTimer != null) {
			clearInterval(stepTimer);
			stepTimer = null;
			stepTimer = setInterval("lenta.scrollRepeat()", this.stepTimeout);
		}
	},
	moveHandler : function(evt) {
		if (this.moveInit) {
			evt = evt || window.event;
			if (navigator.userAgent.toLowerCase().indexOf("gecko") == -1) {
				if(evt.preventDefault) evt.preventDefault();
				evt.returnValue = false;
			}
			this.moveX = defPosition(evt).x;
			var dX = this.moveX - this.moveX0;
			dX += this.wasScrollLeft;
			if (dX <= this.scrollPadding) scrollLeft = this.scrollPadding;
			else if (dX > this.scrWidth - this.scrItemWidth + this.scrollPadding) scrollLeft = this.scrWidth - this.scrItemWidth + this.scrollPadding;
			else scrollLeft = dX;
			this.marginLeft = (-1) * ((scrollLeft  - this.scrollPadding) / (this.scrWidth - this.scrItemWidth)) * (this.lineObj.offsetWidth - this.frameObj.offsetWidth);
			this.setMargin();
		}
	}
};

// ****************************** Map ******************************
var previewTimer = [];
var previewTimerOut = [];
var previewNow = [];
var previewWasShow = [];
var typeWasOver = [];
var regOverTimer = null;
function mouseOverArea(type, inlist, time) {
	if (type == 'undefined') return;
	if (!time) {
		clearTimeout(regOverTimer);
		regOverTimer = null;
		regOverTimer = setTimeout("mouseOverArea('"+type+"',"+(inlist ? 1 : 0)+",1)", 70);
		return;
	}
	if (type) {
		if (regEvrAll[type]) {
			$('regDescContentId').innerHTML = '';
			/*setAjaxRequest(
				"GET",
				"/texport/" + regEvrAll[type][0] + ".html?q=1",
				"q=1",
				function() {
					$('regDescContentId').innerHTML = this.req.responseText;
				},
				function() {},
				0, 0
			);*/
		}
		/*if (regEvrAll[type]) $('rightColTitleId').innerHTML = regEvrAll[type][1];
		else if (allDesc[type]) {
			$('rightColTitleId').innerHTML = materikiHead[type];
			$('regDescContentId').innerHTML = allDesc[type];
		}*/
		
		if ($('hl_' + type)) {
			$('hl_' + type).style.visibility='visible';
		} else showHoverCanvas(type);
		if ($('reg_' + type)) fixClassName($('reg_' + type), "hover", "");
		
		if (!previewNow[type]) {
			clearTimeout(previewTimer[type]);
			previewTimer[type] = setTimeout("previewAnimate('"+type+"',0,1)", previewInitInterval);
		}
		typeWasOver[typeWasOver.length] = type;
	}
	for (var j = 0; j < typeWasOver.length; j++) {
		i = typeWasOver[j];
		if (i == type) continue;
		if ($('hl_' + i) != null) {
			$('hl_' + i).style.visibility='hidden';
		}
		if ($('reg_' + i)) fixClassName($('reg_' + i), "", "hover");
		if (previewWasShow[i] || previewNow[i]) {
			clearTimeout(previewTimer[i]);
			previewTimerOut[i] = setTimeout("previewAnimate('"+i+"',0,0)", previewInitInterval);
		}
	}
	if (!inlist && $('regScrollId').style.display != 'none') {
		scrollBeforeCurrent(type);
	}
}
function mouseOutArea(type) {
	clearTimeout(regOverTimer);
	regOverTimer = null;
	/*$('hl_' + type).style.visibility='hidden';
	fixClassName($('reg_' + type), "", "hover");
	$('prev_'+type).style.visibility='hidden';
	$('regDescContentId').innerHTML = '';*/
}
// Region list scroller
var regMoveInit = false;
var regMoveY0 = 0;
var regMoveY = 0;
var regWasScrollTop = 0;
var regScrollPadding = 11;
var regScrollPx = 0;
var regDirection;
var regStepTimer = null;
function scrollBeforeCurrent(type) {
	if (regPosition[type]) {
		regScrollPx = (22 * (-1) * regPosition[type]);
		var limit = (regAllCount - 9) * 22 * (-1);
		regScrollPx = regScrollPx < limit ? limit : regScrollPx;
		$('regListId').style.marginTop = regScrollPx + 'px';
		setRegScrTopAngle();
	}
}
function regScrollInit() {
	addHandler(document, "mousemove", function(evt) {regScrollMoveHandler(evt);})
	addHandler(document, "mouseup", regScrollClearMove);
	if ($('regRollId')) {
		$('regRollId').sTop = regScrollPadding;
		addHandler($('regRollId'), "mousedown", function(evt) {
			evt = evt || window.event;
			if(evt.preventDefault) evt.preventDefault();
       		evt.returnValue = false;
			regMoveInit = true;
			regMoveY0 = defPosition(evt).y;
			regWasScrollTop = $('regRollId').sTop;
		});
	}
}
function regScrollMoveHandler(evt) {
	if (regMoveInit) {
		var oH = 10 * 22;
		var sH = $('regListId').offsetHeight;
		var allScroll = 200;
		evt = evt || window.event;
		if (navigator.userAgent.toLowerCase().indexOf("gecko") == -1) {
			if(evt.preventDefault) evt.preventDefault();
			evt.returnValue = false;
		}
		regMoveY = defPosition(evt).y;
		var dY = regMoveY - regMoveY0;
		dY += regWasScrollTop;
		if (dY <= regScrollPadding) scrollTop = regScrollPadding;
		else if (dY > oH - $('regRollId').offsetHeight - regScrollPadding) scrollTop = oH - $('regRollId').offsetHeight - regScrollPadding;
		else scrollTop = dY;
		$('regRollId').sTop = scrollTop;
		$('regRollId').style.top = scrollTop + 'px';
		regScrollPx = ((scrollTop - regScrollPadding) / (oH - $('regRollId').offsetHeight - 2*regScrollPadding)) * (sH - allScroll);
		regScrollPx = (-1) * Math.ceil(regScrollPx / 22) * 22;
		$('regListId').style.marginTop = regScrollPx + 'px';
	}
}
function regScrollClearMove() {
	regMoveInit = false;
	if (regStepTimer != null) {
		clearInterval(regStepTimer);
		regStepTimer = null;
		if (regDirection == 'r') regShowNext();
		else regShowPrevious();
	}
}
function regScrollAngleInit(order) {
	regDirection = order;
	regStepTimer = setInterval("regScrollRepeat()", 200);
}
function regScrollRepeat() {
	if (regDirection == 'r') regShowNext();
	else regShowPrevious();
	if (regStepTimer != null) {
		clearInterval(regStepTimer);
		regStepTimer = null;
		regStepTimer = setInterval("regScrollRepeat()", 50);
	}
}
function setRegScrTopAngle() {
	var oH = 10 * 22;
	var scrollTop = (regScrollPx / 22) * (-1) / (regAllCount - 9);
	scrollTop = scrollTop * (oH - $('regRollId').offsetHeight - 2*regScrollPadding) + regScrollPadding;
	
	if (scrollTop <= regScrollPadding) scrollTop = regScrollPadding;
	else if (scrollTop > oH - $('regRollId').offsetHeight - regScrollPadding) scrollTop = oH - $('regRollId').offsetHeight - regScrollPadding;
	
	$('regRollId').sTop = scrollTop;
	$('regRollId').style.top = scrollTop + 'px';
}
function regShowNext() {
	regScrollPx -= 22;
	var limit = (regAllCount - 9) * 22 * (-1);
	regScrollPx = regScrollPx < limit ? limit : regScrollPx;
	$('regListId').style.marginTop = regScrollPx + 'px';
	setRegScrTopAngle();
	return false;
}
function regShowPrevious() {
	regScrollPx += 22;
	regScrollPx = regScrollPx > 0 ? 0 : regScrollPx;
	$('regListId').style.marginTop = regScrollPx + 'px';
	setRegScrTopAngle();
	return false;
}

var globalCoords = {};
function initMouseOverArea(mapId) {
	var areas, area, i, type;
	areas = $(mapId).getElementsByTagName('area');
	for (i = areas.length; i--;) {
		area = areas[i];
		area.index = i;
		type = area.href.substring(area.href.indexOf('#') + 1, area.href.length);
		area.type = type;
		area.onmouseover = function() {
			mouseOverArea(this.type);
		}
		area.onmouseout = function() {
			mouseOutArea(this.type);
		}
		area.onclick = function(evt) {
			clickArea(this.type);
			evt = evt || window.event;
			evt.cancelBubble = true;
			if (evt.preventDefault) evt.preventDefault(); 
			evt.returnValue = false;
		}
		if (typeof globalCoords[type] == 'undefined') globalCoords[type] = [];
		globalCoords[type][globalCoords[type].length] = area.coords;
	}
}
function parseCoords(str) {
	var coords = [];
	var buferArray = str.split(",");
	var j = 0;
	for (var i = 0; i < buferArray.length; i++) {
		if (i % 2 == 0) {
			coords[j] = [];
			coords[j][0] = buferArray[i];
		} else {
			coords[j][1] = buferArray[i];
			j++;
		}
	}
	return coords;
}
function showHoverCanvas(type) {
	var ctx = $('evrCanvasId').getContext('2d');
	var coords = globalCoords[type];
	if (typeof coords == "undefined") return;
	var i, j, c;
	ctx.clearRect(0, 0, 434, 249);
	for (i = 0; i < coords.length; i++) {
		c = parseCoords(coords[i]);
		ctx.beginPath();
		for (j = 0; j < c.length; j++) {
			if (j == 0) ctx.moveTo(c[j][0], c[j][1]);
			else ctx.lineTo(c[j][0], c[j][1]);
		}
		ctx.fillStyle = "#FC7905";
		ctx.fill();
	}
}
function hideHoverCanvas() {
	try {
		var ctx = $('evrCanvasId').getContext('2d');
		ctx.clearRect(0, 0, 434, 249);
	} catch(e) {}
}
function previewAnimate(type,step,show) {
	previewNow[type] = true;
	var widths = [77,112]; // 35, 5 steps -> 7
	var heights = [46,66]; // 20, 5 steps -> 4
	var p = $('prev_'+type);
	var img = $('prevImg_'+type);
	if (p && img) {
		p.style.visibility='visible';
		if (show && step <= 5) {
			clearTimeout(previewTimer[type]);
			img.width = widths[0] + 7 * step;
			img.height = heights[0] + 4 * step;
			if (step != 5) previewTimer[type] = setTimeout("previewAnimate('"+type+"',"+(step+1)+",1)", previewStepInterval);
		} else if (!show && step <= 5) {
			clearTimeout(previewTimerOut[type]);
			clearTimeout(previewTimer[type]);
			img.width = widths[1] - 7 * step;
			img.height = heights[1] - 4 * step;
			if (step != 5) previewTimerOut[type] = setTimeout("previewAnimate('"+type+"',"+(step+1)+",0)", previewStepInterval);
		}
		if (step == 5) {
			previewNow[type] = false;
			if (show) previewWasShow[type] = true;
			else {
				previewWasShow[type] = false;
				if ($('prev_'+type)) $('prev_'+type).style.visibility='hidden';
			}
		}
	}
}
function clickArea(type) {
	if (type == 'ea') {
		hideHoverCanvas();
		$('map-fade').style.display = "block";
		for (var i = 0; i < materiki.length; i++) $('hl_' + materiki[i][0]).style.visibility = 'hidden';
		fadeOut('map-fade', 0, lenta.fadeStep, lenta.fadeInterval);
	} else if (type == 'back') {
		hideHoverCanvas();
		$('map-fade2').style.display = "block";
		$('regListId').style.marginTop = 0;
		fadeOut('map-fade2', 0, lenta.fadeStep, lenta.fadeInterval);
	}
	//try {
		if (regEvrAll[type] && regEvrAll[type][0]) {
			//for (var i = 0; i <= 6; i++ ) {
			//	$('ntype'+i).style.display = 'none';
			//	$('lsn_'+i).style.fontWeight = 'normal';
			//}
			$('ntype0').style.display = 'none';
			globalRegId = regEvrAll[type][0];
			$('iframeId').style.display = 'block';
			$('lsnh').innerHTML = regEvrAll[type][1];
			$('headFadeLayer').style.display = 'block';
			fadeIn('headFadeLayer', 100, lenta.fadeStep, lenta.fadeInterval);
			$('iframeId').src = "http://gazint.rf21.info/tape/" + globalRegId;
			$('graphId').src = "http://gazint.rf21.info/imgen/" + globalRegPerioad + globalRegId + ".png";
		}
	//} catch(e) {}
	return false;
}
var regPosition = {};
var regAllCount = 0;
function drawRegList(arr, _back) {
	var html = "";
	regPosition = {};
	var count = 0;
	if (_back) {
		for (var i in regEvrAll) {
			html += '<div id="reg_'+i+'" class="itm">\
				<div class="d1">\
					<div class="d1r"><div></div></div>\
					<div class="d1l"></div>\
					<div class="d2">\
						<div class="d2r"><div></div></div>\
						<div class="d2l"></div>\
						<a onmouseout="mouseOutArea(\''+i+'\')" onmouseover="mouseOverArea(\''+i+'\',1)"  onclick="return clickArea(\''+i+'\');" href="#">'+regEvrAll[i][1]+'</a>\
					</div>\
				</div>\
			</div>';
			regPosition[i] = count;
			count++;
		}
		regAllCount = count;
		$('regScrollId').style.display = 'block';
	} else {
		for (var i = 0; i < arr.length; i++) {
			html += '<div id="reg_'+arr[i][0]+'" class="itm">\
				<div class="d1">\
					<div class="d1r"><div></div></div>\
					<div class="d1l"></div>\
					<div class="d2">\
						<div class="d2r"><div></div></div>\
						<div class="d2l"></div>\
						<a onmouseout="mouseOutArea(\''+arr[i][0]+'\')" onmouseover="mouseOverArea(\''+arr[i][0]+'\',1)"  onclick="return clickArea(\''+arr[i][0]+'\');" href="#">'+arr[i][1]+'</a>\
					</div>\
				</div>\
			</div>';
		}
		$('regScrollId').style.display = 'none';
	}
	if (_back) html += '<br><a href="#" style="font:11px arial; color:#FFF;" onclick="clickArea(\'back\'); return false;">Назад</a>';
	$('regListId').innerHTML = html;
	if (_back) regScrollInit();
}
function drawPrevRegList(arr, three) {
	var html = '<table width="100%">';
	var tr1 = "<tr>", tr2 = "<tr>";
	for (var i = 0; i < arr.length; i++) {
		tr1 += '<td>\
                <div class="gitm">\
                        <a onclick="return clickArea(\''+arr[i][0]+'\');" href="#" href=""><img onmouseover="mouseOverArea(\''+arr[i][0]+'\')" src="'+arr[i][1]+'" width="77" height="46"/></a>\
                </div>\
        </td>';
		tr2 += '<td>\
                <div class="gitm2">\
                        <table id="prev_'+arr[i][0]+'" style="visibility:hidden;"><tr><td>\
                                <a onclick="return clickArea(\''+arr[i][0]+'\');" href="#"><img id="prevImg_'+arr[i][0]+'" onmouseout="mouseOutArea(\''+arr[i][0]+'\')" src="'+arr[i][2]+'" width="112" height="66"/></a>\
                        </td></tr></table>\
                </div>\
        </td>';
	}
	tr1 += '</tr>'; tr2 += '</tr>';
	html += tr1; html += tr2;
	html += '</table>';
	$('regPreviewListId').innerHTML = html;
	if (three) fixClassName($('regPreviewListId'), "c3", 0);
	else fixClassName($('regPreviewListId'), 0, "c3");
}

function showStatNews(id,a) {
	try {
		$('iframeId').style.display = 'none';
		for (var i = 0; i <= 6; i++ ) {
			$('ntype'+i).style.display = 'none';
			$('lsn_'+i).style.fontWeight = 'normal';
		}
		$('ntype'+id).style.display = 'block';
		$('lsn_'+id).style.fontWeight = 'bold';
		$('lsnh').innerHTML = a.innerHTML;
	} catch(e) {}
	return false;
}

function showVideo(show) {
	$('videoContainerId').style.display = show ? 'block' : 'none';
	$('contPageId').style.display = show ? 'none' : 'block';
	return false;
}

// Zoooooooooooooooooooooom
function fontZoom(_class,a, idx) {
	document.body.className = _class;
	var links = a.parentNode.getElementsByTagName('a');
	for (var i = 0; i < links.length; i++) links[i].getElementsByTagName('img')[0].setAttribute('src', 'images/fs'+(i+1)+'.gif');
	a.getElementsByTagName('img')[0].setAttribute('src', 'images/fs'+idx+'_a.gif');
	return false;
}

