function printpreorder( ){
	window.print();
}


function conf(url){
	if (confirm("Biztos, hogy törölni szeretnéd?")) window.location.href=url;
}


function ins(obj, val){
	document.getElementById(obj).value=val;
}


function showtime(){
	var	d = new Date();
		ora = '';
		perc = ''; 
		masodperc = '';
					
	var	napok = new Object();
		napok[0] = 'Vasárnap';
		napok[1] = 'Hétfő';
		napok[2] = 'Kedd';
		napok[3] = 'Szerda';
		napok[4] = 'Csütörtök'; 
		napok[5] = 'Péntek';
		napok[6] = 'Szombat';
						
	var	honapok = new Object();
		honapok[0] = 'Január';
		honapok[1] = 'Február';
		honapok[2] = 'Március';
		honapok[3] = 'Április';
		honapok[4] = 'Május';
		honapok[5] = 'Június';
		honapok[6] = 'Július';
		honapok[7] = 'Augusztus';
		honapok[8] = 'Szeptember';
		honapok[9] = 'Október';
		honapok[10] = 'November';
		honapok[11] = 'December';
						
	if ( d.getHours() <= 9 ){
		ora = '0' + d.getHours();
	}else{
		ora = d.getHours();
	}
					
	if ( d.getMinutes() <= 9 ){
		perc = '0' + d.getMinutes();
	}else{
		perc = d.getMinutes();
	}
					
	if ( d.getSeconds() <= 9 ){
		masodperc = '0' + d.getSeconds();
	}else{
		masodperc = d.getSeconds();	
	}
							
	ev = d.getFullYear();
	honap = d.getMonth();
	nap = d.getDate();
	
	
	document.getElementById("_date").innerHTML = ev + '. ' + honapok[honap] + ' ' + nap + '.';
	document.getElementById("_time").innerHTML = napok[d.getUTCDay()] + ', ' + ora + ':' + perc + ':' + masodperc;
}

function drawtime(){	
	window.setInterval( showtime, 200 );
}


function changecolor(obj, state){
	document.getElementById(obj).className = state;
}
			
			
function showcontract(){
	window.open("showcontract.php","contract",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,hotkeys=no,width=600,height=400');
}

function view( img ){
	mywindow = window.open("","",'toolbar=no,location=no,directories=no,status=no, resizable, menubar=no,scrollbars=yes,hotkeys=no,width=400, height=300');
	mywindow.document.write("<html>");
	mywindow.document.write("<head>");
	mywindow.document.write("<title>Villámnézet</title>");
	mywindow.document.write("</head>");
	mywindow.document.write("<body>");
	mywindow.document.write("<img width='100%' src='users/" + img + "' onclick='window.close();' alt='Kattintson a képre a bezáráshoz.' style='cursor:pointer;'>");
	mywindow.document.write("</body>");
	mywindow.document.write("</html>");
}
		

function check(objname){
	var obj = document.getElementById(objname);
	
	if (obj.value == ""){
		obj.className = "disabled";
	}else{
		obj.className = "disabled";
	}
}
	
function checkbox(objparent, objname){
	var objp = document.getElementById(objparent);
	var objn = document.getElementById(objname);
		
	if (objn.checked == false){
		document.registerform.regconfirm.value = "FALSE";
		objp.className = "disabled";
	}
		
	if (objn.checked == true) {
		document.registerform.regconfirm.value = "TRUE";
		objp.className = "enabled";
	}
}
	
	
function changelink(direction){
	if (direction == "back"){
		searchfrom = parseInt(document.getElementById('from').value);
		document.getElementById('from').value = searchfrom - parseInt(document.getElementById('searchsize').value);
		if (document.getElementById('from').value < 0 ){
			document.getElementById('from').value = "0";
		}
	}
	if (direction == "next"){
		searchfrom = parseInt(document.getElementById('from').value);
		document.getElementById('from').value = searchfrom + parseInt(document.getElementById('searchsize').value);
	}
}           

function cl(){
	window.close();
}

function ch(val,id){
	if (document.getElementById( "selecttype"+val ).value != ""){
		document.adminform.loggeduserid.value = id;
		document.adminform.page.value = document.getElementById( "selecttype"+val ).value;
	}
}
