var x_offset=0;
var y_offset=0;

function show_ajax_photo(fid, album) {
  var ret = false;
  var obj_id = 'mf'+fid;
  if (!document.getElementById(obj_id))
  {
  win = new Window(
    { className: "alphacube",
    id: obj_id, 
    title: "Фотография пользователя", 
    width:420, 
    height:430,
    top: 180,
    left: 240,
    resizable: false, 
    maximizable: false,
    destroyOnClose: true, 
    recenterAuto:false}); 
    win.getContent().update('<div id="wphoto" style="text-align:center;"><br><br><br><br><h1 align="center">Идет загрузка фото!!!</h1><br><br><br><br></div>');
    win.showCenter(false, 180+y_offset, 240+x_offset);
    x_offset += 20;
    y_offset += 20; 
  
    
    
	  var test = new Ajax.Updater('wphoto', '/ajax/client/mediumphoto.php?fid='+fid+'&album='+album+'',   
		{     
			method: 'get',
			evalScripts: true,
			onException: function(){ret = true;}
			
		});    
    
    if (ret) {
      win.destroy();
      win = new Window(
        { className: "alphacube", 
        title: "Фотография пользователя", 
        url: '/mediumphoto.php?fid='+fid+'&album='+album+'',
        width:420, 
        height:450,
        top: 180,
        left: 240,
        resizable: false, 
        destroyOnClose: true, 
        recenterAuto:false}); 
        win.getContent().update('<div id="wphoto" style="text-align:center;"><br><br><br><br><h1 align="center">Идет загрузка фото!!!</h1><br><br><br><br></div>'); 
        win.show(false);    
        ret = false;
    
    }
  }  
  return ret;
}



function show_foto(fid, album, old) {
	var ret = false;
	if (document.getElementById)
	{
		if (old)
		{
			document.getElementById('fn'+old).style.fontWeight = 'bold'; 
			document.getElementById('fn'+old).style.textDecoration = 'underline';
			document.getElementById('fn'+fid).style.fontWeight = 'normal'; 
			document.getElementById('fn'+fid).style.textDecoration = 'none';
		}

		if (false && adm)
		{
			var fid2 = (fid)?'&fid='+fid:'';
			document.getElementById('notice').href = '/phpcgi/warning.php?id='+user_id+'&lid='+login+''+fid2;
			document.getElementById('notice0').href = '/phpcgi/warning.php?id='+user_id+'&lid='+login+''+fid2;

			document.getElementById('photo_move').href = '/phpcgi/move_foto.php?fromalbum='+fromalbum+'&id='+user_id+'&login='+login+''+fid2;
			document.getElementById('photo_del').href = '/phpcgi/del_foto.php?fromalbum='+fromalbum+'&id='+user_id+'&login='+login+''+fid2;

		}
	}
	var test = new Ajax.Updater('tdfoto', '/ajax/client/smallphoto.php?fid='+fid+'&album='+album,   
		{     
			method: 'get',
			evalScripts: true,
			onException: function(){ret = true;}
			
		});
	return ret;
}

function what_u_want_say (obj) {
  var msg = prompt('В чем по Вашему мнению анкета нарушает правила?', '');
  if (msg) {
    obj.href += '&msg='+msg;
    return msg;
  }
  else {
    alert ('Вы не указали причину');
    return false;
  }
}
