function openwindow(url,ref,windowprop)
{ElementWindow = window.open(url,"Showing","height=300,width=400,top=50,left=15,scrollbars=none")}


function show(fid){
	document.images["preview"].src = fid;
}

function openwindow(url){
	ElementWindow = window.open(url,'_blank','top=50,left=150,width=600,height=550,resizable=yes,scrollbars=yes')
}

function clr_confirm(name){
	return confirm('Вы действительно хотите удалить ?');
}

function clr_confirmSecond(StrUrl){
	
	if(confirm('Вы действительно хотите удалить ?'))
		location.replace(StrUrl);
		
}

function clr_message(mes){
	return confirm(mes);
}

function confirm_dez(name){
	return confirm('Вы действительно хотите изменить дизайн сайта?');
}

function checkForm(Mes) {

	if(document.post.mod_name.value.length < 1 || document.post.mod_title.value.length < 1 ||	document.post.mod_text.value.length < 1 ){
		alert(Mes); return false;
	}else
		return true;

}

function checkForm_UInf(Mes) {

	if(document.post.email.value.length < 1){
		alert(Mes); return false;
	}else
		return true;

}


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 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);
}

