/* JavaScript file */

//меню

var item_s=1;
var item_e=4;

function Movemenu(where){
if (where=='up' && item_s>1) {
yo54=item_s-1;
document.getElementById('item'+yo54).style.display="block";
document.getElementById('item'+item_e).style.display="none";
item_s--;
item_e--;
}

if (where=='down' && item_e<end) {
yo54=item_e+1;
document.getElementById('item'+item_s).style.display="none";
document.getElementById('item'+yo54).style.display="block";
item_s++;
item_e++;
}
return false;
}
//end

//смена

NN=(document.layers) ? true : false;
IE=(document.all) ? true : false;
OLD=!(IE || NN);

function showon(ims,name)
{
ims.src="/images/menu/a"+name+".gif";
ims.style.width = 'auto';
ims.style.width='auto';
ims.style.display = 'none';
ims.style.display = 'block';
}
function showoff(ims,name){
ims.src="/images/menu/"+name+".gif";
ims.style.width = 'auto';
ims.style.width='auto';
ims.style.display = 'none';
ims.style.display = 'block';
}
//




// новое
function wfloat4 (target,size) {
var wWidth=500;
var wHeight=556;
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=500,height=556';
	var target = target || 'wfloat4';
	openwnd ('',target,'width='+wWidth+',height='+wHeight+'location=no,toolbar=no,resizable=no,menubar=no,status=no,scrollbars=no,top='+topOffset+',left='+leftOffset);
 }
return false;
}

// карта
function wfloat5 (target,size) {
var wWidth=500;
var wHeight=556;
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=500,height=556';
	var target = target || 'wfloat5';
	openwnd ('',target,'width='+wWidth+',height='+wHeight+'location=no,toolbar=no,resizable=no,menubar=no,status=no,scrollbars=no,top='+topOffset+',left='+leftOffset);
 }
return false;
}

function OpenWindowImage0 (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><head><META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><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 OpenWindowImage (url,alt,width,height,lang) {
	wnd1 = null;
	//alert (url+' | '+alt+' | '+width+' | '+height+' | '+lang);
	var url = url || '';
	var alt = alt || '';
	var width = width || 900;
	var height = height || 690;
	var size = 'width='+width+',height='+height;
	var wdt = screen.width;
	var hgt = screen.height;
	if (lang == 'en') {
		var title = 'The increased image';
		var close_ = 'Close window';
	} else {
		var title = 'Увеличенное изображение';
		var close_ = 'закрыть окно';
	}
if ( window.outerWidth && window.outerHeight ) {
	var newfeature = 'outerWidth='+width+',outerHeight='+height;
} else {
	var newfeature = 'width='+width+',left=0,top=0,height='+height;
}
	wnd1 = window.openwnd (url,'wfloat1',newfeature+',screenX=0,screenY=0,toolbar=no,titlebar=no,menubar=no,scrollbars=yes,status=no,fullscreen=no');
	wnd1.document.open();
	wnd1.document.open();
	wnd1.document.write("<html><head>");
	wnd1.document.write("<script>function resize(){self.resizeTo ("+newfeature+"); } onload=resize; </script>");
	
	wnd1.document.write("<title>"+title+"</title></head><body bgcolor=#C2C2C2 topmargin=0 leftmargin=0 marginwidth=0 marginheight=0><table height=100% width=100%><tr><td align=center valign=middle><div style='position:absolute; top:15px; right:0px;' align='right'><a href='#' style='color:#000; font-size:60%; margin-right:10px; margin-top:0px;' onclick='window.close(); return false;'>"+close_+" [X]</a></div><img src='"+url+"' alt='"+alt+"' border='0' vspace='10' hspace='0' id='photo'/></td></tr></table><body></html>");
	
	//wnd1.document.write("<title>Увеличенное изображение</title></head><body bgcolor=#424242 topmargin=0 leftmargin=0 marginwidth=0 marginheight=0><table height=95% width=100%><tr><td height=20 align=right><a href='#' style='color:#FFFFFF; font-size:80%; padding-right:10px; padding-top:10px;' onclick='window.close(); return false;'>закрыть окно [X]</a></td></tr><tr><td align=center valign=middle><img src='"+url+"' alt='"+alt+"' border='0' vspace='0' hspace='0' id='photo'/></td></tr></table><body></html>");
  wnd1.document.close();
}


function wopen_gallery(sUrl, aSize, sParam) {
	var size = 'width=' + aSize[0] + ',height=' + aSize[1] || 'width=530,height=445';
	
	window.open( sUrl, '', size + ',toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,location=no' );
	//alert( sUrl );
}
