// JavaScript Document
function generateKey(L){
    var caracter="1234567890";
    var numero_caracteres=L;
    var total=caracter.length;
    var clave="";
    for(a=0;a<numero_caracteres;a++){
    clave+=caracter.charAt(parseInt(total*Math.random(1)));
    }
    return clave;
}
function activateContact(){
	//BUTTONS
	clear_btn = document.getElementById("clear");
	send_btn = document.getElementById("send");
	//FIELDS
	name_fld = document.getElementById("name");
	city_fld = document.getElementById("city");
	address_fld = document.getElementById("address");
	phone_fld = document.getElementById("phone");
	mail_fld = document.getElementById("mail");
	//TEXTAREAS
	comment_area_fld = document.getElementById("comment_area");
	//OPTIONS
	country_opc = document.getElementById("country_op");
	state_opc = document.getElementById("state_op");
	comment_opc = document.getElementById("comment_op");
	state_td = document.getElementById("state");
	
	
	//CLEAR FORM
	
	clear_btn.onclick = function(){
	//FIELDS
	name_fld = document.getElementById("name");
	city_fld = document.getElementById("city");
	address_fld = document.getElementById("address");
	phone_fld = document.getElementById("phone");
	mail_fld = document.getElementById("mail");
	//TEXTAREAS
	comment_area_fld = document.getElementById("comment_area");
	//OPTIONS
	country_opc = document.getElementById("country_op");
	state_opc = document.getElementById("state_op");
	comment_opc = document.getElementById("comment_op");
	state_td = document.getElementById("state");
		//CLEAR FIELDS
		name_fld.value = "";
		city_fld.value = "";
		address_fld.value = "";
		phone_fld.value = "";
		mail_fld.value = "";
		
		//CLEAR TEXTAREA
		comment_area_fld.value="";
		//CLEAR OPTIONS
		country_opc.value="";
		state_td.innerHTML = "<select id='state_op'><option>---</option></select>";
		comment_opc.value = "comment";
		}
		
		
	send_btn.onclick = function(){
	//FIELDS
	
	name_fld = document.getElementById("name");
	city_fld = document.getElementById("city");
	address_fld = document.getElementById("address");
	phone_fld = document.getElementById("phone");
	mail_fld = document.getElementById("mail");
	//TEXTAREAS
	comment_area_fld = document.getElementById("comment_area");
	//OPTIONS
	country_opc = document.getElementById("country_op");
	state_opc = document.getElementById("state_op");
	comment_opc = document.getElementById("comment_op");
	state_td = document.getElementById("state");
	
		//CLEAR FIELDS
		error= false;
		if(name_fld.value == ""|| city_fld.value == "" || address_fld.value == "" || phone_fld.value == "" || mail_fld.value == "" || country_opc.value==""){
			if(LANGUAGE=="es"){
				alert("Error: porfavor, introduzca toda la información solicitada");
			}
			if(LANGUAGE=="en"){
				alert("Error: please fill all the information");
			}
			
			error = true;
			}else{
					if(mail_fld.value.indexOf("@")>=0 && mail_fld.value.lastIndexOf(".")>mail_fld.value.indexOf("@")){	
					}else{
						if(LANGUAGE=="es"){
						alert("Error: porfavor escribe un e-mail válido");
						}
						if(LANGUAGE=="en"){
						alert("Error: please type a correct e-mail");
						}
					error = true;
					}
					if(comment_area_fld.value == "" || comment_area_fld.value == " "){
						if(LANGUAGE=="es"){
						alert("Error: porfavor escribe tus comentarios en el área de comentarios");
						}
						if(LANGUAGE=="en"){
						alert("Error: please write your comments in the comment area");
						}
					error = true;
					}
				}
		
		/*if(comment_area_fld.value == "" || comment_area_fld.value == " " indexOf(){
		alert("Error: please write your comments in the comment area");
		error = true;
		}*/
		//alert(mail_fld.value.indexOf("@"));
		
			
		if(!error){
		  query ="form=contacto"+"&name_fld="+name_fld.value+"&city_fld="+city_fld.value+"&address_fld="+address_fld.value+"&phone_fld="+phone_fld.value+"&mail_fld="+mail_fld.value+"&comment_area_fld="+comment_area_fld.value+"&country_opc="+country_opc.value+"&state_opc="+state_opc.value+"&comment_opc="+comment_opc.value;
			
			var sendData = new net.CargadorContenidos("sendform.php",dataSentMSG,query);
			
			}	
		
		}
	function dataSentMSG(){
						if(LANGUAGE=="es"){
						alert("tu mensaje se ha enviado correctamente, pronto nos comunicaremos. gracias!");
						}
						if(LANGUAGE=="en"){
						alert("your message has been sent correctly, we will contact yo soon. thank you!");
						}
		}

}




/////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
function activateBirth(option){
	//paypal
	paypal_btn = document.getElementById("paypal_img");	
	form_pay = document.getElementById("paypal_form");
	form_msg = document.getElementById("form_tbl");	
	
	form_pay.style.visibility="hidden";
	//COMPRAR

	//BUTTONS
	clear_btn = document.getElementById("clear");
	send_btn = document.getElementById("send");
	//FIELDS
	name_fld = document.getElementById("name");
	middle_fld = document.getElementById("middle");
	last_fld = document.getElementById("last");
	bplace_fld = document.getElementById("birth_place");
	father_n_fld = document.getElementById("father_n");
	mother_n_fld = document.getElementById("mother_n");
	m_name_fld = document.getElementById("m_name");
	m_last_fld = document.getElementById("m_last");
	address_fld = document.getElementById("address");
	zip_fld = document.getElementById("zip");
	city_fld = document.getElementById("city");
	phone_fld = document.getElementById("phone");
	celphone_fld = document.getElementById("celphone");
	mail_fld = document.getElementById("mail");
	//TEXTAREAS
	comment_area_fld = document.getElementById("comment_area");
	//OPTIONS
	month_opc = document.getElementById("month");
	day_opc = document.getElementById("day");
	year_opc = document.getElementById("year");
	state_opc = document.getElementById("state_op");
	requestor_opc = document.getElementById("requestor");
	state2_opc = document.getElementById("state_op2");
	copies_opc = document.getElementById("copies");	
	//CHECKBOX
	translation_chk = document.getElementById("translation");
	apostille_chk = document.getElementById("apostille");
	express_chk = document.getElementById("express");
	country_fld = document.getElementById("country");
	//CLEAR FORM	
	clear_btn.onclick = function(){
		//CLEAR FIELDS
		name_fld.value = "";
		middle_fld.value = "";
		last_fld.value = "";
		bplace_fld.value = "";
		father_n_fld.value = "";
		mother_n_fld.value = "";
		m_name_fld.value = "";
		m_last_fld.value = "";
		address_fld.value = "";
		zip_fld.value = "";
		city_fld.value = "";
		phone_fld.value ="";
		celphone_fld.value = "";
		mail_fld.value = "";		
		//CLEAR TEXTAREA
		comment_area_fld.value="";
		//CLEAR OPTIONS
		month_opc.value = "month";
		day_opc.value = "day";
		year_opc.value = "year";
		state_opc.value = "select";
		requestor_opc.value = "select";
		state2_opc.value = "select";
		copies_opc.value = "select";	
		
		translation_chk.checked = false;
		apostille_chk.checked = false;
		}
		
		//comprar
		
	send_btn.onclick = function(){
		error= false;
		state2_opc = document.getElementById("state_op2");
//try{
		if(name_fld.value == ""|| middle_fld.value == "" || last_fld.value == "" || bplace_fld.value == "" || father_n_fld.value == "" || mother_n_fld.value=="" || m_name_fld.value =="" || m_last_fld.value == "" || address_fld.value == ""|| zip_fld.value == ""|| city_fld.value == "" || phone_fld.value ==""||  celphone_fld.value == "" || mail_fld.value == "" || month_opc.value == "month" || day_opc.value == "day" || year_opc.value == "year" || state_opc.value == "select" || requestor_opc.value == "select" || state2_opc.value == "select"){
			if(LANGUAGE=="es"){
				alert("Error: porfavor, introduzca toda la información solicitada");
			}
			if(LANGUAGE=="en"){
				alert("Error: please fill all the information");
			}
			
			error = true;
			}else{
					if(zip_fld.value.length==5){
						for(i=0; i<zip_fld.value.length; i++){
							if(zip_fld.value.charAt(i)>="0" && zip_fld.value.charAt(i)<="9"){
								}else{
									
									error = true;
									}
							}
							if(error){
								if(LANGUAGE=="es"){
									alert("Error: el codigo postal es inválido");
									}
									if(LANGUAGE=="en"){
									alert("Error: the zip code is invalid");
									}
								}
						}else{
									if(LANGUAGE=="es"){
									alert("Error: el codigo postal es inválido");
									}
									if(LANGUAGE=="en"){
									alert("Error: the zip code is invalid");
									}
							error = true;
							}
					if(mail_fld.value.indexOf("@")>=0 && mail_fld.value.lastIndexOf(".")>mail_fld.value.indexOf("@")){	
					}else{
						if(LANGUAGE=="es"){
						alert("Error: porfavor escribe un e-mail válido");
						}
						if(LANGUAGE=="en"){
						alert("Error: please type a correct e-mail");
						}
					error = true;
					}
				}
			
		if(!error){
						if(LANGUAGE=="es"){
						confirm_value = confirm("¿desea enviar su solicitud?");
						}
						if(LANGUAGE=="en"){
						confirm_value = confirm("send your request?");

						}
			if(confirm_value){
		  query ="form="+option+"&name_fld="+name_fld.value+"&middle_fld="+middle_fld.value+"&last_fld="+last_fld.value+"&bplace_fld="+bplace_fld.value+"&father_n_fld="+father_n_fld.value+"&mother_n_fld="+mother_n_fld.value+"&m_name_fld="+m_name_fld.value+"&m_last_fld="+m_last_fld.value+"&address_fld="+address_fld.value+"&zip_fld="+zip_fld.value+"&city_fld="+city_fld.value+"&phone_fld="+phone_fld.value+"&celphone_fld="+celphone_fld.value+"&mail_fld="+mail_fld.value+"&comment_area_fld="+comment_area_fld.value+"&month_opc="+month_opc.options[month_opc.selectedIndex].text+"&day_opc="+day_opc.options[day_opc.selectedIndex].text+"&year_opc="+year_opc.value+"&state_opc="+state_opc.options[state_opc.selectedIndex].text+"&requestor_opc="+requestor_opc.options[requestor_opc.selectedIndex].text+"&state2_opc="+state2_opc.options[state2_opc.selectedIndex].text+"&copies_opc="+copies_opc.options[copies_opc.selectedIndex].text+"&country_fld="+country_fld.value;
			   query+="&translation="+translation_chk.value;
			    query+="&apostille="+apostille_chk.value;
				  order_no = generateKey(5);
				  query+="&order_no="+order_no;
					var sendData = new net.CargadorContenidos("sendform.php",dataSentMSG,query);
					}
			}
/*}catch(e){
	alert(e);
	}*/
}
				
				function dataSentMSG(){
						if(LANGUAGE=="es"){
						alert("tu mensaje se ha enviado correctamente, Número de orden: "+order_no+", pronto nos comunicaremos. gracias! (asegurate de confirmar tu pago en la siguiente ventana)");
						}
						if(LANGUAGE=="en"){
						alert("your message has been sent correctly, Order Number: "+order_no+", we will contact yo soon. thank you! (make sure to confirm your pay on the next window)");
						}
						
						form_pay.style.visibility="visible";
						
						
						
						paypal_btn = document.getElementById("paypal_img");
					if(option == "birth"){
						if(LANGUAGE == "en"){final_msg="Birth Certificate"}
						if(LANGUAGE == "es"){final_msg="Certificado de Nacimiento"}
					}
					if(option == "death"){
						if(LANGUAGE == "en"){final_msg="Death Certificate"}
						if(LANGUAGE == "es"){final_msg="Certificado de Defunción"}
					}
					//GENERATE ORDER NUMBER
					if(LANGUAGE == "en"){final_msg+= ", Order Number: "+order_no;}
					if(LANGUAGE == "es"){final_msg+= ", Número de Pedído: "+order_no;}
					
					//cert price
					cert_price_txt=(country_fld.value == "MX")?650:59.99;
					add_copies_txt=0;
					apostille_txt=0;
					translation_txt = 0;
					if(copies_opc.options[copies_opc.selectedIndex].text != "no"){
					add_copies_txt+=(country_fld.value == "MX")?copies_opc.options[copies_opc.selectedIndex].text*150
													:copies_opc.options[copies_opc.selectedIndex].text*29;
					if(copies_opc.options[copies_opc.selectedIndex].text==1){
						if(LANGUAGE == "en"){final_msg+= ", "+copies_opc.options[copies_opc.selectedIndex].text+" copy";}
						if(LANGUAGE == "es"){final_msg+= ", "+copies_opc.options[copies_opc.selectedIndex].text+" copia";}
					}else{
						if(LANGUAGE == "en"){final_msg+= ", "+copies_opc.options[copies_opc.selectedIndex].text+" copies";}
						if(LANGUAGE == "es"){final_msg+= ", "+copies_opc.options[copies_opc.selectedIndex].text+" copias";}
					}		
					}
					
					if(translation_chk.options[translation_chk.selectedIndex].text != "no"){
					translation_txt+=(country_fld.value == "MX")?translation_chk.options[translation_chk.selectedIndex].text*350
													 :translation_chk.options[translation_chk.selectedIndex].text*39;
					if(translation_chk.options[translation_chk.selectedIndex].text==1){
						if(LANGUAGE == "en"){final_msg+= ", "+translation_chk.options[translation_chk.selectedIndex].text+" translation";}
						if(LANGUAGE == "es"){final_msg+= ", "+translation_chk.options[translation_chk.selectedIndex].text+" traducción";}
					}else{
						if(LANGUAGE == "en"){final_msg+= ", "+translation_chk.options[translation_chk.selectedIndex].text+" translations";}
						if(LANGUAGE == "es"){final_msg+= ", "+translation_chk.options[translation_chk.selectedIndex].text+" traducciones";}
					}		
					}
					if(apostille_chk.options[apostille_chk.selectedIndex].text != "no"){
					apostille_txt+=(country_fld.value == "MX")?apostille_chk.options[apostille_chk.selectedIndex].text*1000
												  			 :apostille_chk.options[apostille_chk.selectedIndex].text*79;
					if(apostille_chk.options[apostille_chk.selectedIndex].text==1){
						if(LANGUAGE == "en"){final_msg+= ", "+apostille_chk.options[apostille_chk.selectedIndex].text+" apostille";}
						if(LANGUAGE == "es"){final_msg+= ", "+apostille_chk.options[apostille_chk.selectedIndex].text+" apostille";}
					}else{
						if(LANGUAGE == "en"){final_msg+= ", "+apostille_chk.options[apostille_chk.selectedIndex].text+" apostilles";}
						if(LANGUAGE == "es"){final_msg+= ", "+apostille_chk.options[apostille_chk.selectedIndex].text+" apostilles";}
					}		
					}
					if(express_chk.checked){
						cert_price_txt = (country_fld.value == "MX")?1000:99.99;
						if(LANGUAGE == "en"){final_msg +=" (Express Service)";}
						if(LANGUAGE == "es"){final_msg+= " (Servicio Express)";}
						
					}
					total_price = cert_price_txt+add_copies_txt+apostille_txt+translation_txt;
						
						
						
						if(country_fld.value == "MX")
						{
							document.getElementById("currency_code").setAttribute("value","MXN");
						}else{
							total_price += 39.01;
							document.getElementById("currency_code").setAttribute("value","USD");
						}
						
						document.getElementById("total_price").setAttribute("value",total_price);
						if(LANGUAGE == "es")
						{
							//document.getElementById("currency_code").setAttribute("value","MXN");
							document.getElementById("item_name").setAttribute("value",final_msg+" + ENVIÓ POR MENSAJERÍA RÁPIDA");
						}else{
							document.getElementById("item_name").setAttribute("value",final_msg+" + SHIPPING AND HANDLING");
						}
						document.getElementById("item_number").setAttribute("value",m_name_fld.value+" "+m_last_fld.value);
						form_msg.parentNode.removeChild(form_msg);
						}
		

}




/////////////////////////////////////////////////////////////////////
function activateMarriage(option){
		//paypal
	paypal_btn = document.getElementById("paypal_img");	
	form_pay = document.getElementById("paypal_form");
	form_msg = document.getElementById("form_tbl");	
	
	form_pay.style.visibility="hidden";
	//BUTTONS
	clear_btn = document.getElementById("clear");
	send_btn = document.getElementById("send");
	//FIELDS
	h_name_fld = document.getElementById("husband_name");
	h_middle_fld = document.getElementById("husband_middle");
	h_last_fld = document.getElementById("husband_last");
	w_name_fld = document.getElementById("wife_name");
	w_middle_fld = document.getElementById("wife_middle");
	w_last_fld = document.getElementById("wife_last");
	mplace_fld = document.getElementById("marriage_place");
	m_name_fld = document.getElementById("m_name");
	m_last_fld = document.getElementById("m_last");
	address_fld = document.getElementById("address");
	zip_fld = document.getElementById("zip");
	city_fld = document.getElementById("city");
	phone_fld = document.getElementById("phone");
	celphone_fld = document.getElementById("celphone");
	mail_fld = document.getElementById("mail");
	//TEXTAREAS
	comment_area_fld = document.getElementById("comment_area");
	//OPTIONS
	month_opc = document.getElementById("month");
	day_opc = document.getElementById("day");
	year_opc = document.getElementById("year");
	state_opc = document.getElementById("state_op");
	requestor_opc = document.getElementById("requestor");
	state2_opc = document.getElementById("state_op2");	
		
	copies_opc = document.getElementById("copies");	
	//CHECKBOX
	translation_chk = document.getElementById("translation");
	apostille_chk = document.getElementById("apostille");
	express_chk = document.getElementById("express");
	country_fld = document.getElementById("country");
	
	//CLEAR FORM	
	clear_btn.onclick = function(){
		//CLEAR FIELDS
		h_name_fld.value = "";
		h_middle_fld.value = "";
		h_last_fld.value = "";
	    w_name_fld.value = "";
		w_middle_fld.value = "";
		w_last_fld.value = "";
		mplace_fld.value = "";
		m_name_fld.value = "";
		m_last_fld.value = "";
		address_fld.value = "";
		zip_fld.value = "";
		city_fld.value = "";
		phone_fld.value ="";
		celphone_fld.value = "";
		mail_fld.value = "";		
		//CLEAR TEXTAREA
		comment_area_fld.value="";
		//CLEAR OPTIONS
		month_opc.value = "month";
		day_opc.value = "day";
		year_opc.value = "year";
		state_opc.value = "select";
		requestor_opc.value = "select";
		state2_opc.value = "select";
		copies_opc.value = "select";	
		
		translation_chk.checked = false;
		apostille_chk.checked = false;
		}
		
		
	send_btn.onclick = function(){
		error= false;
		state2_opc = document.getElementById("state_op2");	
//try{
		if(h_name_fld.value == ""|| h_middle_fld.value == "" || h_last_fld.value == "" || mplace_fld.value == "" || w_name_fld.value == "" || w_middle_fld=="" || w_last_fld.value=="" || m_name_fld.value =="" || m_last_fld.value == "" || address_fld.value == ""|| zip_fld.value == ""|| city_fld.value == "" || phone_fld.value ==""||  celphone_fld.value == "" || mail_fld.value == "" || month_opc.value == "month" || day_opc.value == "day" || year_opc.value == "year" || state_opc.value == "select" || requestor_opc.value == "select" || state2_opc.value == "select"){
			if(LANGUAGE=="es"){
				alert("Error: porfavor, introduzca toda la información solicitada");
			}
			if(LANGUAGE=="en"){
				alert("Error: please fill all the information");
				
			}
			
			error = true;
			}else{
					if(zip_fld.value.length==5){
						for(i=0; i<zip_fld.value.length; i++){
							if(zip_fld.value.charAt(i)>="0" && zip_fld.value.charAt(i)<="9"){
								}else{
									
									error = true;
									}
							}
							if(error){
								if(LANGUAGE=="es"){
									alert("Error: el codigo postal es inválido");
									}
									if(LANGUAGE=="en"){
									alert("Error: the zip code is invalid");
									}
								}
						}else{
									if(LANGUAGE=="es"){
									alert("Error: el codigo postal es inválido");
									}
									if(LANGUAGE=="en"){
									alert("Error: the zip code is invalid");
									}
							error = true;
							}
					if(mail_fld.value.indexOf("@")>=0 && mail_fld.value.lastIndexOf(".")>mail_fld.value.indexOf("@")){	
					}else{
						if(LANGUAGE=="es"){
						alert("Error: porfavor escribe un e-mail válido");
						}
						if(LANGUAGE=="en"){
						alert("Error: please type a correct e-mail");
						}
					error = true;
					}
				}
			
		if(!error){
						if(LANGUAGE=="es"){
						confirm_value = confirm("¿desea enviar su solicitud?");
						}
						if(LANGUAGE=="en"){
						confirm_value = confirm("send your request?");

						}
			if(confirm_value){
		  query ="form="+option+"&h_name_fld="+h_name_fld.value+"&h_middle_fld="+h_middle_fld.value+"&h_last_fld="+h_last_fld.value+"&w_name_fld="+w_name_fld.value+"&w_middle_fld="+w_middle_fld.value+"&w_last_fld="+w_last_fld.value+"&mplace_fld="+mplace_fld.value+"&m_name_fld="+m_name_fld.value+"&m_last_fld="+m_last_fld.value+"&address_fld="+address_fld.value+"&zip_fld="+zip_fld.value+"&city_fld="+city_fld.value+"&phone_fld="+phone_fld.value+"&celphone_fld="+celphone_fld.value+"&mail_fld="+mail_fld.value+"&comment_area_fld="+comment_area_fld.value+"&month_opc="+month_opc.options[month_opc.selectedIndex].text+"&day_opc="+day_opc.options[day_opc.selectedIndex].text+"&year_opc="+year_opc.value+"&state_opc="+state_opc.options[state_opc.selectedIndex].text+"&requestor_opc="+requestor_opc.options[requestor_opc.selectedIndex].text+"&state2_opc="+state2_opc.options[state2_opc.selectedIndex].text+"&copies_opc="+copies_opc.options[copies_opc.selectedIndex].text+"&country_fld="+country_fld.value;
			   if(translation_chk.checked){query+="&translation=yes"}else{query+="&translation=no"};
				  if(apostille_chk.checked){query+="&apostille=yes"}else{query+="&apostille=no"};
				  order_no = generateKey(5);
				  query+="&order_no="+order_no;
					var sendData = new net.CargadorContenidos("sendform.php",dataSentMSG,query);
					}
		}
/*}catch(e){
	alert(e);
	}*/
}
				
				function dataSentMSG(){
					if(LANGUAGE=="es"){
						alert("tu mensaje se ha enviado correctamente, Número de orden: "+order_no+", pronto nos comunicaremos. gracias! (asegurate de confirmar tu pago en la siguiente ventana)");
						}
						if(LANGUAGE=="en"){
						alert("your message has been sent correctly, Order Number: "+order_no+", we will contact yo soon. thank you! (make sure to confirm your pay on the next window)");
						}
						
						form_pay.style.visibility="visible";
						
						
						
						paypal_btn = document.getElementById("paypal_img");
					if(option == "marriage"){
						if(LANGUAGE == "en"){final_msg="Marriage Certificate"}
						if(LANGUAGE == "es"){final_msg="Certificado de Matrimonio"}
					}
					if(option == "divorce"){
						if(LANGUAGE == "en"){final_msg="Divorce Certificate"}
						if(LANGUAGE == "es"){final_msg="Certificado de Divorcio"}
					}
					
					//GENERATE ORDER NUMBER
					if(LANGUAGE == "en"){final_msg+= ", Order Number: "+order_no;}
					if(LANGUAGE == "es"){final_msg+= ", Número de Pedído: "+order_no;}
					cert_price_txt=(country_fld.value == "MX")?650:59.99;
					add_copies_txt=0;
					apostille_txt=0;
					translation_txt = 0;
					if(copies_opc.options[copies_opc.selectedIndex].text != "no"){
					add_copies_txt+=(country_fld.value == "MX")?copies_opc.options[copies_opc.selectedIndex].text*150
													:copies_opc.options[copies_opc.selectedIndex].text*29;
					if(copies_opc.options[copies_opc.selectedIndex].text==1){
						if(LANGUAGE == "en"){final_msg+= ", "+copies_opc.options[copies_opc.selectedIndex].text+" copy";}
						if(LANGUAGE == "es"){final_msg+= ", "+copies_opc.options[copies_opc.selectedIndex].text+" copia";}
					}else{
						if(LANGUAGE == "en"){final_msg+= ", "+copies_opc.options[copies_opc.selectedIndex].text+" copies";}
						if(LANGUAGE == "es"){final_msg+= ", "+copies_opc.options[copies_opc.selectedIndex].text+" copias";}
					}		
					}
					if(translation_chk.options[translation_chk.selectedIndex].text != "no"){
					translation_txt+=(country_fld.value == "MX")?translation_chk.options[translation_chk.selectedIndex].text*350
													 :translation_chk.options[translation_chk.selectedIndex].text*39;
					if(translation_chk.options[translation_chk.selectedIndex].text==1){
						if(LANGUAGE == "en"){final_msg+= ", "+translation_chk.options[translation_chk.selectedIndex].text+" translation";}
						if(LANGUAGE == "es"){final_msg+= ", "+translation_chk.options[translation_chk.selectedIndex].text+" traducción";}
					}else{
						if(LANGUAGE == "en"){final_msg+= ", "+translation_chk.options[translation_chk.selectedIndex].text+" translations";}
						if(LANGUAGE == "es"){final_msg+= ", "+translation_chk.options[translation_chk.selectedIndex].text+" traducciones";}
					}		
					}
					if(apostille_chk.options[apostille_chk.selectedIndex].text != "no"){
					apostille_txt+=(country_fld.value == "MX")?apostille_chk.options[apostille_chk.selectedIndex].text*1000
												   :apostille_chk.options[apostille_chk.selectedIndex].text*79;
					if(apostille_chk.options[apostille_chk.selectedIndex].text==1){
						if(LANGUAGE == "en"){final_msg+= ", "+apostille_chk.options[apostille_chk.selectedIndex].text+" apostille";}
						if(LANGUAGE == "es"){final_msg+= ", "+apostille_chk.options[apostille_chk.selectedIndex].text+" apostille";}
					}else{
						if(LANGUAGE == "en"){final_msg+= ", "+apostille_chk.options[apostille_chk.selectedIndex].text+" apostilles";}
						if(LANGUAGE == "es"){final_msg+= ", "+apostille_chk.options[apostille_chk.selectedIndex].text+" apostilles";}
					}		
					}
					if(express_chk.checked){
						cert_price_txt = (country_fld.value == "MX")?1000:99.99;
						if(LANGUAGE == "en"){final_msg +=" (Express Service)";}
						if(LANGUAGE == "es"){final_msg+= " (Servicio Express)";}
						
					}
					//DATOS PARA PAYPAL
					total_price = cert_price_txt+add_copies_txt+apostille_txt+translation_txt;
					
						if(country_fld.value == "MX")
						{
							document.getElementById("currency_code").setAttribute("value","MXN");
						}else{
							total_price += 39.01;
							document.getElementById("currency_code").setAttribute("value","USD");
						}

						document.getElementById("total_price").setAttribute("value",total_price);
						if(LANGUAGE == "es")
						{
							//document.getElementById("currency_code").setAttribute("value","MXN");
							document.getElementById("item_name").setAttribute("value",final_msg+" + ENVIÓ POR MENSAJERÍA RÁPIDA");
						}else{
							document.getElementById("item_name").setAttribute("value",final_msg+" + SHIPPING AND HANDLING");
						}

						
						document.getElementById("item_number").setAttribute("value",m_name_fld.value+" "+m_last_fld.value);
						form_msg.parentNode.removeChild(form_msg);
				}

}




