
var sid = Math.random();

function csakszam(adat,minta){
  for (var i=0; i<adat.length; i++)
    if (minta.indexOf(adat.charAt(i)) == -1)
      return false;

  return true;
             }

 function submitform()
{
  document.form.submit();
}


function regell(form)
{
hiba = "";
 if (!csakszam(form.becenev.value,"1234567890qwertzuiopasdfghjklyxcvbnmQWERTZUIOPASDFGHJKLYXCVBNM_")){ hiba += "A becenév nem megfelelő, a java-s chat használatát megkönnyítendően csak a-z,A-Z,'_',0-9 használhatsz 30 karakterig! köszönettel!\n";  }
if (!csakszam(form.mobiltelefonszam.value,"1234567890-/"))  { hiba += "Csak számot vagy -,/-t adhatsz meg telefonszámnak!\n";  }

 if (hiba.length > 2){ alert(hiba); return false;}

}

function eszrevetel(form){
hiba="";
if (form.emailcimeszrevetel.value == ""){ hiba+='Nincs megadva emailcím!\n'; }
if (form.velemeny.value == ""){ hiba+='Nem adtál meg véleményt!\n';           }
if (hiba.length > 2){ alert(hiba); return false;}
}

function hozza(form){
hiba="";
if (form.comment.value == ""){ hiba+='Nem adtál meg hozzászólást!\n';           }
if (hiba.length > 2){ alert(hiba); return false;}
}




function hidekepek(){
kepek.style.visibility="hidden"
}
function showkepek(){
kepek.style.visibility="visible"
}



function menushow(div){
        window.document.getElementById(div).style.display='block';
}

function menuhide(div){
        window.document.getElementById(div).style.display='none';

}


function getMouseXY2() {


var IE = document.all?true:false

  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + window.document.body.scrollLeft;
    tempY = event.clientY + window.document.body.scrollTop;

  } else {  // grab the x-y pos.s if browser is NS

  document.captureEvents(Event.MOUSEMOVE);

    tempX = window.document.pageX
    tempY = window.document.pageY
  }
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
//  document.Show.MouseX.value = tempX
//  document.Show.MouseY.value = tempY
  return true
}



function megjelenit(id){

    fent = (window.document.body.clientHeight/2) + window.document.body.scrollTop;
    oldalt = (window.document.body.clientWidth/2) + window.document.body.scrollLeft;



    window.document.getElementById(id).style.top= fent + "px";
    window.document.getElementById(id).style.left= (oldalt-150) + "px";
    window.document.getElementById(id).style.display='block';
}
function elrejt(id){
    window.document.getElementById(id).style.display='none';
}

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

if (curX>800)curX = curX-(curX-800);

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}


document.onmousemove=positiontip



	function createXmlHttp() {
	    var request = null;
	    if (window.XMLHttpRequest) {
	         request = new XMLHttpRequest();
	    }
	    else if (typeof ActiveXObject != undefined) {
	         request =
	               new ActiveXObject('Microsoft.XMLHTTP');
	    }
	    return request;
	}

	var ajaxRequest = null;

	function ajaxadatlap1(user) {


	    ajaxRequest = createXmlHttp();
	    if (ajaxRequest) {
	         ajaxRequest.open(
	               'get', 'modules/fotoalbum/ajax_adatlap.php?a=' + user + "&sid=" + sid, true);
	         ajaxRequest.onreadystatechange = ajaxCustomerInfo;
             ajaxRequest.send(null);
	    }
	}

	function ajaxCustomerInfo() {
	    if (ajaxRequest.readyState != 4) {
	         return;
	    }

	    var divCustomerInfo =
	         window.document.getElementById('dhtmltooltip')
	    divCustomerInfo.innerHTML =
	         ajaxRequest.responseText;
	}




function updater(url,parameter,div)
	{

		var url = url + ".php";
		var pars = parameter;
		var myAjax = new Ajax.Request(
			url,
			{
				method: 'get',
				parameters: pars,
				onFailure: reportError,
                onComplete: te

			});
    function te(request){
        $(div).innerHTML = request.responseText;
    }

	function reportError(request)
	{
//	   	alert('hiba: A szerver hibá kóddal tért vissza');

    }

}

function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function hidevalt(id){
    if(window.document.getElementById(id).style.display=='none')window.document.getElementById(id).style.display = 'block';
    else window.document.getElementById(id).style.display='none';
}