var newWin;
function RegFreeAccess(url){
var ParmScr = "menubar=no,width=" + (screen.width - 15) + ",height=" + (screen.height - 80) + ",left=0,top=0,resizable=yes,toolbar=no,location=no,scrollbars=yes,directories=no,status=no";
window.open(url, "opacg", ParmScr);
}

function winopen(url,w,h){
var t = "resizable=yes,scrollbars=yes,height=" + h + ",width="+ w;
if(!newWin || newWin.closed){
    newWin= window.open(url,"new", t);
    }
	else {
    newWin.location.href = url;
    if(newWin.focus) newWin.focus();
    }
}

var const1="<html><head><title>";
var const2="</title><LINK href='/eng/styles_win.css' type='text/css' rel='stylesheet'></head>" + "<body><div class=\"center\"><img src='";
var const3="_b.jpg' vspace=10><div class=\"center\">";
var const31="_b.";
var const32="' vspace=10><div class=\"center\">";
var const4="</div><p class=\"nav\"><A HREF='javascript:self.close()'>Close the window</A></p></body></html>";

function winopen1(n,img){	
var t = "resizable=yes,scrollbars=yes,height=470,width=760";
var s = const1+title+const2+cat+img+const3+str[n]+const4;
	if(!newWin || newWin.closed){
    newWin= window.open("","new", t);
	newWin.document.open();
    newWin.document.write(s);
	newWin.document.close();
    }
	else {
   	newWin.document.open();
    newWin.document.write(s);
	newWin.document.close();
	if(newWin.focus) newWin.focus();
    }
}

function win_open1(n,img,type){	
var t = "resizable=yes,scrollbars=yes,height=470,width=760";
var img_type = 'jpg';
if(type=='g') img_type = 'gif';
var s = const1+title+const2+cat+img+const31+img_type+const32+str[n]+const4;
	if(!newWin || newWin.closed){
    newWin= window.open("","new", t);
	newWin.document.open();
    newWin.document.write(s);
	newWin.document.close();
    }
	else {
   	newWin.document.open();
    newWin.document.write(s);
	newWin.document.close();
	if(newWin.focus) newWin.focus();
    }
}

function winopen2(num){
var t = "resizable=yes,scrollbars=yes,height=470,width=760";
var url = "show_img.php?n=" + num;
if(!newWin || newWin.closed){
    newWin= window.open(url,"new", t);
    }
	else {
	newWin.location.href = url;
    if(newWin.focus) newWin.focus();
    }   
}


function gotofond(url){
if ((window.opener)&&(self.name=='new')){
if (window.opener.frames) window.opener.parent.location.href = url;
else window.opener.location.href = url;
self.close();
}
else location.href = url;
}

function wrmail(f){
var str = "<a href='mailto:" + f + "@nlr.ru'>" + f + "@nlr.ru</a>";
document.write(str);
}

function wrmail1(f,m){
var str = "<a href='mailto:" + f + "@" + m + "'>" + f + "@" + m + "</a>";
document.write(str);
}

function show_flash(name,w,h){
var h_win = h + 50;
var w_win = w + 40;
var t = "resizable=yes,scrollbars=yes,height=" + h_win + ",width="+ w_win;
var url = "/eng/coll/music/flash/" + name;
var str = '<html><head><title>The Collections of the National Library of Russia</title><LINK href="/eng/coll/music/styles.css" type="text/css" rel="stylesheet"></head><body style="background-color: #F9F1E8">';
str += '<div class="center"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"  WIDTH="' + w + '" HEIGHT="' + h + '" id="sound" ALIGN="top">';
str += '<PARAM NAME=movie VALUE="' + url + '"><PARAM NAME=quality VALUE=high>';
str += '<EMBED src="' + url + '" quality=high scale=noborder wmode=transparent devicefont=true bgcolor=#F9F1E8  WIDTH="' + w + '" HEIGHT="' + h + '" NAME="sound" ALIGN="top"	TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></div>';
str += '<div class="nav"><A HREF="javascript:self.close()">Close the window</A></div></body></html>';
	if(!newWin || newWin.closed || is_opera){
    newWin= window.open("","new", t);
	newWin.document.open();
    newWin.document.write(str);
	newWin.document.close();
	if(newWin.focus) newWin.focus();
    }
	else {
   	newWin.document.open();
    newWin.document.write(str);
	newWin.document.close();
	if(newWin.focus) newWin.focus();
    }
}
