/* JavaScript file */

// newwindow

function OpenWindowImage (url,alt,width,height) {
	wnd1 = null;
	var url = url || '';
	var alt = alt || '';
	var width = width || 300;
	var height = height-19 || 300;
	var size = 'width='+width+',height='+height;
	wnd1 = window.openwnd (url,'wfloat1',size+'toolbar=no,menubar=yes,scrollbars=no,status=no');
	wnd1.document.open();
	wnd1.document.open();
	wnd1.document.write("<html><head><script>function resize(){");
	wnd1.document.write("self.resizeTo (photo.width+12,photo.height+52); } onload=resize;");
	wnd1.document.write("</script><title>Увеличенное изображение</title></head><body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0><img src='"+url+"' alt='"+alt+"' border='0' vspace='0' hspace='0' id='photo'/><body></html>");
  wnd1.document.close();
}

function wfloat (target,size) {
var wWidth=750; // было 600
var wHeight=550; // было 450
var cWidth=window.screen.width;
var cHeight=window.screen.height;
if(cHeight && cWidth){
	var leftOffset=Math.ceil((cWidth-wWidth)/2);
	var topOffset=Math.ceil((cHeight-wHeight)/2);
	var size = size || 'width=678,height=560'
	var target = target || 'wfloat';
	openwnd ('',target,'width='+wWidth+',height='+wHeight+'toolbar=yes,menubar=yes,top='+topOffset+',left='+leftOffset);
 }
return false;
}

// показывает номер этажа когда подводим к этажу в матрице в здании
function ShowFloor(param, floor) {
	var s=document.getElementsByName('building_floor');
	var f=document.getElementsByName('floor_number');
//		alert(s.length)
	var temp=s[0].value;
	var tempimg=f[0].value;
//	if (temp == '' && tempimg == '') {
//		alert('')
//	}

	
	if(f[0].value != floor) {
		if(temp!='') {
			var o1=document.getElementById(temp + '_1');
			var o2=document.getElementById(temp + '_2');

			if(o1) o1.style.background='#65B7DF';
			if(o2) {
				o2.src = eval("n_floor_" + floor + ".src");
			}
		}
		
		var o1=document.getElementById(param + '_1');
		var o2=document.getElementById(param + '_2');

		if(o1) o1.style.background='#FFFFFF';
		if(o2) {
			o2.src = eval("h_floor_" + floor + ".src");		
		}
		
		if(o1 && o2) { s[0].value=param; f[0].value=floor; }
	}
}
	
function HideFloor() {
/*
	var td = document.getElementsByTagName('TD');
	for (var i=0; i<td.length; i++) {
		if (td[i].className.indexOf('HideFloor') > -1) {
			td[i].style.background = '#65B7DF';
		}
	}
*/
	//var o1=document.getElementById(param + '_1');
	//var o2=document.getElementById(param + '_2');

	//if(o1) o1.style.background='#65B7DF';
	//if(o2) o2.style.color='#65B7DF';
}


	// date
Now = new Date();
var year=Now.getFullYear();
