
function isEmpty(arr){
	if(arr.length > 1){
		return false;
	}else{
		return true;
	}	

}



function checkMessage(obj){

	var not_allowed = new Array();
	not_allowed[0] = "<";
	not_allowed[1] = ">";
	not_allowed[2] = "$";
	not_allowed[3] = "&lt";
	not_allowed[4] = "&gt";
	not_allowed[5] = "sql";
	not_allowed[6] = "script";
	
	arr = obj.uzenet.value.split(" ");
	
	/*alert(isEmpty(arr) + " " + arr.length);
	return false;
	var isEmpty = isEmpty(arr);
	
	alert(isEmpty);
	return false;*/
	
	if((obj.uzenet.value.length > 1) && isEmpty(arr)){
		alert('Kérem, írj egy üzenetet.');
		return false;
	}else{
		for(i=0;i<=not_allowed.length;i++){
			if(obj.uzenet.value.indexOf(not_allowed[i]) > -1){
				alert('Nem engedélyezett kifejezés: "' + not_allowed[i] + '"');
				return false;
				break;
			}
		}
	}
}

function checkRegistration(obj){
	if((obj.nev.value.length < 1) ||(obj.mobil.value.length < 1) || (obj.email.value.length < 1) ){
		showPopWin('regModal.html', 300, 150, null);
		return false;
	}
}

function checkInfo(obj){
	if((obj.nev.value.length < 1) || (obj.email.value.length < 1)  || (obj.uzenet.value.length < 1)){	
		showPopWin('infoModal.html', 300, 150, null);
		return false;
	}
	
	if(obj.email.value.indexOf("@") == -1  ){
		//alert('Kérem, töltsél ki egy érvényes emailcímet.');
		showPopWin('infoModal.html', 300, 150, null);
		return false;
	}

}

function checkAjandek(obj){

	if((obj.ajandekozo.value.length < 1) || (obj.email.value.length < 1) || (obj.nev.value.length < 1) || (obj.ertek.value.length < 1) || (obj.cim.value.length < 1)){
		showPopWin('regModal.html', 300, 150, null);
		return false;
	}
}


function overLay(){

    var height = document.body.clientHeight;
    var width = document.body.clientWidth;
    
 alert("height: " + height + " width: " + width);
 return false;
}





function x(popupURL, wxmeret, hxmeret)    {
var options="toolbar=0,locationbar=0,personalbar=0,directories=0,statusbar=0,menubar=0,scrollbar=0,resizable=0,left=150,top=100,width=" + wxmeret +",height=" + hxmeret;

var popup = window.open(popupURL, "",options);
}

function mOpen(id){	

	ddmenuitem = document.getElementById(id);
	
	if(ddmenuitem.style.display == 'block'){
		ddmenuitem.style.display = 'none';
	}else{
		ddmenuitem.style.display = 'block';
		ddmenuitem.style.backgroundColor='#EF8A1D';
	}
}

function show(id){
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.display = 'block';
}

function hide(id){
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.display = 'none';
}

function startTime() {
	var days = new Array();
	days[0] = "vasárnap";
	days[1] = "hétfő";
	days[2] = "kedd";
	days[3] = "szerda";
	days[4] = "csütörtök";
	days[5] = "péntek";
	days[6] = "szombat";
	
	var today=new Date();
	var h=today.getHours();
	var m=today.getMinutes();
	var s=today.getSeconds();
	// add a zero in front of numbers<10
	m=checkTime(m);
	s=checkTime(s);
	//document.getElementById('date').innerHTML=days[today.getDay()] + " " + today.toLocaleDateString() + "  &nbsp; " + h+":"+m+":"+s;
	document.getElementById('date').innerHTML="Pontos idő: &nbsp; " + h+":"+m+":"+s;
	t=setTimeout('startTime()',500);
}

function checkTime(i){
	if (i<10)  {
	  i="0" + i;
	}
	return i;
}


