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);
		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\';" /></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');
		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>';
}

/*window.onload = function() {
	var d = document;
	if (d.getElementById('mmenu')) {
		var bi = d.getElementById('splash');
		var out_img = bi.src;
		var bia = new Array();
		var la = d.getElementById('mmenu').getElementsByTagName('li');
	    var lal = la.length;
	    var tmp = new Array();
		for (var i = 0; i < lal; i++) {
			la.item(i).onmouseover = function () {		
				bia[this.id] = new Image();
				bia[this.id].src = 'images/bs_' + this.id + '.jpg';
				//alert(bia[this.id].src);
				bi.src = bia[this.id].src;
				
				//bia[this.id].onload = function() {
				//	bi.src = bia[this.id].src;
				//	alert(bi.src);
				//}
					
			}
			la.item(i).onmouseout = function () {
				bi.src = out_img;
			}
		}
	}
}*/

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>');

}

			
	


function flipAnswerDisplay(anc, id) {
	a = document.getElementById(id);
	if (anc && a) {
		with (a.style) {
			if (display=='block') {
				display = 'none';
				document.getElementById(id + '_answer').innerHTML = 'подробнее &raquo;';
			} else {
				display = 'block';
				document.getElementById(id + '_answer').innerHTML = 'свернуть &raquo;';
			}
		}
	}
}


function flipAnswerDisplay2(id) {
	a = document.getElementById(id);
	if (a) {
		with (a.style) {
			if (display=='block') {
				display = 'none';
				document.getElementById(id + '_answer').innerHTML = 'подробнее &raquo;';
			} else {
				display = 'block';
				document.getElementById(id + '_answer').innerHTML = 'свернуть &raquo;';
			}
		}
	}
}