// GX jQuery UI 0.1.0.1ß function errorMessage(text) {		if (!document.getElementById("errMsg")) {		$("#Wrapper").append("<div id=\"errMsg\"></div>");	}		$("#errMsg").dialog({	modal: true,	title: "Hiba történt!",	autoOpen: true, 	open: function() {		$(this).html(text);	},	buttons: {		"Rendben": function() {			$(this).dialog("destroy");		}	}	});		$(".ui-dialog").css("zIndex", 399900);    $(".ui-widget-overlay").css("zIndex", 399000);    return false;	}function alertMessage(text, title) {		if (!document.getElementById("alertMsg")) {		$("#Wrapper").append("<div id=\"alertMsg\"></div>");	}		$("#alertMsg").dialog({	modal: true,	bgiframe: true,	title: title,	autoOpen: true, 	open: function() {		$(this).html(text);	},	buttons: {		"OK": function() {			$(this).dialog("destroy");		}	}	});	    $(".ui-dialog").css("zIndex", 399900);    $(".ui-widget-overlay").css("zIndex", 399000);	return false;	}function fnMessage(text, title, action) {		if (!document.getElementById("fnMsg")) {		$("#Wrapper").append("<div id=\"fnMsg\"></div>");	}		if (title=="") { title="Információ!"; }		$("#fnMsg").dialog({	modal: true,	title: title,	autoOpen: true, 	open: function() {		$(this).html(text);	},	buttons: {		"Rendben": function() {			action();			$(this).dialog("destroy");		}	}	});    	$(".ui-dialog").css("zIndex", 399900);    $(".ui-widget-overlay").css("zIndex", 399000);    return false;}function updateCoords(c){	$('#x').val(c.x);	$('#y').val(c.y);	$('#w').val(c.w);	$('#h').val(c.h);}function checkCoords(){	if (parseInt($('#w').val())) {			$.post("/admin/php/gyogyitok/php/ccrop.php", {			x: $("#x").val(),			y: $("#y").val(),			w: $("#w").val(),			h: $("#h").val(),			fn: $("#fn").val()		}, function(xml) {            $("#userPicture").val(xml);			            if (document.getElementById("crop2")) {                $("#crop2").html("<img src=\"http://www.csodalatosgyogyulasok.hu"+xml+"\" />");            } else {                $("#crop").html("<img src=\"http://www.csodalatosgyogyulasok.hu"+xml+"\" />");                            }		});				return false;			}		errorMessage('Kérem jelölje ki a kivágni kívánt képrészletet az egérrel!');	return false;    }            function closeBox() {	if (api) $.mask.close();}$(document).ready(function() {    if (!document.getElementById("loading"))  {		$("#Wrapper").append('<img src="/admin/php/gyogyitok/loading.gif" width="41" height="39" border="0" id="loading" style="display: none; z-index: 9999999;" />');	}		$("#loading")	.ajaxStart(function(){		$(this).show();		$(document).mousemove(function(e) {					$("#loading").css({				position: "absolute",				top: e.pageY,				left: e.pageX			});					});	})	.ajaxComplete(function(e){		$(this).hide();	});                $(".ui-button").button();        $('ul.sf-menu').superfish();        $("#Player ul").cycle({        fx: "fade",        timeout: 6000,        speed: 1000,        pager: "#pager",        next: "#next",        prev: "#prev"    });        $("#Player").mouseenter(function() {        $("#NavBar").fadeIn(500);    }).mouseleave(function() {        $("#NavBar").fadeOut(500);    });    });function Register() {        if (!document.getElementById("regForm")) {        $("#Wrapper").append("<iframe name=\"regFrame\" allowTransparency=\"true\" id=\"regFrame\" />");        $("#Wrapper").append("<div id=\"regForm\" />");    }    rLeft = $(window).width()/2-450;        $("#regFrame").css({        position: "absolute",        left: rLeft,        top: 100,        width: 880,        padding: 10,        height: 490,        background: "#fff",        WebkitBorderRadius: 10,         MozBorderRadius: 10,         BorderRadius: 10,        zIndex: 299990,        display: "none"     }).stop().show(800);            $("#regForm").load("admin/php/gyogyitok/php/regform.php").css({        position: "absolute",        left: rLeft,        top: 100,        width: 880,        padding: 10,        height: 490,        background: "#fff",        border: "1px solid #ccc",        WebkitBorderRadius: 10,         MozBorderRadius: 10,         BorderRadius: 10,        zIndex: 299999    }).show("drop", 800).animate({        width: 880    }, 1000).expose({api: true, closeOnClick: false, closeOnEsc: true, onClose: function() { $("#regFrame").hide(); $("#regForm").hide("drop", 800, function() { $("#regFrame").remove(); $("#regForm").remove(); }); } }).disableSelection();            }function UserDatas(id) {        if (!document.getElementById("userInfo")) {        $("#Wrapper").append("<iframe name=\"userInfoFrame\" id=\"userInfoFrame\" allowTransparency=\"true\" />");        $("#Wrapper").append("<div id=\"userInfo\" />");    }    rLeft = $(window).width()/2-450;        $("#userInfoFrame").css({        position: "absolute",        left: rLeft,        top: 100,        width: 880,        padding: 10,        height: 490,        background: "#fff",        WebkitBorderRadius: 10,         MozBorderRadius: 10,         BorderRadius: 10,        display: "none",        zIndex: 299990    }).stop().show(800);            $("#userInfo").load("admin/php/gyogyitok/php/userinfo.php?userid="+id).css({        position: "absolute",        left: rLeft,        top: 100,        width: 880,        padding: 10,        height: 490,        background: "#fff",        border: "1px solid #ccc",        WebkitBorderRadius: 10,         MozBorderRadius: 10,         BorderRadius: 10,        zIndex: 299999    }).show("drop", 800).animate({        width: 880    }, 1000).expose({api: true, closeOnClick: false, closeOnEsc: true, onClose: function() { $("#userInfoFrame").hide(); $("#userInfo").hide("drop", 800, function() { $("#userInfoFrame").remove(); $("#userInfo").remove(); }); } }).disableSelection();    }function sendActivation() {        var email = $("#email").val();        var fullname = $("#fullname").val();        var bdate = $("#birthdate").val();        var pwd = $("#pwd").val();        var pwd1 = $("#pwd1").val();        var pic = $("#userPicture").val();        var error = 0;        var errorString = "";                if (pwd!=pwd1 || pwd.length<4) {            error = 1;            errorString += "A megadott jelszavak nem egyeznek, vagy túl rövid a megadott jelszó! \r\n";                         }                if (fullname.length<5) {            error = 1;            errorString += "A megadott név túl rövid! \r\n";         }                if (email.indexOf("@")<1 || email.length<4) {            error = 1;            errorString += "A megadott E-mail cím nem megfelelő! \r\n";        }                if (pic.length<10) {            error = 1;            errorString += "Nincs profilkép kiválasztva! Kérjük, kattintson a \"Fájl kiválasztása!\" lehetőségre és töltsön fel egy profilképet! \r\n";            }                if (error==0) {            $.post("admin/php/gyogyitok/php/register.php", {                email: email,                fullname: fullname,                password: pwd,                birthdate: bdate,                doctorID: $("#doctors").val(),                dsID: $("#diseaseID").val(),                picture: pic            }, function(xml) {                alertMessage(xml, "Regisztráció az oldalra", function() { $.mask().close(); });            });        } else {            alert(errorString);        }}function saveUserDatas() {            var userid = $("#userid").val();        var email = $("#email").val();        var fullname = $("#fullname").val();        var bdate = $("#birthdate").val();        var pwd = $("#pwd").val();        var pwd1 = $("#pwd1").val();        var pic = $("#userPicture").val();        var error = 0;        var errorString = "";                if ((pwd!=pwd1 || pwd.length<4) && pwd.length>0) {            error = 1;            errorString += "A megadott jelszavak nem egyeznek, vagy a megadott jelszó nincs meg legalább 5 karakter! \r\n";                         }                if (fullname.length<5) {            error = 1;            errorString += "A megadott név túl rövid! \r\n";         }                if (email.indexOf("@")<1 || email.length<4) {            error = 1;            errorString += "A megadott E-mail cím nem megfelelő! \r\n";        }                if (pic.length<4) {            error = 1;            errorString += "Nincs profilkép kiválasztva! Kérjük, kattintson a \"Fájl kiválasztása!\" lehetőségre és töltsön fel egy profilképet! \r\n";            }                if (userid==null) {            error = 1;            errorString += "Jogusultság hiba! Kérjük lépjen ki, és be újra! \r\n";        }                if (error==0) {            $.post("admin/php/gyogyitok/php/register.php", {                userid: userid,                email: email,                fullname: fullname,                password: pwd,                birthdate: bdate,                picture: pic,                doctorID: $("#doctors").val(),                dsID: $("#diseaseID").val()            }, function(xml) {                alertMessage(xml, "Adatok módosítása");            });        } else {            alert(errorString);        }}/* jCrop with ajax file upload */function ajaxFileUpload(num){	$("#loading")	.ajaxStart(function(){		$(this).show();	})	.ajaxComplete(function(){		$(this).hide();	});		$.ajaxFileUpload	(		{			url:'/admin/php/gyogyitok/php/uploadpic.php?num='+num,			secureuri:false,			fileElementId:'fileToUpload'+num,			dataType: 'json',			success: function (data, status)			{				if(typeof(data.error) != 'undefined')				{					if(data.error != '')					{						alert(data.error);					}else					{						if (!document.getElementById("CB_diag")) {							$("#Wrapper").append("<div id=\"CB_diag\"></div>");						}																		//$("#CB_diag").html("<><>");						var height_b = $(window).height()-100;						var width_b = $(window).width()-100;												$("#CB_diag").load("/admin/php/gyogyitok/php/crop.php?fn="+data.msg).dialog({							modal: true,							autoOpen: true,							width: width_b,							height:  height_b,							buttons: {								"OK": function() {																		checkCoords();																		$(this).dialog("close");								}							}						});                                                $(".ui-dialog").css("zIndex", 399900);                        $(".ui-widget-overlay").css("zIndex", 399000);                        					}				}			},			error: function (data, status, e)			{				alert(e);			}		}	)		return false;	}        function ajaxFileUpload_v2(num)	{				$.ajaxFileUpload		(			{				url:'/admin/php/gyogyitok/php/uploadpic_v2.php?num='+num,				secureuri:false,				fileElementId:'fileToUpload'+num,				MAX_FILE_SIZE: 1000000,				dataType: 'json',				success: function (data, status)				{					if(typeof(data.error) != 'undefined')					{						if(data.error != '')						{							errorMessage(data.error);						}else						{													if (!document.getElementById("CB_diag")) {								$("#Wrapper").append("<div id=\"CB_diag\"></div>");							}																					//$("#CB_diag").html("<><>");							var height_b = $(window).height()-100;							var width_b = $(window).width()-100;														$("#CB_diag").load("/admin/php/gyogyitok/php/crop.php?fn="+data.msg).dialog({								modal: true,								autoOpen: true,								width: width_b,								height:  height_b,								buttons: {									"OK": function() {																				$("#kep"+num).val(data.msg);                                        										alertMessage("<font color='red'><a href=\""+data.msg+"\" target=\"_blank\" style=\"color: #c00; font-weight: bold;\">A kép sikeresen meg lett vágva!</a></font>", "Üzenet az oldalról");                                                                                $("#okicon"+num).html("<br /><h4 class=\"picInform\" style=\"color: red;\">Kép megvágva! <br /><br />Adjon egy rövid leírást a képnek, majd kattintson a <u>\"Fotó feltöltése\"</u> gombra!</h4>");                                                                                $("#picUpBtn, #picname").css({                                           color: "#cc0000",                                           border: "1px solid #c00"                                         });                                        										checkCoords();																				$(this).dialog("close");									}								}							});						}					}				},				error: function (data, status, e)				{					alert(e);				}			}		)				return false;			}	function ajaxFileUpload_MW(num)	{		$("#loading")		.ajaxStart(function(){			$(this).show();		})		.ajaxComplete(function(){			$(this).hide();		});    				$.ajaxFileUpload		(			{				url:'/admin/php/gyogyitok/php/uploadpic.php?num='+num,				secureuri:false,				fileElementId:'fileToUpload'+num,				dataType: 'json',				success: function (data, status)				{					if(typeof(data.error) != 'undefined')					{						if(data.error != '')						{							errorMessage(data.error);						}else						{							if (!document.getElementById("CB_diag")) {								$("#Wrapper").append("<div id=\"CB_diag\"></div>");							}																					//$("#CB_diag").html("<><>");							var height_b = $(window).height()-100;							var width_b = $(window).width()-100;														$("#CB_diag").load("/admin/php/gyogyitok/php/crop.php?fn="+data.msg).dialog({								modal: true,								autoOpen: true,								width: width_b,								height:  height_b,								buttons: {									"OK": function() {																				checkCoords();																				$(this).dialog("close");									}								}							});                                                        $(".ui-dialog").css("zIndex", 399900);                            $(".ui-widget-overlay").css("zIndex", 399000);                            						}					}				},				error: function (data, status, e)				{					alert(e);				}			}		)				return false;			}     function needReg() {    errorMessage("A funkció használatához Regisztráció szükséges!"); }  	function htmlspecialchars(ch) {ch = ch.replace(/&/g,"&amp;");ch = ch.replace(/\"/g,"&quot;");ch = ch.replace(/\'/g,"&#039;");ch = ch.replace(/</g,"&lt;");ch = ch.replace(/>/g,"&gt;");return ch;}function htmlspecialchars_decode(ch) {ch = ch.replace(/&amp;/g,"&");ch = ch.replace(/&quot;/g,"\"");ch = ch.replace(/&#039;/g,"\'");ch = ch.replace(/&lt;/g,"<");ch = ch.replace(/&gt;/g,">");return ch;}function htmlspecialchars_v1(ch) {	ch = ch.replace(/&/g,"&amp;");	ch = ch.replace(/\"/g,"&quot;");	ch = ch.replace(/\'/g,"&#039;");	ch = ch.replace(/</g,"&lt;");	ch = ch.replace(/>/g,"&gt;");	ch = ch.replace(/é/g,"&eacute;");	ch = ch.replace(/á/g,"&aacute;");	ch = ch.replace(/ó/g,"&oacute;");	ch = ch.replace(/ő/g,"&#337;");	ch = ch.replace(/ú/g,"&uacute;");	ch = ch.replace(/í/g,"&iacute;");	ch = ch.replace(/ű/g,"&#369;");	ch = ch.replace(/ü/g,"&uuml;");	ch = ch.replace(/ö/g,"&ouml;");	ch = ch.replace(/É/g,"&Eacute;");	ch = ch.replace(/Á/g,"&Aacute;");	ch = ch.replace(/Ó/g,"&Oacute;");	ch = ch.replace(/Ú/g,"&Uacute;");	ch = ch.replace(/Í/g,"&Iacute;");	ch = ch.replace(/Ü/g,"&Uuml;");	ch = ch.replace(/Ö/g,"&Ouml;");	ch = ch.replace(/Ő/g,"&#336;");	ch = ch.replace(/Ű/g,"&#368;");	return ch;}function htmlspecialchars_decode_v1(ch) {	ch = ch.replace(/&amp;/g,"&");	ch = ch.replace(/&quot;/g,"\"");	ch = ch.replace(/&#039;/g,"\'");	ch = ch.replace(/&lt;/g,"<");	ch = ch.replace(/&gt;/g,">");	ch = ch.replace(/&eacute;/g,"é");	ch = ch.replace(/&aacute;/g,"á");	ch = ch.replace(/&oacute;/g,"ó");	ch = ch.replace(/&uacute;/g,"ú");	ch = ch.replace(/&iacute;/g, "í");	ch = ch.replace(/&#369;/g, "ű");	ch = ch.replace(/&uuml;/g, "ü");	ch = ch.replace(/&ouml;/g, "ö");	ch = ch.replace(/&#337;/g,"ő");	ch = ch.replace(/&Eacute;/g,"É");	ch = ch.replace(/&Aacute;/g, "Á");	ch = ch.replace(/&Oacute;/g, "Ó");	ch = ch.replace(/&Uacute;/g, "Ú");	ch = ch.replace(/&Iacute;/g, "Í");	ch = ch.replace(/&Uuml;/g, "Ü");	ch = ch.replace(/&Ouml;/g, "Ö");	ch = ch.replace(/&#336;/g,"Ő");	ch = ch.replace(/&#368;/g, "Ű");	return ch;}function forgotpwd() {    if (!document.getElementById("forgotDiag")) {    	$("#Wrapper").append("<div id=\"forgotDiag\" />");    }        $("#forgotDiag").html("<br /> <b>Kérjük adja meg e-mail címét amivel a rendszerbe regisztrált! </b><br /><div id=\"ajax\"></div><br /> <input type=\"text\" id=\"forgotEmail\" class=\"ui-widget ui-input ui-state-active ui-corner-all ui-helper-clearfix\" style=\"width: 98%; padding: 2px;\" name=\"mail\" /><br /> <div class=\"ui-widget ui-state-highlight ui-corner-all ui-helper-clearfix\" style=\"float: left; clear: both; width: 98%; padding: 3px;\">A megadott e-mail címre küldünk egy új jelszót, melyet később meg tud változtatni az oldalon történő belépés után, az \"Adataim\" menüponton keresztül!</div>");	        $("#forgotDiag").dialog({    	modal: true,        bgiframe: true,        autoOpen: true,    	width: 400,        height: 255,    	title: "Elfelejtett jelszó",    	buttons: {    		"Új jelszó küldése": function() {    				var mail = $("#forgotEmail").val();    				$.post("/admin/php/gyogyitok/php/forgotpwd.php", {    					email: mail    				}, function(xml) {    					$("#forgotDiag #ajax").html(xml);    					var timeOutID = setTimeout(function() { $("#forgotDiag").dialog("destroy"); }, 2000);    				});    			    		},    		"Mégse": function() {    			$(this).dialog("destroy");    		}    	}    });	$(".ui-dialog").css("zIndex", 399900);    $(".ui-widget-overlay").css("zIndex", 399000);}
