

function Zoom(xlink, width, height){
	if (width && height) {
		var img = window.open('','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,height=' + height + ',width=' + width);
		/*var img = window.open('','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=' + height + ',width=' + width);*/
		if (navigator.userAgent.indexOf("Opera") == -1) {
			img.document.writeln('<html><body bgcolor="#D6D3CE" style="padding: 0px; margin: 0px; border: 0px;"><div id="text" style="width: 100%; height: 100%; text-align: center; padding-top: 40px; font-family: tahoma; font-size: 12px;">Загрузка изображения...</div><div id="image" style="display: none;"><img src="' + xlink + '" alt="" onload="document.getElementById(\'text\').style.display = \'none\'; document.getElementById(\'image\').style.display = \'block\'; window.resizeTo(this.width+6, this.height+63)" /></div></body></html>');
		} else {
			img.document.writeln('<html><body bgcolor="#D6D3CE" style="padding: 0px; margin: 0px; border: 0px;"><div id="image" style="display: block;"><img src="' + xlink + '" alt="" onload="window.resizeTo(this.width+6, this.height+63)" /></div></body></html>');
		}
	} else {
		var img = window.open('','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,height=100,width=200');
		/*var img = window.open('','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=100,width=200');*/
		if (navigator.userAgent.indexOf("Opera") == -1) {
			img.document.writeln('<html><body bgcolor="#D6D3CE" style="padding: 0px; margin: 0px; border: 0px;"><div id="text" style="width: 100%; height: 100%; text-align: center; padding-top: 40px; font-family: tahoma; font-size: 12px;">Загрузка изображения...</div><div id="image" style="display: none;"><img src="' + xlink + '" alt="" onload="document.getElementById(\'text\').style.display = \'none\'; document.getElementById(\'image\').style.display = \'block\'; window.resizeTo(this.width+6, this.height+63)" /></div></body></html>');
		} else {
			img.document.writeln('<html><body bgcolor="#D6D3CE" style="padding: 0px; margin: 0px; border: 0px;"><div id="image" style="display: block;"><img src="' + xlink + '" alt="" onload="window.resizeTo(this.width+6, this.height+63)" /></div></body></html>');
		}
	}
}

function zooom(id) {
	var h = document.getElementById(id).innerHTML;
	document.getElementById(id).innerHTML = h ? '' : '<a href="javascript:zooom(' + "'" + id + "'" + ')"><img src="' + id + '" border="0" /></a>';
}

function newsOver (element){
	element.className='newsBoxSel';
}

function newsOut (element){
	element.className='newsBox';
}

function change_image(id, src) {
	document.getElementById(id).src = src;
}


arrowUp = new Image()
	arrowUp.src = "images/arrow_up.gif"
	arrowDown = new Image()
	arrowDown.src = "images/arrow_down.gif"
	
function checkBlock(id) {
		var ev_str = 'document.getElementById("' + 'a' + id + '").style.display';
		var exp_str = "document.expand" + id + ".src = '";
		if (eval(ev_str) == "none") {
			ev_str += ' = "block"';
			exp_str += arrowUp.src;
		} else {
			ev_str += ' = "none"';
			exp_str += arrowDown.src;
		}
		
		exp_str += "'";
		
		eval(ev_str);
		eval(exp_str);
}
	
function changeTopic(link) {
	document.location.href = link + '~topic=' + topic.value;
}


function FlashLoad(fname, flocation, fwidth, fheight, fbgcolor, falign, fwmode, fvars, fversion) {
	
	fversion = '' + fversion;
	
	if (fversion) {
		fversionarr = fversion.split(',');
		if(fversionarr.length < 4){
			for (i = fversionarr.length; i < 4; i++ ){
				fversion = fversion + ',0';
			}
		}
	} else {
		fversion = '8,0,0,0';
	}

	document.write		('<object ' +
										'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' +
										'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + fversion + '" ' +
										'width="' + fwidth + '" ' +
										'height="' + fheight + '" ' +
										(fname?('id="' + fname + '" '):'') +
										(falign?('align="' + falign + '" '):'align="middle"') +
										'>' +
										
										'<param name="allowScriptAccess" value="always" />' +
										'<param name="scale" value="noscale" />' +
										
										'<param name="movie" value="' + flocation + '" />' +
										
										'<param name="quality" value="high" />' +
										
										(fbgcolor?'<param name="bgcolor" value="' + fbgcolor + '" />':'') +
										
										'<param name="wmode" value="' + (fwmode?fwmode:'opaque') + '" />' +
										
										(fvars?'<param name="FlashVars" value="' + fvars + '" />':'') +
										
										'<embed src="' + flocation + '" quality="high" ' +
										'wmode="' + (fwmode?fwmode:'opaque') + '" ' +
										(fbgcolor?'bgcolor="' + fbgcolor + '" ':'') +
										'width="' + fwidth + '" ' +
										'height="' + fheight + '" ' +
										(fname?('name="' + fname + '" '):'') +
										(falign?('align="' + falign + '" '):'align="middle" ') +
										'allowScriptAccess="always" ' +
										'scale="noscale" ' +
										(fvars?'FlashVars="' + fvars + '" ':'') +
										'type="application/x-shockwave-flash" ' +
										'pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
										
										'</' + 'object>');

}


var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();