/* 
Version: 2011/10/03
Author: Leonel Schaefer
Description:	
*/

/* Inicia as funcoes */
$(document).ready
(
	function()
	{
		/*comboFcEstado();*/
		comboMatEstado();
		comboTUnidades();
		comboCvUnidades();
	}
);


/* Combos do Fale Conosco */
function comboFcEstado()
{
	$.ajax(
		{
				type: "POST",
				url: "wp-content/themes/quatrum/comboEstado.php",
				data: "texto=1",
				beforeSend: function(){},
				success: function(txt)
				{
					$('#fc_estado').html(txt);
				},
				error: function(txt) 
				{ 
					alert('Desculpe, houve um erro interno.');
				}
			}
		);
}

function comboFcCidade(estado)
{
	$.ajax(
		{
				type: "POST",
				url: "wp-content/themes/quatrum/comboCidade.php",
				data: "pai=" + estado,
				beforeSend: function(){},
				success: function(txt)
				{
					$('#fc_cidade').html(txt);
				},
				error: function(txt) 
				{ 
					alert('Desculpe, houve um erro interno.');
				}
			}
		);
}


/* Combos da Matricula */
function comboMatEstado()
{
	$.ajax(
		{
				type: "POST",
				url: "wp-content/themes/quatrum/comboEstado.php",
				data: "texto=1",
				beforeSend: function(){},
				success: function(txt)
				{
					$('#mat_estado').html(txt);
				},
				error: function(txt) 
				{ 
					alert('Desculpe, houve um erro interno.');
				}
			}
		);
}

function comboMatCidade(estado)
{
	$.ajax(
		{
				type: "POST",
				url: "wp-content/themes/quatrum/comboCidade.php",
				data: "pai=" + estado,
				beforeSend: function(){},
				success: function(txt)
				{
					$('#mat_cidade').html(txt);
				},
				error: function(txt) 
				{ 
					alert('Desculpe, houve um erro interno.');
				}
			}
		);
}

function comboMatUnidade(cidade)
{
	$.ajax(
		{
				type: "POST",
				url: "wp-content/themes/quatrum/comboUnidade.php",
				data: "pai=" + cidade,
				beforeSend: function(){},
				success: function(txt)
				{
					$('#mat_unidade').html(txt);
				},
				error: function(txt) 
				{ 
					alert('Desculpe, houve um erro interno.');
				}
			}
		);
}




/* busca Unidades p/ Trabalhe Conosco */

/* Teachers */
function comboTUnidades()
{
	$.ajax(
		{
				type: "POST",
				url: "wp-content/themes/quatrum/comboListaUnidades.php",
				data: "pai=1",
				beforeSend: function(){},
				success: function(txt)
				{
					$('#t_escola').html(txt);
				},
				error: function(txt) 
				{ 
					alert('Desculpe, houve um erro interno.');
				}
			}
		);
}


/* Consultora de Venda */
function comboCvUnidades()
{
	$.ajax(
		{
				type: "POST",
				url: "wp-content/themes/quatrum/comboListaUnidades.php",
				data: "pai=1",
				beforeSend: function(){},
				success: function(txt)
				{
					$('#cv_escola').html(txt);
				},
				error: function(txt) 
				{ 
					alert('Desculpe, houve um erro interno.');
				}
			}
		);
}

