function confirm_dez(name){
	return confirm('Вы действительно хотите Удалить?');
}
function confirm_mes(name){
	return confirm(name);
}



function PlaceOverBlur(){
	if(document.getElementById('sword').value=='' || 
	document.getElementById('sword').value==document.getElementById('sword').getAttribute('defvalue')){
		document.getElementById('sword').value=document.getElementById('sword').getAttribute('defvalue');
		document.getElementById('sword').style.color='#999999';
	}
}
function PlaceOverFocus(){
	if(document.getElementById('sword').value=='' || 
	document.getElementById('sword').value==document.getElementById('sword').getAttribute('defvalue')){
		document.getElementById('sword').value='';
		document.getElementById('sword').style.color='#000000';
	}
}
function lsFocus(){
	if(document.getElementById('sword').value==document.getElementById('sword').getAttribute('defvalue')){
		document.getElementById('sword').value='';
	}
}


function openwindow(url,ref,windowprop)
{
	var ElementWindow = window.open(url,"Showing","height=550,width=650,top=10,left=15,scrollbars=1,resizable=yes");
	if (window.focus){
		ElementWindow.focus();
	}

}

function minimize(idd)
{
	if(document.getElementById(idd).style.display=="inline")
		document.getElementById(idd).style.display="none";
	else
		document.getElementById(idd).style.display="inline";
}




function Contar(entrada,salida,texto,caracteres) 
{
  var entradaObj=getObject(entrada);
  var salidaObj=getObject(salida);
  var longitud=caracteres - entradaObj.value.length;

  if(longitud <= 0) 
  {
    longitud=0;
    texto='<span class="disable\">'+texto+'</span>';
    entradaObj.value=entradaObj.value.substr(0,caracteres);
  }
  salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
}
function getObject(obj) 
{
  var theObj;
  if(document.all) 
    if(typeof obj=="string") 
      return document.all(obj);
    else 
      return obj.style;

  if(document.getElementById) 
    if(typeof obj=="string") 
      return document.getElementById(obj);
    else 
      return obj.style;
  return null;
}
 

function initLightbox()
{
	
	if (!document.getElementsByTagName){ return; }
	var anchors = document.getElementsByTagName("a");

	// loop through all anchor tags
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];


		if (anchor.getAttribute("href") && (anchor.getAttribute("relf") == "inwin")){
			anchor.onclick = function () {ShImg(this); return false;}
		}
		if(anchor.getAttribute("href") && (anchor.getAttribute("ctid"))){
			anchor.onclick = function () {SH(this.getAttribute("ctid")); return false;}
		}

	}
}

var timer = null;
var ShObj = null;
function SH(obj){
	if(document.getElementById(obj).style.display == "none")
		document.getElementById(obj).style.display = "inline";
	else 
		document.getElementById(obj).style.display = "none";
}
function ShowPopup(obj){
	
	if(ShObj != null){
		ShowHidden("none", ShObj);
		ShObj = null;
	}
	clearTimeout(timer);
	ShowHidden("inline", obj);

}

function HiddenPopup(obj){
	timer = setTimeout("ShowHidden('none', '" + obj + "')",500);
	ShObj = obj;
}


function ShowHidden(op, obje){
	document.getElementById(obje).style.display = op;
}
