//***********************************************************************************
// Mediante json se invoca a un método público de la página de default.
//***********************************************************************************
function LanguageSpanish3()
{
	$.ajax
	({
		type: "POST",
		url: "/Default.aspx/ChangeLanguage",
		data: "{'culture':'es-ES'}",
		contentType: "application/json; charset=utf-8",
		dataType: "json",
		success: function(msg)
		{
			// Forzamos un postback
			__doPostBack("spanish");
		},
		error: function(msg) { alert("Error al seleccionar el lenguaje"); }
	});
}

// Cambia a Alemán
function LanguageDenmark ()
{
	$.ajax
	({
		type: "POST",
		url: "/Default.aspx/ChangeLanguage",
		data: "{'culture': 'de-DE'}",
		contentType: "application/json; charset=utf-8",
		dataType: "json",
		success: function(msg)
		{
			// Forzamos un postback
			__doPostBack("spanish");
			//alert("Cambiado el lenguaje a " + msg.d); 
		},
		error: function(msg) { alert("Error al seleccionar el lenguaje"); }
	});
}

// Cambia a Francés
function LanguageFrench()
{
	$.ajax
	({
		type: "POST",
		url: "/Default.aspx/ChangeLanguage",
		data: "{'culture':'fr-FR'}",
		contentType: "application/json; charset=utf-8",
		dataType: "json",
		success: function(msg)
		{
			__doPostBack("spanish");
			//alert("Cambiado el lenguaje a " + msg.d); 
		},
		error: function(msg) { alert("Error al seleccionar el lenguaje"); }
	});
}

// Cambia a inglés.
function LanguageEnglish()
{
	$.ajax
	({
		type: "POST",
		url: "/Default.aspx/ChangeLanguage",
		data: "{'culture':'en-GB'}",
		contentType: "application/json; charset=utf-8",
		dataType: "json",
		success: function(msg)
		{
			__doPostBack("spanish");
			//alert("Cambiado el lenguaje a " + msg.d); 
		},
		error: function(msg) { alert("Error al seleccionar el lenguaje"); }
	});
}

// Camba a árabe de marruecos
function LanguageArabian()
{
	$.ajax
	({
		type: "POST",
		url: "/Default.aspx/ChangeLanguage",
		data: "{'culture':'ar-MA'}",
		contentType: "application/json; charset=utf-8",
		dataType: "json",
		success: function(msg)
		{
			__doPostBack("spanish");
			//alert("Cambiado el lenguaje a " + msg.d); 
		},
		error: function(msg) { alert("Error al seleccionar el lenguaje"); }
	});
}

// Cambia a italiano
function LanguagePortugues ()
{
	$.ajax
	({
		type: "POST",
		url: "/Default.aspx/ChangeLanguage",
		data: "{'culture':'pt-PT'}",
		contentType: "application/json; charset=utf-8",
		dataType: "json",
		success: function(msg)
		{
			__doPostBack("spanish");
			//alert("Cambiado el lenguaje a " + msg.d); 
		},
		error: function(msg) { alert("Error al seleccionar el lenguaje"); }
	});
}

// Language Italian
function LanguageItalian()
{
	$.ajax
	({
		type: "POST",
		url: "/Default.aspx/ChangeLanguage",
		data: "{'culture':'it-IT'}",
		contentType: "application/json; charset=utf-8",
		dataType: "json",
		success: function(msg)
		{
			__doPostBack("spanish");
			//alert("Cambiado el lenguaje a " + msg.d); 
		},
		error: function(msg) { alert("Error al seleccionar el lenguaje"); }
	});
}



$(document).ready(function()
{
	// Add the page method call as an onclick handler for the Spanish flag image
	$("#spanish").click(function()
	{
		$.ajax({
			type: "POST",
			url: "Default.aspx/ChangeLanguage",
			data: "{'culture':'es-ES'}",
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			success: function(msg)
			{
				alert(msg.d);
			},
			error: function(msg) { alert("Error al seleccionar el lenguaje"); }
		});
	});
});


$(document).ready(function()
{
	// Add the page method call as an onclick handler for the denmark flag image.
	$("#germany").click(function()
	{
		$.ajax({
			type: "POST",
			url: "Default.aspx/ChangeLanguage",
			data: "{'culture':'de-DE'}",
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			success: function(msg)
			{
				alert(msg.d);
			},
			error: function(msg) { alert("Error al seleccionar el lenguaje"); }
		});
	});
});

$(document).ready(function()
{
	// Add the page method call as an onclick handler for the french flag image.
	$("#french").click(function()
	{
		$.ajax({
			type: "POST",
			url: "Default.aspx/ChangeLanguage",
			data: "{'culture':'fr-FR'}",
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			success: function(msg)
			{
				alert(msg.d);
			},
			error: function(msg) { alert("Error al seleccionar el lenguaje"); }
		});
	});
});

$(document).ready(function()
{
	// Add the page method call as an onclick handler for the english Great britain flag image.
	$("#english").click(function()
	{
		$.ajax({
			type: "POST",
			url: "Default.aspx/ChangeLanguage",
			data: "{'culture':'en-GB'}",
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			success: function(msg)
			{
				alert(msg.d);
			},
			error: function(msg) { alert("Error al seleccionar el lenguaje"); }
		});
	});
});

$(document).ready(function()
{
	// Add the page method call as an onclick handler for the arabian moroco flag image.
	$("#arabian").click(function()
	{
		$.ajax({
			type: "POST",
			url: "Default.aspx/ChangeLanguage",
			data: "{'culture':'ar-MA'}",
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			success: function(msg)
			{
				alert(msg.d);
			},
			error: function(msg) { alert("Error al seleccionar el lenguaje"); }
		});
	});
});

$(document).ready(function()
{
	// Add the page method call as an onclick handler for the portugues flag image.
	$("#portugues").click(function()
	{
		$.ajax({
			type: "POST",
			url: "Default.aspx/ChangeLanguage",
			data: "{'culture':'pt-PT'}",
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			success: function(msg)
			{
				alert(msg.d);
			},
			error: function(msg) { alert("Error al seleccionar el lenguaje"); }
		});
	});
});


$(document).ready(function()
{
	// Add the page method call as an onclick handler for the italian flag image.
	$("#italian").click(function()
	{
		$.ajax({
			type: "POST",
			url: "Default.aspx/ChangeLanguage",
			data: "{'culture':'it-IT'}",
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			success: function(msg)
			{
				alert(msg.d);
			},
			error: function(msg) { alert("Error al seleccionar el lenguaje"); }
		});
	});
});


