document.getElementsByClassName = function (needle)
{
  var         my_array = document.getElementsByTagName("*");
  var         retvalue = new Array();
  var        i;
  var        j;

  for (i = 0, j = 0; i < my_array.length; i++)
  {
    var c = " " + my_array[i].className + " ";
    if (c.indexOf(" " + needle + " ") != -1)
      retvalue[j++] = my_array[i];
  }
  return retvalue;
}

function addEvent(obj, evType, fn)
{
	if (obj.addEventListener)
	{
		obj.addEventListener(evType, fn, true);
		return true;
	} 
	else if (obj.attachEvent)
	{
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} 
	else 
	{
		return false;
	}
}

function Togglediv(divName) {
//alert(document.getElementById(divName).style.display);
	if (document.getElementById(divName).style.display == "none") {
		 Showdiv(divName) ;
		}
	else {
		Hidediv(divName) ;
	}
} 

function Showdiv(divName) { 
	 document.getElementById(divName).style.display = "block"; 
} 
function Hidediv(divName){ 
	document.getElementById(divName).style.display = "none"; 
} 
 

function goBack(){
	history.go(-1);
	 
	return false;
	}
	
function go(url){
	 window.location=url;
	return false;
	}
 function sendValue(val,where){
	  if (self.opener && !self.opener.closed){
   		 self.opener.document.getElementById(where).value = val;
 		 window.close();
 		 return;
	}else{
		alert(self.opener);
		return;
	}
}

function open_page(page,w,h){
s=new Date();
width=eval(w)+20;
height=eval(h)+20;
parametry='scrollbars=yes,resizable=yes,width='+width+',height='+height;
nazwaOkna="page"+s.getTime();
nazwa= window.open(page,nazwaOkna,parametry);
return false;
//nazwa='toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function getChoice(url){
	$v=document.getElementById('User_id').value;
	self.location=url+$v;
	return true;
}
function toggle(divid){
	$("#"+divid).toggle();
}
function isNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

