/*******************/
var msg_ro = new Array("Completati numele titularului cardului!", 
					   "Completati corect data expirarii cardului!",
					   "Completati cod CVC!",
					   "Completati corect numarul de card",
					   "Completati numele dumneavoastra!",
					   "Completati email!",
					   "Completati data sosirii!",
					   "Completati data plecarii!",
					   "Numarul de persoane",
					   "Cati copii?",
					   "Completati nr de camere!",
					   "Completati tipul de camera!",
					   "Sunteti sigur?",
					   "Completati modalitatea de plata!",
					   "Completati numarul zborului!",
					   "Completati ora de aterizare!",
					   "Completati mesajul dumneavoastra!");

var msg_eng = new Array("Fill in card owner's name!", 
					   "Valid thru!",
					   "CVC code!",
					   "Fill in card number",
					   "Fill in your name!",
					   "Fill in your email!",
					   "Fill in your check in date!",
					   "Fill in your check out date!",
					   "Number of persons",
					   "Children?",
					   "Number of rooms!",
					   "Fill in your desire Room Type!",
					   "Are you sure?",
					   "Fill in your payment method!",
					   "Flight number!",
					   "Landing hour!",
					   "Fill in your message!");

/*******************/

function check(id)
	{
		if (document.form_send.nume.value=='')
			alert(id[4]);
		else if (document.form_send.email.value=='')
			alert(id[5]);	
		else if (document.getElementById('div_sosire1').innerHTML=='')
			alert(id[6]);
		else if (document.getElementById('div_plecare1').innerHTML=='')
			alert(id[7]);
		else if (document.form_send.nrpers.value=='')
			alert(id[8]);
		else if (document.form_send.nr_copii.value=='')
			alert(id[9]);
		else if (document.form_send.nr_camere.value=='')
			alert(id[10]);
		else if (document.form_send.camera.value=='')
			alert(id[11])
		else if (confirm(id[12]))
			document.form_send.submit();
	}

function verifyCard(id) {	
	if (document.getElementById('VisaCard').style.display == 'none') 
		{
			check1(id); 			
		}
	else if (document.form_send1.titular_card.value=='')
		{
			alert(id[0])
		}	
	else if ((document.form_send1.cardMonth.value=='') || (document.form_send1.cardMonth.value=='-- Luna --') || (document.form_send1.cardYear.value=='') || (document.form_send1.cardYear.value=='-- An --'))
		{
			alert(id[1])
		}	
	else if (document.form_send1.card_cvc.value=='')
		{
		alert(id[2])				
		}	
	else
	   {
		var x = new Array()				
		var suma=0;
		x = document.form_send1.card1.value.substr(0,4) + document.form_send1.card2.value.substr(0,4) + document.form_send1.card3.value.substr(0,4) + document.form_send1.card4.value.substr(0,4)
		for(var i=0;i<16;i++) {					
			j = (x[i]*1)
			if ((i%2==0) && (x[i]%9!=0) ) { 
				j = (x[i]*2)%9
			}
			suma = (suma*1) + (j*1)
		}				
		if (suma%10==0) {check1(id)}
			else alert(id[3])
	   }

}

function check1(id)
	{
		if (document.form_send1.nume.value=='')
			alert(id[4]);
		else if (document.form_send1.email.value=='')
			alert(id[5]);	
		else if (document.getElementById('div_sosire2').innerHTML=='')
			alert(id[6]);
		else if (document.getElementById('div_plecare3').innerHTML=='')
			alert(id[7]);
		else if (document.form_send1.nrpers.value=='')
			alert(id[8]);	
		else if (document.form_send1.nr_copii.value=='')
			alert(id[9]);
		else if (document.form_send1.nr_camere.value=='')
			alert(id[10]);
		else if (document.form_send1.camera.value=='')
			alert(id[11])
		else if (document.form_send1.plata.value=='--- # ---')
			alert(id[13])
		else if (document.form_send1.transfer.checked == true)
			{							
			 if (document.form_send1.nrzbor.value=='')
				alert(id[14])
			else if (document.form_send1.orazbor.value=='')
				alert(id[15])
			else if (document.form_send1.comentarii.value=='')
				alert(id[16]);
			else if (confirm(id[12]))
				document.form_send1.submit();
			}						
		else if (confirm(id[12]))
			document.form_send1.submit();
}


