function imgWin(img){
	var scr='/images/preview.htm';
	var x = screen.width/2 - 400/2;
	var y = screen.height/2 - 300/2;
	var wn=window.open(scr+'?'+escape(img),'win','resizable,width=400,height=300,top='+y+',left='+x+',screenX='+x+',screenY='+y+',status=0, scrollbars=1');
	wn.focus();
	return false;
}

function switchBlock(id){
	var block = document.getElementById(id);
	if (block.style.display != 'none') {
		block.style.display = 'none';
		//setCookie('block_'+id, 'hidden');
	} else {
		block.style.display = 'block';
		//setCookie('block_'+id, 'visible');
	}
	return false;
}
function showmap(fname){
	document.images['gmap'].src='images/skin/map_'+fname+'.gif';
}

var menu = new Array ("Номера", "Конференц-зал", "Учебный зал");
var ill_classes = new Array ("rooms", "conference_hall", "educational_hall");
var menu_text = new Array (
			   	"В нашей гостинице вы забудете, что  находитесь далеко от дома",
				"Есть все необходимое для успеха деловых переговоров",
				"Отличные условия для проведения семинаров или тренингов"
			);

function setMenu(index, isMainPage){
	var el = document.getElementById('menu');
	//var ill = document.getElementById('ill');
	//if (ill) ill.className = 'ill_' + ill_classes[index];

	var x = 0;
	var s = '';
	for (x = 0; x < (menu.length); x++){
		if (x == index && !isMainPage) {
			s = s + '<td class="c' + (x+1) + ' s"><div><h1>' + menu[x] + '</h1>' + menu_text[x] + '</div></td> \r\n';
		} else {
			s = s + '<td class="c' + (x+1) + '"><div><h1><a href="child'+(x+1)+'.php"  return false;">' + menu[x] + '</a></h1>' + menu_text[x];
			if (isMainPage) s = s + '<br/><a href="#"><img src="images/skin/c' + (x+1) + '.jpg"/></a>';
			s = s + '</div></td> \r\n';
		}
	}
	el.innerHTML = '<table class="menu2"><tr>' + s + '</tr></table>';
}



var flashVersion = 0;
var defErrorHandle = window.onerror;

function Flash () {
	this._swf = '';
	this._width = 0;
	this._height = 0;
	this._params = new Array();
}


Flash.prototype.setSWF = function (_swf, _width, _height){
	this._swf = _swf;
	this._width = _width;
	this._height = _height;
}


Flash.prototype.setParam = function (paramName, paramValue){
	this._params[this._params.length] = paramName+'|||'+paramValue;
}


Flash.prototype.display = function () {
	if (flashVersion < 6) return false;
	
	var _txt = '';
	var params = '';
	var _param = '';
	var i = 0;

	_txt += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this._width+'" height="'+this._height+'">\n';
	_txt += '<param name="movie" value="'+this._swf+'" />\n'
	_txt += '<param name="quality" value="high" />\n';
	for ( i=0;i<this._params.length;i++ ) {
		_param = this._params[i].split ('|||');
		_txt += '\t<param name="'+_param[0]+'" value="'+_param[1]+'" />\n';
		_txt += '\t<param name="menu" value="false" />\n';
		params += _param[0]+'="'+_param[1]+'" ';
	}

	_txt += '<embed menu="false" width="'+this._width+'" height="'+this._height+'" src="'+this._swf+'" '+params+' quality="high" type="application/x-shockwave-flash"></embed>\n';
	_txt += '</object>\n';
	
	document.write ('<div class="eye_flash">' + _txt + '</div>');
	return true;
}


function GetFlashVersion() {
	/* GetFlashVersion - must be last function in file */
	window.onerror = function() {
		return true;
	}
	var ie=0
	var fz=0
	var n=navigator

	if (n.platform=='Win32' && !window.opera && n.appName!='Netscape') {
		ie=1
		for (var i=3;i<10;i++) {
			if (eval('new ActiveXObject("ShockwaveFlash.ShockwaveFlash.'+i+'")')) {
				flashVersion = i;
			}
		}
	}


	if ((ie==0)&&(n.plugins)) {
		for (var i=0;i<n.plugins.length;i++) {
			if (n.plugins[i].name.indexOf('Flash')> -1) {
				fz = parseInt(n.plugins[i].description.charAt(16));
				if (fz > flashVersion) flashVersion = fz;
			}
		}
	}
}
GetFlashVersion();
window.onerror = defErrorHandle;

function order(){
	var order = window.open("order.php", "order", "width=660,height=600,menubar=0,scrollbars=1");
}
