function recomendar(id){
ancho=440; alto=400;
var _W=window.open('send-to-friend.php?id='+id,'recomendar',"scrollbars=yes,width="+ancho+",height="+alto); 
_W.focus();
iz=(screen.width-ancho) / 2;
de=(screen.height-alto) / 2;
_W.moveTo(iz,de);
}
function openPopup(id){
ancho=800; alto=600;
var _W=window.open(id,'recomendar',"scrollbars=yes,width="+ancho+",height="+alto);
_W.focus();
iz=(screen.width-ancho) / 2;
de=(screen.height-alto) / 2;
_W.moveTo(iz,de);
}
function openChat()
{
ancho=200; alto=320;
var _W=window.open('chat.html','Chat',"scrollbars=yes,width="+ancho+",height="+alto);
_W.focus();
iz=(screen.width-ancho) / 2;
de=(screen.height-alto) / 2;
_W.moveTo(iz,de);
}
function imprimir(id)
{
ancho=570; alto=550;
var _W=window.open('verimprimir.php?id='+id,'imprimir',"scrollbars=yes,width="+ancho+",height="+alto);
_W.focus();
iz=(screen.width-ancho) / 2;
de=(screen.height-alto) / 2;
_W.moveTo(iz,de);
}
function openWindow(id)
{
ancho=720; alto=550;
var _W=window.open('intership'+id+'.php','InterShip',"scrollbars=yes,width="+ancho+",height="+alto);
_W.focus();
iz=(screen.width-ancho) / 2;
de=(screen.height-alto) / 2;
_W.moveTo(iz,de);
}
function calculateFee()
{
	document.getElementById('convirtiendo').style.display = 'none';
	var calcu = document.getElementById('calculating');
	calcu.style.display = 'block';
	document.getElementById('cotizacion').style.display = 'none';
	var study = document.getElementById('study');
	var withMaterials = document.getElementById('materials');
	if(withMaterials) {
		withMaterials = withMaterials.checked;
		if(withMaterials) {
			withMaterials = "1"
		}
		else {
			withMaterials = "0"
		}
	}
	else {
		withMaterials = "0";
	}
	
	var type = document.getElementById('stay');
	var weeks = document.getElementById('weeks');
	var tours = 0 //document.getElementById('tours');
	
	study.disabled = true;
	type.disabled = true;
	weeks.disabled = true;
	tours.disabled = true;
	var transferencia = getRadioButtonSelectedValue(document.airtrans.transferair);
	if((study.value > 0) && (type.value > 0) && (weeks.value > 0) && transferencia)
	{
	
		
		xajax_feeCalculator(study.value, withMaterials, type.value,weeks.value,tours.value,transferencia);
	} 
	else 
	{
		if(!transferencia)
		{
			alert("Please select your airport transfer.");
		}
		else
		{
			if(study.value < 1)
			{
				alert("Please select your study schedule.");
				study.className = 'rojo';
				study.disabled = false;
				study.focus();
			}
			else if(type.value < 1)
			{
				alert("Please select your Accommodation Type.");
				type.className = 'rojo';
				type.disabled = false;
				type.focus();
		
			}
			else if(weeks.value < 1)
			{	
				alert("Please select the number of weeks");
				weeks.className = 'rojo';
				weeks.disabled = false;
				weeks.focus();
			}
		}
		calcu.style.display = 'none';
		study.disabled = false;
		weeks.disabled = false;
		type.disabled = false;
		
	}
	
	
}
function dblurea(x)
{
	x.className = '';
}
function getRadioButtonSelectedValue(ctrl)
{

if(ctrl)
{

    for(i=0;i<ctrl.length;i++)
	{
	
        if(ctrl[i].checked)
		{
			return ctrl[i].value;
		}
	}
}
else
{
return false;
}
}