function confirm_dez(name){
	return confirm('Вы действительно хотите Удалить?');
}
function confirm_mes(name){
	return confirm(name);
}

function alert_mes(name){
	alert(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='#C0D6A7';
	}
}
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='#83aa51';
	}
}
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("div");

	// loop through all anchor tags
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];
		
		if(anchor.getAttribute("mname")){
			anchor.onmouseover = function () {ShowPopup(this.getAttribute("mname"), "show");}
			anchor.onmouseout = function () {HiddenPopup(this.getAttribute("mname"), "hide");}
		}

	}
}

var timer = null;
var ShObj = null;

function ShowPopup( obj ){
	
	ShowHidden( "inline", obj );

}

function HiddenPopup( obj ){

	ShowHidden( "none", obj ) ;

}

function ShowHidden(op, obje){

	document.getElementById(obje).style.display = op;

}