var h_cargar_formulario_precios=function(tt){
	document.getElementById('calcular_precio').innerHTML =tt.responseText;
	document.getElementById("loading").style.display='none';
}

function cargar_formulario_precios(){
	document.getElementById("loading").style.display='inline';
	new Ajax.Request('formularioPrecios.php', {parameters:'',
												onSuccess:h_cargar_formulario_precios});
}

function seleccionTipoEnvio(){
	document.getElementById("loading").style.display='inline';
	new Ajax.Request('formularioPrecios.php', {parameters:{
															tipo_envio: document.getElementById("tipo_envio").value,
															peso:  document.getElementById("peso").value
															},
												onSuccess:h_cargar_formulario_precios});
}

function seleccionZonaDestino(){
	document.getElementById("loading").style.display='inline';
	new Ajax.Request('formularioPrecios.php', {parameters:{
															tipo_envio: document.getElementById("tipo_envio").value,
															zona: document.getElementById("zona").value,
															peso:  document.getElementById("peso").value
															},
												onSuccess:h_cargar_formulario_precios});
}

function seleccionPaisDestino(){
	document.getElementById("loading").style.display='inline';
	new Ajax.Request('formularioPrecios.php', {parameters:{
															tipo_envio: document.getElementById("tipo_envio").value,
															zona: document.getElementById("zona").value,
															pais: document.getElementById("pais").value,
															peso:  document.getElementById("peso").value
															},
												onSuccess:h_cargar_formulario_precios});
}

function calcularPrecio(){
	document.getElementById("loading").style.display='inline';
	new Ajax.Request('formularioPrecios.php', {parameters:{
															tipo_envio: document.getElementById("tipo_envio").value,
															zona: document.getElementById("zona").value,
															peso:  document.getElementById("peso").value
															},
												onSuccess:h_cargar_formulario_precios});
}

function inicio(){
	if(NiftyCheck()){
		Rounded("div#sidebar","#ffffff","#45589d");
		}

	cargar_formulario_precios();
	var e=document.getElementsByTagName("h2");
	for(var i=0;i<e.length;i++){
		if(e[i].parentNode.className=="post"
			|| e[i].parentNode.className=="narrowcolumn")
			new Effect.Morph(e[i], {
									style: {
											color: '#45589e'
											}, // CSS Properties
									duration: 2.0 // Core Effect properties
									});


		}
	
}