function game(descript,name) {
  fotowin=window.open(descript, name, "width=800,height=615,dependent,scrollbars,resizable,menubar,top=10,left=10");
  fotowin.focus();
}

function opendwin(descript,name) {
  fotowin=window.open(descript, name, "width=700,height=600,dependent,scrollbars,resizable,menubar,top=10,left=10");
  fotowin.focus();
}

function openvideowin(descript) {
  fotowin=window.open(descript, 'hint', "width=450,height=360,dependent,scrollbars,resizable,menubar,top=200,left=200");
  fotowin.focus();
}

function opensmallwin(descript) {
  fotowin=window.open(descript, 'hint', "width=250,height=200,dependent,scrollbars,resizable,menubar,top=10,left=10");
  fotowin.focus();
}

function openwin(descript) {
  fotowin=window.open(descript, 'hint', "width=700,height=600,dependent,scrollbars,resizable,menubar,top=10,left=10");
  fotowin.focus();
}

function openwin(descript) {
  fotowin=window.open(descript, 'hint', "width="+screen.availWidth+",height="+screen.availHeight+",dependent,scrollbars,resizable,menubar,top=10,left=10");
  fotowin.focus();
}

function showpicture(descript) {
  fotowin=window.open(descript, 'hint', 'width=840,height=600,dependent,scrollbars,resizable,menubar,top=60,left=30');
  fotowin.focus();
}
function run() {}

function show(name) {
 o = document.all?document.all[name]:document.getElementById(name);
 o.style.display = (o.style.display=="block")?"none":"block";
}

function openWnd(url, width, height)
{
 width = width + 20;
 height = height + 25;

 if (height < screen.availHeight)
  params = 'height=' + height + ', width=' + width + ', scrollbars=0, status=0, resizeable=0';
 else
  params = 'height=' + (screen.availHeight - 40) + ', width=' + (width + 20) + ', scrollbars=1, status=0, resizeable=1';

 wnd = window.open(url, 'wnd', params);
 wnd.focus();
}

function openWnd_p(url, width, height)
{
  if(width < 400)
     width=width+300;
  else 
    width=width+100;
  height = height + 300;

 if (height < screen.availHeight)
  params = 'height=' + height + ', width=' + width + ', scrollbars=0, status=0, resizeable=0';
 else
  params = 'height=' + (screen.availHeight - 40) + ', width=' + (width + 20) + ', scrollbars=1, status=0, resizeable=1';

 wnd = window.open(url, 'wnd', params);
 wnd.focus();
}

function openWnd_newcd(alb_id)
{
  width = 560;
  height = 364;

 if (height < screen.availHeight)
  params = 'height=' + height + ', width=' + width + ', scrollbars=0, status=0, resizeable=0';
 else
  params = 'height=' + (screen.availHeight - 40) + ', width=' + (width + 20) + ', scrollbars=1, status=0, resizeable=1';

 wnd = window.open('http://www.avariya.ru/sms/newcd.php?alb_id='+alb_id, 'wnd', params);
 wnd.focus();
}

function video(file)
{
 //return true; // disabling adv

 var winContents = '<HTML><HEAD><TITLE>Дискотека Авария - видео</TITLE></HEAD>' +
  '<BODY TEXT=#000000 BGCOLOR=#FFFFFF MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 RIGHTMARGIN=0 BOTTOMMARGIN=0>' +
  '<embed pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" src="downloads/video/' + file + '.avi" width="320" height="290" type="application/x-mplayer2" autorewind="false" showdisplay="false" showstatusbar="false" showcontrols="true" autostart="false" filename="downloads/video/' + file+'.avi"></BODY></HTML>';


 var win = self.open('', 'Avariya1', 'width=320,height=290,status=0');
 win.document.open();
 win.document.write(winContents);
 win.document.close();
}

function video2(descript) {
  fotowin=window.open('video2.php', 'hint', "width=580,height=400,dependent,scrollbars,resizable,menubar,top=200,left=200");
  fotowin.focus();
}

function vote(text)
{

 var winContents = '<HTML><HEAD><TITLE>Дискотека Авария - Голосование Мисс Авария 2009</TITLE></HEAD>' +
  '<BODY TEXT=#000000 BGCOLOR=#FFFFFF MARGINWIDTH=5 MARGINHEIGHT=5 LEFTMARGIN=5 TOPMARGIN=5 RIGHTMARGIN=5 BOTTOMMARGIN=5><font face=verdana size=1>' + text + '<BR><BR><A HREF=\"javascript:window.close()\"><center><FONT FACE=verdana SIZE=2>Закрыть окно</A></BODY></HTML>';


 var win = self.open('', 'Avariya1', 'width=320,height=290,status=0');
 win.document.open();
 win.document.write(winContents);
 win.document.close();
}