

function search(){
	alert(document.getElementsByName('bajomsearch')[0].value);

	window.location="?mod=search&word="+document.getElementsByName('bajomsearch')[0].value;
}
function showHide(elementid){

if ($(elementid).style.display == 'none'){
$(elementid).style.display = 'block';
} else {
$(elementid).style.display = 'none';
}
}

function listamutat(id)
{
	document.getElementById(id).style.display="block";
}

function listaelrejt(id)
{
	document.getElementById(id).style.display="none";
}

function delete_hirek_confirm(){
	
	var answer = confirm("Valóban törli??")

	
	if (answer){

		window.location = "?mod=hirek&action=delete&id="+document.getElementsByName('delete')[0].value;
		
	}
	
}
function delete_telepules_confirm(){
	var answer = confirm("Valóban törli??")

	
	if (answer){

		window.location = "?mod=telepules&action=delete&id="+document.getElementsByName('delete')[0].value;
		
	}
	
	
}
function delete_intezmenyek_confirm(){
	var answer = confirm("Valóban törli??")

	
	if (answer){

		window.location = "?mod=intezmenyek&action=delete&id="+document.getElementsByName('delete')[0].value;
		
	}
	
	
}
function delete_esemeny_confirm($id){
	var answer = confirm("Valóban törli??")

	
	if (answer){

		window.location = "?mod=esemenyek&action=delete&id="+$id;
		
	}
	
	
}
function delete_user_confirm($id){
	var answer = confirm("Valóban törli??")

	
	if (answer){

		window.location = "?mod=forum&action=delete_user&id="+$id;
		
	}
	
	
}
function checkfortasks (thedate, e){
		
		
		
		serverPage = "./include/taskchecker.php?date=" + thedate;
	
	
		var obj = document.getElementById(objID);
		processajax (serverPage, obj, "get", "")
	}
	
	function hidetask (){
		tObject = document.getElementById("taskbox");
		
		tObject.style.visibility = "hidden";
		tObject.style.height = "0px";
		tObject.style.width = "0px";
	}

function delete_hir_confirm(){
	var answer = confirm("Valóban törli??")

	
	if (answer){

		window.location = "?mod=hirek&action=delete_hir&id="+document.getElementsByName('delete')[0].value;
		
	}
	
	
}
function delete_hirkat_confirm(){
	var answer = confirm("Valóban törli??")

	
	if (answer){

		window.location = "?mod=hirek&action=delete_kat&id="+document.getElementsByName('delete_kat')[0].value;
		
	}
	
	
}
function delete_onkormanyzat_confirm(){
	var answer = confirm("Valóban törli??")

	
	if (answer){

		window.location = "?mod=onkormanyzat&action=delete&id="+document.getElementsByName('delete')[0].value;
		
	}
	
	
}
 
function delete_image_confirm(id,id2){
	var answer = confirm("Valóban törli??");

	
	if (answer){

		window.location = "?mod=galeria&action=delete_image&id="+id+"&g_id="+id2;
	
	}else{
		
		
	}
	
	
}
function handleEnter(e) {
var keynum;
// IE
if(window.event) keynum=e.keyCode;
// Netscape/Firefox/Opera
else if(e.which) keynum = e.which;
if(keynum==13){
if(document.forms['login']) document.forms['login'].submit();
else if(document.forms['postMsg']) submitForm();
}
return keynum;
}
function delete_gallery_confirm(id){
	var answer = confirm("Valóban törli??");

	
	if (answer){

		window.location = "?mod=galeria&action=delete_gallery&id="+id;
	
	}else{
		
		
	}
	
	
}
function delete_elerhetoseg_confirm(){
	var answer = confirm("Valóban törli??")

	
	if (answer){

		window.location = "?mod=elerhetosegek&action=delete&id="+document.getElementsByName('delete')[0].value;
	
	}else{
		
		
	}
	
	
}
function findPosX(obj){
		var curleft = 0;
		if (obj.offsetParent){
			while (obj.offsetParent){
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		} else if (obj.x){
			curleft += obj.x;
		}
		return curleft;
	}
	
	function findPosY(obj){
		var curtop = 0;
		if (obj.offsetParent){
			while (obj.offsetParent){
				curtop += obj.offsetTop
				obj = obj.offsetParent;
			}
		} else if (obj.y){
			curtop += obj.y;
		}
		return curtop;
	}

function displayHTML(printContent) {
var inf = printContent;
win = window.open("./print.htm", 'popup', 'toolbar = no, status = no');
win.document.write(inf);
}
function register(){
	var p1;
	var p2;
	var n;
	n=document.getElementsByName('name')[0].value;
 p1=document.getElementsByName('password')[0].value;
 p2=document.getElementsByName('apassword')[0].value;
var email=document.getElementsByName('email')[0].value;
if((p1==p2)&&(p1.length>0&&p2.length>0)&&(n.length>0)){
	if(emailCheck(email)){
var hash = hex_md5(p1);

 var postStr = 'mod=forum&content=add';
postStr=postStr+"&"+"name="+n;
postStr=postStr+"&email="+email;
postStr=postStr+"&password="+hash;

	window.location = "?"+postStr;
	
	}else{
		alert("hhhh");
	}
}else{
	alert("hhhéh");
	
}
}
function emailCheck(email) {
if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
{
return (true)
}
else
{
alert("Hibás email cím formátum!")
return (false)
}
}
function list(id){
	



window.location='?mod=forum&content=list_hozzaszolas&id='+id;

}
function login(){
	
var password=document.getElementsByName('user_password')[0].value;
var hash = hex_md5(password);
var user_email=document.getElementsByName('user_email')[0].value;
window.location='?mod=forum&content=login&user_email='+user_email+'&user_password='+hash;
}
function gallery_change(){
	
	
	window.location = "?mod=galeria&action=list&id="+document.getElementById('gallery').value;
	
}
function delete_tema_confirm(id){
		var answer = confirm("Valóban törli??");

	
	if (answer){

		window.location = "?mod=forum&action=delete_tema&id="+id;
	
	}else{
	
		
	}
	
}
function delete_hsz_confirm(id,tid){
		var answer = confirm("Valóban törli??");


	if (answer){

		window.location = "?mod=forum&content=delete_hsz&id="+id+"&tid="+tid;
	
	}else{
	
		
	}
	
}
function check_tema(){

	var tema_name;
	var tema_text;
	tema_name=$(tema_name).value;
	tema_text=$('tema_text').value;
	alert(tema_name);
	if(tema_name.length>0){
		
		window.location="?mod=forum&action=uj_tema&tema_name="+tema_name+"&tema_text="+tema_text;
	}else{
		
		alert("Kérem írjon be egy téma nevet");
	}
}