function friends(){
	var bnrs=3;
	img=new Array(bnrs);
	link=new Array(bnrs);
	alt=new Array(bnrs);


	img[0]="http://ostrov-studio.ru/ostrov88x31.gif";
	link[0]="http://ostrov-studio.ru";
	alt[0]="СТУДИЯ 'ОСТРОВ'";

	img[1]="http://petelin.ru/banners/gbanner.gif";
	link[1]="http://www.unshaved.narod.ru/";
	alt[1]="Сайт Семена Обломкина";

	img[2]="http://petelin.ru/banners/cpsbanner.gif";
	link[2]="http://www.cps.ru";
	alt[2]="Компания CPS";

	img[3]="http://petelin.ru/img/ml88x31.gif";
	link[3]="http://www.musland.ru";
	alt[3]="Магазин Music Land";


	document.write('<p align="center">');
	for(var bnrnum=1;bnrnum<=bnrs;bnrnum++){
		document.write("<p align=\"center\"><a href=\""+link[bnrnum]+"\" target=\"_blank\">");
		document.write("<img src=\""+img[bnrnum]+"\" alt=\""+alt[bnrnum]+"\" border=0  width=\"88\" height=\"31\"></a></p>");
	}

//	document.write("<p align=\"center\"><img src=\"img/tree.gif\">");
	document.write("</p>");
}


//Галерея
if (self.screen) {width = (screen.width)-100;height = screen.height;}else{width = 640;height = 480;}

//width=700;

var gc="#FFFFFF";//цвет альбома
var cp="7";//заполнение ячеек
var cs="7";//промежуток м/у столбцами
var tbr="0";//рамка таблицы
var fs="2";//размер шрифта 1
var fs2="3";//размер шрифта 2
var fs3="4";//размер шрифта 3
var fc="#004080";//цвет шрифта 

function ShowImage(n){
	var photo=fn1+n+fn3;
	ImageWindow=window.open("",n,"width="+(x[n]+20)+",height="+(y[n]+60)+",copyhistory=no,status=no,resizable=yes,menubar=no,location=no,directories=no,alwaysRaised=yes,titlebar=no,scrollbars=no");
	ImageWindow.document.open();
	ImageWindow.document.write("<html><head><title>PETELIN.RU</title></head><body><p align=\"center\">");
	if (group2!=""){ImageWindow.document.write("<strong><font size="+fs3+">"+group2+"</font></strong>");}
	ImageWindow.document.write("<br><img src="+photo+"><br>");
	if (cmt[n]!=""){ImageWindow.document.write("<font size="+fs2+" color="+fc+"><em>"+cmt[n]+"</em></font>");}
	ImageWindow.document.write("</p></body></html>");
	ImageWindow.document.close();
}

function gallery(){

	var hn;//количество ячеек в альбоме по горизонтали
	hn=Math.round(width/tw);
	if(hn>ic){hn=ic;}

	var vn;//-"- по вертикали
	vn=Math.round(ic/hn)+1;

	document.write("<center><table border="+tbr+" cellpadding="+cp+" cellspacing="+cs+">");
	document.write("<tr><td bgcolor="+gc+" colspan="+hn+"><p align=\"center\">");//заголовок
	if(group!=""){document.write("<font size="+fs3+">"+group+"</font><br>");}
	document.write("<font size=\"2\">Щелкните нужную фотографию, чтобы получить ее увеличенное изображение.</font></p></td></tr>");

	var cc=0;
	var fn="";
	for(i=1;i<=vn;i++){
	document.write("<tr>");	
		for(j=1;j<=hn;j++){
			cc++;
			fn=fn1+cc+fn2;
			if(cc<=ic){
				document.write("<td bgcolor="+gc+">");
				document.write("<p align=\"center\"><a href=\"javascript:ShowImage("+cc+")\"><img src="+fn+" border=\"0\"></a><br>");
				if(cmt[cc]!=""){document.write("<font size="+fs+" color="+fc+"><em>"+cmt[cc]+"</em></font>");}
				document.write("</p></td>");
			}
		}	
		document.write("</tr>");
	}
	document.write("</table></center>");

}


function Subs() {

em=document.forms[0].elements[0].value;

if (em.indexOf('@', 0) == -1){
		alert("Введите правильно E-mail!");
		document.forms[0].elements[0].focus();
		return false;
		}

if (em.indexOf('666', 0) != -1){
		alert("Адреса, в которых присутствует число 666, не принимаются!");
		document.forms[0].elements[0].focus();
		return false;
	}

win=open("","disdplayWindow","width=300,height=200,status=no,toolbar=no,menubar=no");
win.document.open();
win.document.write("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\"><title>..:: Подписка на новости ::..</title><body bgcolor=\"#C0C0C0\" text=\"#000000\"></head>");
win.document.write('<body><center><br>Подтвердите добавление адреса<br><strong>'+em+'</strong><br>в базу рассылки новостей');
win.document.write('<form action="http://petelin.ru/mail/add.php" method="POST">');
win.document.write('<input type="hidden" name="email" value="'+em+'">');
win.document.write('<input type="submit" border="0" name="Submit" value="Подтверждаю">');
win.document.write('<input type="hidden" name="Submit" value="true">');
win.document.write("</form></center></body></html>");
win.document.close();

}