function findObj(n, d) {
	var p,i,x;
	if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	};
	if(!(x=d[n])&&d.all) x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for (i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
	return x;
};

function changeProp(objName,x,theProp,theValue) {
	var obj = findObj(objName);
	if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
};

function showImg(nameImg,partImg,titleImg,widthImg,heightImg) {
	var bytLeft = (screen.width - 650) / 2 - 5; 
	var bytTop = (screen.height - 490) / 2 - 5;
	winOpts = "toolbar=0,location=0,scrollbars=1,top="+bytTop+",left="+bytLeft+",width=650,height=490";
      urlPage = "/include/showpic.php?part="+partImg+"&namepic="+nameImg+"&w="+widthImg+"&h="+heightImg+"&title="+titleImg;
	  win1    = window.open(urlPage, "Screen", winOpts);
};

function showTnp(numberId) {
	var bytLeft = (screen.width - 650) / 2 - 5; 
	var bytTop = (screen.height - 470) / 2 - 5;
	winOpts = "toolbar=0,location=0,scrollbars=1,top="+bytTop+",left="+bytLeft+",width=650,height=470";
      urlPage = "/production/noprofile/info.php?id_num="+numberId;
	  win1    = window.open(urlPage, "Screen", winOpts);
};

function addBookmark() {
	if ((navigator.userAgent.indexOf("MSIE") >= 0) && ( parseInt(navigator.appVersion)>3)) {  
		window.external.AddFavorite("http://www.irkut.ru/", " '''' - www.irkut.ru");
	} else {
		AlertButton();
	}
}


function AlertButton() {
	window.alert("    -  CTRL+D");
}

function newsImg(nameImg,altText,widthValue,heightValue) {
      winOpts = "toolbar=0,location=0,scrollbars=1,width=620,height=450";
      win1    = window.open("", "picWin", winOpts);
      win1.document.open();
      win1.document.write(
        "<html>\n" +
        "<head>\n<title> </title></head>\n" +
        "<body>\n<center><font face=\"arial\" size=\"3\" color=\"#3a5abd\"><b>" +
	altText +
		"</b></font>\n<img src='/news/picnews/" +
	nameImg +
		".jpg' alt=\"" +
	altText +
		"\" width=\"" +
	widthValue +
		"\" height=\"" +
	heightValue +
		"\">\n" +
        "<hr noshade>\n" +
        "<form>\n<input type=button value='' " +
        "onClick='self.close()'>\n</form>\n</center>\n" +
        "</body>\n</html>");
      win1.document.close();
};

function showPic(nameImg,altText,widthValue,heightValue) {

	var bytLeft = (screen.width - 630) / 2 - 5; 
	var bytTop = (screen.height - 480) / 2 - 5;
/*window.open(strURL,"name","top="+bytTop+",left="+bytLeft+",width="+widthWin+",height="+heightWin);*/

      /*winOpts = "toolbar=0,location=0,scrollbars=1,width=630,height=480";*/
	  winOpts = "toolbar=0,location=0,scrollbars=1,top="+bytTop+",left="+bytLeft+",width=630,height=480";
      win1    = window.open("", "picWin", winOpts);
      win1.document.open();
      win1.document.write(
        "<html>\n" +
        "<head>\n<title>::   ::</title>\n" +
		"<META http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\">\n" +
		"<STYLE type=text/css>\n#divLoadCont {\n" +
		"BACKGROUND-COLOR: white; FONT-FAMILY: arial,helvetica; HEIGHT: 98%; LEFT: 0px; POSITION: absolute; TOP: 0px; WIDTH: 100%; Z-INDEX: 100; layer-background-color: white; }\n</STYLE>\n" +
		"<script language=javascript src=/include/loading.js></script></head>\n" +
        "<body>\n<center><img src=\"pic/" +
	nameImg +
		".jpg\" alt=\"" +
	altText +
		"\" width=\"" +
	widthValue +
		"\" height=\"" +
	heightValue +
		"\"><br>\n<font face=\"arial\" size=\"3\" color=\"#3a5abd\"><b>" +
	altText +
        "</b></font>\n<hr noshade>\n" +
        "<form>\n<input type=button value='' " +
        "onClick='self.close()'>\n</form>\n</center>\n" +
        "</body>\n</html>");
      win1.document.close();
};

function showPicGif(nameImg,altText,widthValue,heightValue) {
      winOpts = "toolbar=0,location=0,scrollbars=1,width=630,height=480";
      win1    = window.open("", "picWin", winOpts);
      win1.document.open();
      win1.document.write(
        "<html>\n" +
        "<head>\n<title>::   ::</title>\n" +
		"<META http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\">\n" +
		"<STYLE type=text/css>\n#divLoadCont {\n" +
		"BACKGROUND-COLOR: white; FONT-FAMILY: arial,helvetica; HEIGHT: 98%; LEFT: 0px; POSITION: absolute; TOP: 0px; WIDTH: 100%; Z-INDEX: 100; layer-background-color: white; }\n</STYLE>\n" +
		"<script language=javascript src=/include/loading.js></script></head>\n" +
        "<body>\n<center><img src=\"pic/" +
	nameImg +
		".gif\" alt=\"" +
	altText +
		"\" width=\"" +
	widthValue +
		"\" height=\"" +
	heightValue +
		"\"><br>\n<font face=\"arial\" size=\"3\" color=\"#3a5abd\"><b>" +
	altText +
        "</b></font>\n<hr noshade>\n" +
        "<form>\n<input type=button value='' " +
        "onClick='parent.close()'>\n</form>\n</center>\n" +
        "</body>\n</html>");
      win1.document.close();
};
