isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;
function confdel(url,cnf) {    
	if(!cnf) {
		cnf="Вы действительно хотите удалить этот элемент? Это действие не может быть отменено позднее!";
	}
	if (confirm(cnf)) {
		location.href=url;
	}
}
function dateChanged(calendar) {
  // Beware that this function is called even if the end-user only
  // changed the month/year.  In order to determine if a date was
  // clicked you can use the dateClicked property of the calendar:
  if (calendar.dateClicked||calendar.TodayClicked) {
    var y = calendar.date.getFullYear();
    var m = calendar.date.getMonth()+1;     // integer, 0..11
    var d = calendar.date.getDate();      // integer, 1..31
    // redirect...
    window.location = "news-y-" + y + "-m-" + m + "-n-" + d + ".html";
  }
}

function getelementbyid(myid) {
   if (isNS4){
        objElement = document.layers[myid];
     }else if (isIE4) {
        objElement = document.all[myid];
     }else if (isIE5 || isNS6) {
             objElement = document.getElementById(myid);
     }
return(objElement);
} 

function xlshow(id)
 {
  el=getelementbyid(id);
  if(el) {
    el.style.display='block';
  }
 }
function xlshowhide(id)
 {
  el=getelementbyid(id);
  if(typeof el == undefined) { return ;}
  if((el.style.display=='block')||(el.style.display=='')) {
    xlhide(id);
  }
  else {
    xlshow(id);
  }
 }
function xlhide(id)
 {
  el=getelementbyid(id);
  if(typeof el == undefined) { return ;}
  if(el) {
    el.style.display='none';
  }
}       

function keyup_team(inp) {
	str="";
	orig_len=inp.value.length;
	for (i=0;i<orig_len;i++) {
		if(((inp.value.charAt(i)>='a')&&(inp.value.charAt(i)<='z'))||((inp.value.charAt(i)>='A')&&(inp.value.charAt(i)<='Z'))||((inp.value.charAt(i)>='0')&&(inp.value.charAt(i)<='9'))||(inp.value.charAt(i)==' ')||(inp.value.charAt(i)=='_')||(inp.value.charAt(i)=='-')) {
			str+=inp.value.charAt(i);
		}
	}
	if(orig_len!=str.length) {
		inp.value=str;
	}
}