﻿function profcall(meth,newdata){
	switch (meth){
		case "set":
			jQuery.post("includes/content/userprof.php",{meth : meth}, function(data){
				jQuery("#window").html(data);
				jQuery("#window").show();
			});
			break;
		case "nevset":
			$.post("includes/content/userprof.php",{meth : meth}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#nevsetcancelbtn").click(function(){
						profcall("set");
					});
				$("#nevsetokbtn").click(function(){
						profcall("nevsetok",$("#nevtextbox").val());
					});
			});
			break;
		case "mailset":
			$.post("includes/content/userprof.php",{meth : meth}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#mailsetcancelbtn").click(function(){
						profcall("set");
					});
				$("#mailsetokbtn").click(function(){
						profcall("mailsetok",$("#mailtextbox").val());
					});
			});
			break;
		case "webset":
			$.post("includes/content/userprof.php",{meth : meth}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#websetcancelbtn").click(function(){
						profcall("set");
					});
				$("#websetokbtn").click(function(){
						profcall("websetok",$("#webtextbox").val());
					});
			});
			break;
		case "tarthelyset":
			$.post("includes/content/userprof.php",{meth : meth}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#tarthelysetcancelbtn").click(function(){
						profcall("set");
					});
				$("#tarthelysetokbtn").click(function(){
						profcall("tarthelysetok",$("#tarthelytextbox").val());
					});
			});
			break;
		case "msnset":
			$.post("includes/content/userprof.php",{meth : meth}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#msnsetcancelbtn").click(function(){
						profcall("set");
					});
				$("#msnsetokbtn").click(function(){
						profcall("msnsetok",$("#msntextbox").val());
					});
			});
			break;
		case "telset":
			$.post("includes/content/userprof.php",{meth : meth}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#telsetcancelbtn").click(function(){
						profcall("set");
					});
				$("#telsetokbtn").click(function(){
						profcall("telsetok",$("#teltextbox").val());
					});
			});
			break;
		case "nevsetok":
			$.post("includes/content/userprof.php",{meth : meth, newuser : newdata}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#mailsetbtn").click(function(){
						profcall("mailset");
					});
				$("#websetbtn").click(function(){
						profcall("webset");
					});
				$("#tarthelysetbtn").click(function(){
						profcall("tarthelyset");
					});
				$("#msnsetbtn").click(function(){
						profcall("msnset");
					});
				$("#telsetbtn").click(function(){
						profcall("telset");
					});
			});
			break;
		case "mailsetok":
			$.post("includes/content/userprof.php",{meth : meth, newmail : newdata}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#nevsetbtn").click(function(){
						profcall("nevset");
					});
				$("#mailsetbtn").click(function(){
						profcall("mailset");
					});
				$("#websetbtn").click(function(){
						profcall("webset");
					});
				$("#tarthelysetbtn").click(function(){
						profcall("tarthelyset");
					});			
				$("#msnsetbtn").click(function(){
						profcall("msnset");
					});
				$("#telsetbtn").click(function(){
						profcall("telset");
					});
			});
			break;
		case "websetok":
			$.post("includes/content/userprof.php",{meth : meth, webnew : newdata}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#nevsetbtn").click(function(){
						profcall("nevset");
					});
				$("#mailsetbtn").click(function(){
						profcall("mailset");
					});
				$("#websetbtn").click(function(){
						profcall("webset");
					});
				$("#tarthelysetbtn").click(function(){
						profcall("tarthelyset");
					});
				$("#msnsetbtn").click(function(){
						profcall("msnset");
					});
				$("#telsetbtn").click(function(){
						profcall("telset");
					});
			});
			break;
		case "tarthelysetok":
			$.post("includes/content/userprof.php",{meth : meth, newtart : newdata}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#nevsetbtn").click(function(){
						profcall("nevset");
					});
				$("#mailsetbtn").click(function(){
						profcall("mailset");
					});
				$("#websetbtn").click(function(){
						profcall("webset");
					});
				$("#tarthelysetbtn").click(function(){
						profcall("tarthelyset");
					});
				$("#msnsetbtn").click(function(){
						profcall("msnset");
					});			
				$("#telsetbtn").click(function(){
						profcall("telset");
					});
			});
			break;
		case "msnsetok":
			$.post("includes/content/userprof.php",{meth : meth, newmsn : newdata}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#nevsetbtn").click(function(){
						profcall("nevset");
					});
				$("#mailsetbtn").click(function(){
						profcall("mailset");
					});
				$("#websetbtn").click(function(){
						profcall("webset");
					});
				$("#tarthelysetbtn").click(function(){
						profcall("tarthelyset");
					});
				$("#msnsetbtn").click(function(){
						profcall("msnset");
					});
				$("#telsetbtn").click(function(){
						profcall("telset");
					});
			});
			break;
		case "telsetok":
			$.post("includes/content/userprof.php",{meth : meth, newtel : newdata}, function(data){
				$("#window").html(data);
				$("#window").show();
				$("#nevsetbtn").click(function(){
						profcall("nevset");
					});
				$("#mailsetbtn").click(function(){
						profcall("mailset");
					});
				$("#websetbtn").click(function(){
						profcall("webset");
					});
				$("#tarthelysetbtn").click(function(){
						profcall("tarthelyset");
					});
				$("#msnsetbtn").click(function(){
						profcall("msnset");
					});
				$("#telsetbtn").click(function(){
						profcall("telset");
					});
			});
			break;
	}
}
