function decision(message, url)
	{
	if(confirm(message)) location.href = url;
	}
		
function ajax_hivas(file, cel, query, mit){
	if(query.match('id:')){
		var keres = query.split("id:");
		query = keres[1]+'='+document.getElementById(keres[1]).value;
	}

	$("#" + cel).load(file + "?" + query + mit);
}

function ajaxFileUpload(){
	$("#loading")
	.ajaxStart(function(){
		$(this).show();
	})
	.ajaxComplete(function(){
		$(this).hide();
	});

	$.ajaxFileUpload(
		{
			url:'modules/Framework/Fileupload/doajaxfileupload.php',
			secureuri:false,
			fileElementId:'fileToUpload',
			dataType: 'json',
			success: function (data, status){
				if(typeof(data.error) != 'undefined'){
					if(data.error != ''){
						//alert(data.error);
						ajax_hivas('templates/Imageupload/Imageupload.php','images','','');
					}
					else{
						//alert(data.msg);
						ajax_hivas('templates/Imageupload/Imageupload.php','images','','');
					}
				}
			},
			error: function (data, status, e){
				//alert(e);
				ajax_hivas('templates/Imageupload/Imageupload.php','images','','');
			}
		}
	)

	return false;
}

function printPage(id){
	var a = window.open('modules/Szamlazo/Print.php?id='+id,'','width=800');
/*
	ajax_hivas('modules/Szamlazo/Print.php', 'szamla', 'id='+id, '');
	var a = window.open('','','width=800');
	a.document.open("text/html");
	a.document.write('<html><head>');
	a.document.write('</head><body style="background: #FFF;">');
	a.document.write(document.getElementById('szamla').innerHTML);
	a.document.write('</body></html>');
	a.document.close();
	//a.print();*/
}
function printPageSzallito(id){
	//ajax_hivas('modules/Szallitolevel/Print.php', 'szamla', 'id='+id, '');
	var a = window.open('modules/Szallitolevel/Print.php?id='+id,'','width=800');
	//a.document.print();
	//a.close();


	/*
	a.document.open("text/html");
	a.document.write('<html><head>');
	a.document.write('</head><body style="background: #FFF;">"');
	a.document.write(document.getElementById('szamla').innerHTML);
	a.document.write('</body></html>');
	a.document.close();
	a.print();*/
	//a.close();

	//var a = window.open('modules/szamlazo/print.php?id=' + id + '&sorszam=' + sorszam, '', 'width=853,height=900');
	//a.document.close();
}
function closer(object){
	object.style.display = "none";
}
function opener(a){
	//alert(a);
	//a.style.display = "block";
	document.getElementById(a).style.display = "block";
}
