
function tuap(id_album, id_photo) {
	
	return;
	
	new Ajax.Request('/aj/tuap.php', 
			 { method:'post', parameters: {id_album: id_album, id_photo: id_photo},
			   onSuccess: function(transport) {
			   		var new_src = transport.responseText;
			   		tuapc_timer = setTimeout('tuap(' + id_album + ', ' + id_photo + ')', 1000);
			   }, 
			   onFailure: function() { 
			   } });	
}			 

function tuapc() {
	
	return;
	
	if ( typeof(tuapc_timer) != 'undefined' ) clearTimeout(tuapc_timer); 
}

function a_del(url,name) {
	var answer=window.confirm('Удалить альбом «'+name+'» ?')
	if (answer) {
		window.location = url;
	}	
}  	
function p_del(url,name) {
	var answer = false;
	if(!name) window.confirm('Удалить фото ?');
	else answer=window.confirm('Удалить фото «'+name+'» ?')
	if (answer) {
		window.location = url;
	}	
}
function show_select(uid) {
	
	var clt = document.getElementsByTagName('INPUT');
	var sel_count = 0;
	for ( var ci = 0; ci < clt.length; ci++ ) {
		if(clt[ci].id=='photoCheck') {
			if('cid:'+uid==clt[ci].name) {
				clt[ci].checked = clt[ci].checked?false:true;
			}
			if(clt[ci].checked==true) sel_count++;
			if(document.getElementById('d'+clt[ci].name)) {
				if(clt[ci].checked==true) {
					document.getElementById('d'+clt[ci].name).className = 'active';
					// document.getElementById('d'+clt[ci].name).style.backgroundColor='#DFDDB3';
				} else {
					document.getElementById('d'+clt[ci].name).className = '';
					// document.getElementById('d'+clt[ci].name).style.backgroundColor='#fff';
				}
			}
		}
	} 
	
	/*
	if(sel_count>0) {
		if(document.getElementById('select_block_order_no')) document.getElementById('select_block_order_no').style.display = 'none';
		if(document.getElementById('select_block_order_yes')) document.getElementById('select_block_order_yes').style.display = 'block';
		if(document.getElementById('select_block_del_no')) document.getElementById('select_block_del_no').style.display = 'none';
		if(document.getElementById('select_block_del_yes')) document.getElementById('select_block_del_yes').style.display = 'block';
	} else {
		if(document.getElementById('select_block_order_no')) document.getElementById('select_block_order_no').style.display = 'block';
		if(document.getElementById('select_block_order_yes')) document.getElementById('select_block_order_yes').style.display = 'none';
		if(document.getElementById('select_block_del_no')) document.getElementById('select_block_del_no').style.display = 'block';
		if(document.getElementById('select_block_del_yes')) document.getElementById('select_block_del_yes').style.display = 'none';
	}
	*/
}	
function info(info_message) {
	if(info_message) alert(info_message);
	return false;
}

function openw( url, name, width, height ) {
  
  if ( height < 100 ) height = 100; if ( width < 100 ) height = 100;
  var top = screen.availHeight / 2 - height / 2;
  var left = screen.availWidth / 2 - width / 2;
  var w = window.open( url, name,
    'resizable=no,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no' +
    ',top='+top+',left='+left+',height='+height+',width='+width );
  w.focus();
  return true;
}

function selectall() { 
	var clt = document.getElementsByTagName("INPUT"); 
	for ( var ci = 0; ci < clt.length; ci++ ) {
		clt[ci].checked = true 
		
	}
}
function unselectall() { var clt = document.getElementsByTagName("INPUT"); for ( var ci = 0; ci < clt.length; ci++ ) clt[ci].checked = false }
function invert() { var clt = document.getElementsByTagName("INPUT"); for ( var ci = 0; ci < clt.length; ci++ ) clt[ci].checked = clt[ci].checked?false:true }


window.status = '';


function errorHandler(e) {
	// al(e);
	return true;
}

//назначаем обработчик для события 
window.onerror = errorHandler;
