function radaBildi(link, x, y){
	try { window.prof_opened.close(); if (window.prof_opened.closed) throw 'a^€¦' }
	catch(e) { window.prof_opened = window.open(link,null,'resizable=yes, scrollbars=yes, location=no, width='+x+', height='+y+', left='+((self.screen.availWidth-x)/2)+', top='+((self.screen.availHeight-y)/2)) }
	return false
}

function cipariOnly(input){
    if(input.value.match(/\W+/g)){
        alert('Šeit var rakstīt tikai a-z, A-Z vai 0-9');
        input.value = input.value.replace(/[^\w]*/g,'');
        input.focus();
    }
}

var theObj="";
var theId="";


function toolTip(id,me) {
  theObj=me;
  theId=id;

  theObj.onmousemove=updatePos;
  window.onscroll=updatePos;
  theObj.onclick=hideMe;
  //document.getElementById(id).innerHTML=text;
  document.getElementById(theId).style.display="block";
  document.getElementById(theId).style.visibility="visible";
}

function updatePos() {
  var ev=arguments[0]?arguments[0]:event;
  var x=ev.clientX;
  var y=ev.clientY;
  diffX=0;
  diffY=100;
  document.getElementById(theId).style.top  = y - 2 + diffY + document.body.scrollTop + "px";
  document.getElementById(theId).style.left = x - 2 + diffX + document.body.scrollLeft + "px";
  theObj.onmouseout=hideMe;
}
function hideMe() {
  document.getElementById(theId).style.display="none";
  document.getElementById(theId).style.visibility="hidden";
}