function win_open( hght, wdth )
{
	
var d = window.document;
var winHeight = 0;

if (typeof window.innerHeight!='undefined') {
  winHeight = window.innerHeight;
} else {
  if (d.documentElement && typeof d.documentElement.clientHeight!='undefined' && d.documentElement.clientHeight!=0) {
    winHeight = d.documentElement.clientHeight;
  } else {
    if (d.body && typeof d.body.clientHeight!='undefined') winHeight = d.body.clientHeight;
  }
}

  now = new Date();
  win_width = wdth+40+20;
  win_heght = hght+150;

/*  if ( wdth == 0 && hght == 0) {
    win_width = 502;
    win_heght = 400;
  }

 */

 if ( win_heght > winHeight) {
    win_heght = winHeight;
  }

  return window.open('',now.getTime(),'width=' + win_width + ', height=' + win_heght + ', menubar=yes, scrollbars=yes');
}


function navigation_map( hght, wdth, src)
{
  newWindow = win_open( hght, wdth );
  newWindow.location.replace(src);
}



function bigPhoto( hght, wdth, img_tag, date_str, desc_str, file_str, lang ) {

  // ALT
  alt = 'YakutiaToday.Com';
  if (img_tag.indexOf('alt="') >= 0) {
    alt = img_tag.substring(img_tag.indexOf('alt="')+5);
    alt = alt.substring(0, alt.indexOf('"'));
  }

  newWindow = win_open( hght, wdth );
  newWindow.document.writeln('<HTML><HEAD>');

   if( lang == 'Russian' ){
    newWindow.document.writeln('<TITLE>Гид по Республике Саха (Якутия)</TITLE>');
   }

   if( lang == 'English' ){
     newWindow.document.writeln('<TITLE>Guide to the Sakha Republic (Yakutia)</TITLE>');
   }

  newWindow.document.writeln('<link href="../style.css" rel="stylesheet">');
  //newWindow.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
  newWindow.document.writeln('</head>');
  newWindow.document.writeln('<body bgcolor=' +window.document.bgColor+ ' leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>');
  newWindow.document.writeln('<TABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">');
  newWindow.document.writeln('<TR><TD height="15"><IMG src="../details/dot.gif" width="1" height="15" border="0"></TD></TR>');
  newWindow.document.writeln('<TR><TD height="1" bgcolor="#d4d4d4"><IMG src="../details/dot.gif" width="100%" height="1" border="0"></TD></TR>');
  newWindow.document.writeln('<TR><TD height="10"><IMG src="../details/dot.gif" width="1" height="10" border="0"></TD></TR>');
  newWindow.document.writeln('<TR><TD align="center" valign="top">');

  newWindow.document.writeln('<TABLE width="' + wdth + '" border="0" cellpadding="0" cellspacing="0">');
  newWindow.document.writeln('<TR>');
  newWindow.document.writeln('    <TD align="center" valign="top" height="' + hght + '">' + img_tag + '</TD>');
  newWindow.document.writeln('</TR>');
  newWindow.document.writeln('<TR><TD align="right" class="here">' + alt + '<BR></TD></TR>');
  newWindow.document.writeln('<TR><TD valign="top">');

 if( date_str != '' ){
  newWindow.document.writeln('	<B>' + date_str + '<BR></B>');
 }

 if( desc_str != '' ){
  newWindow.document.writeln('	' + desc_str + '<BR>');
 }

 if( file_str != '' ){
  newWindow.document.writeln('	' + file_str + '<BR>');
 }

 if( lang == 'Russian' ){
     newWindow.document.writeln('	<IMG src="../details/logo.gif" width="232" height="39" hspace="0" vspace="5" border="0" align="right"></TD></TR>');
  }
  if( lang == 'English' ){
     newWindow.document.writeln('	<IMG src="../details/logo.gif" width="232" height="39" hspace="0" vspace="5" border="0" align="right"></TD></TR>');
  }
  newWindow.document.writeln('</TABLE>');

  newWindow.document.writeln('</TD></TR>');
  newWindow.document.writeln('<TR><TD height="1" bgcolor="#d4d4d4"><IMG src="../details/dot.gif" width="100%" height="1" border="0"></TD></TR>');
  newWindow.document.writeln('<TR><TD height="15"><IMG src="../details/dot.gif" width="1" height="15" border="0"></TD></TR>');
  newWindow.document.writeln('</TABLE>');
  newWindow.document.writeln('</BODY></HTML>');
  newWindow.document.close();
}



function getImgTagWSize(file, alt,  hght, wdth ) {
  return '<IMG src="' + file + '" border=0 alt="' + alt + '" HEIGHT="' + hght + '"  WIDTH="' + wdth + '">';
}

function getFileTag(file_url, ext, size, lang) {
  if( lang == 'English' ){
    return '<A href="' + file_url + '" target="_blank"><IMG border=0 hspace=1 vspace=1 alt="high-end graphics" SRC="/images/quality_photo_eng.gif" height=42 width=175><br><SPAN class=gray>(format - ' + ext + ' / size - ' + size + ' kb)</SPAN></A>';
  }
  return '<A href="' + file_url + '" target="_blank"><IMG border=0 hspace=1 vspace=1 alt="изображение высокого разрешения" SRC="/images/quality_photo.gif" height=42 width=175><br><SPAN class=gray>(формат - ' + ext + ' / размер - ' + size + ' kb)</SPAN></A>';
}

