$(document).ready(function(){
	
	$('#regForm').submit(function(e) {

		register();
		e.preventDefault();
		
	});
	
	$('#regForm2').submit(function(e) {

		register2();
		e.preventDefault();
		
	});
	
	$('#regForm3').submit(function(e) {

		register3();
		e.preventDefault();
		
	});
	
	$('#regForm4').submit(function(e) {

		register4();
		e.preventDefault();
		
	});
	
	$('#regForm5').submit(function(e) {

		register5();
		e.preventDefault();
		
	});
	
	$('#regForm6').submit(function(e) {

		register6();
		e.preventDefault();
		
	});
	
	$('#regForm7').submit(function(e) {

		register7();
		e.preventDefault();
		
	});
	
	$('#regForm8').submit(function(e) {

		register8();
		e.preventDefault();
		
	});
	
	$('#regForm9').submit(function(e) {

		register9();
		e.preventDefault();
		
	});
	
	$('#regForm10').submit(function(e) {

		register10();
		e.preventDefault();
		
	});
	
	$('#regForm11').submit(function(e) {

		register11();
		e.preventDefault();
		
	});

	$('#regForm12').submit(function(e) {

		register12();
		e.preventDefault();
		
	});
	
	$('#regForm13').submit(function(e) {

		register13();
		e.preventDefault();
		
	});
	
	$('#regForm14').submit(function(e) {

		register14();
		e.preventDefault();
		
	});
	
	$('#regForm15').submit(function(e) {

		register15();
		e.preventDefault();
		
	});

	$('#regForm16').submit(function(e) {

		register16();
		e.preventDefault();
		
	});
	
$('#regForm17').submit(function(e) {

		register17();
		e.preventDefault();
		
	});

});


function register()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit.php",
		data: $('#regForm').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register2()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_mod.php",
		data: $('#regForm2').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register3()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_mod_pwd.php",
		data: $('#regForm3').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register4()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_ticket.php",
		data: $('#regForm4').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register5()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_ticket_reply.php",
		data: $('#regForm5').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register6()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_notify.php",
		data: $('#regForm6').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register7()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_ticket_reply_admin.php",
		data: $('#regForm7').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register8()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_ticket_admin_assign.php",
		data: $('#regForm8').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register9()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_dns.php",
		data: $('#regForm9').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register10()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_services_admin.php",
		data: $('#regForm10').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register11()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_dns_admin.php",
		data: $('#regForm11').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register12()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_shop.php",
		data: $('#regForm12').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register13()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_ips.php",
		data: $('#regForm13').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register14()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_billing.php",
		data: $('#regForm14').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register15()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/whois.php",
		data: $('#regForm15').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register16()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_datainsert.php",
		data: $('#regForm16').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}

function register17()
{
	hideshow('loading',1);
	error(0);
	
	$.ajax({
		type: "POST",
		url: "regform/submit_agenti.php",
		data: $('#regForm17').serialize(),
		dataType: "json",
		success: function(msg){
			
			if(parseInt(msg.status)==1)
			{
				window.location=msg.txt;
			}
			else if(parseInt(msg.status)==0)
			{
				error(1,msg.txt);
			}
			
			hideshow('loading',0);
		}
	});

}


function hideshow(el,act)
{
	if(act) $('#'+el).css('visibility','visible');
	else $('#'+el).css('visibility','hidden');
}

function error(act,txt)
{
	hideshow('error',act);
	if(txt) $('#error').html(txt);
}