function openCalendar(url, element)
{
	var cal = new calendar1(url, element);
	cal.year_scroll = false;
	cal.time_comp = false;
	cal.popup();
}

function onlineBooking(agentURL)
{
	document.onlineBooking.action = agentURL;
	document.onlineBooking.submit();
}
	
function openTerms(terms)
{
	MM_openBrWindow(terms,'','toolbar=0,scrollbars=0,fatherValue=0,statusbar=0,menubar=0,resizable=0,width=600,height=500' )
}

function openTermsEN(terms)
{
	MM_openBrWindow(terms,'','toolbar=0,scrollbars=0,fatherValue=0,statusbar=0,menubar=0,resizable=0,width=600,height=470' )
}

function openPhoto(photo)
{
	MM_openBrWindow(photo, '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=300,left = 0,top = 0')
}

function selectOption(options, value)
{
	for(i=0;i<options.length;i++)
	{
		if(options[i].value == value)
			options[i].selected = true;	
	}
}

function openShippingCompanies(page, companies)
{
	document.getElementById('shippingCompanies').value = companies;
	
	MM_openBrWindow(page, '','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=630,height=250,left = 0,top = 0');
}
	
function openShippingCompaniesEN(page, companies)
{
	document.getElementById('shippingCompanies').value = companies;
	
	MM_openBrWindow(page, '','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=630,height=250,left = 0,top = 0');
}

function openFacilities(page)
{
	popUp = MM_openBrWindow(page,'Υπηρεσίες','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=610,height=500');
}

function openFacilitiesEN(page)
{
	popUp = MM_openBrWindow(page,'Facilities','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=610,height=500,left = 0,top = 0')
}

function populatePair(father, fatherValues, child, childValues)
{
var fatherValue = father.options[father.selectedIndex].value;
var fatherIndex;

	for(i=0; i<fatherValues.length;i++)
	{
		if(fatherValues[i] == fatherValue)
			fatherIndex = i;
	}

child.options.length = 0;
	
var children = childValues[fatherIndex];

if(children == undefined)
	return
else
{
	for(i=0;i<children.length;i+=2)
	{
		child.options[i/2] = new Option(children[i], children[i+1]);
	}
}
}

function updateAgenciesCities(father, child){
	populatePair(father, counties, child, cities)
}

function updatePortsDestinations(father, child){
	populatePair(father, origins, child, destinations)
}

function updateHotelsAreas(father, child){
	populatePair(father, hotelDestinations, child, hotelAreas)
}

function verify(element, lang) 
{ 
var fields = new Array("from","region","destination", "fatherValue");
var greekMessages = new Array("Παρακαλώ Επιλέξτε Λιμάνι Αναχώρησης","Παρακαλώ Επιλέξτε Προορισμό για τη Διαμονή σας","Παρακαλώ Επιλέξτε Προορισμό", "Παρακαλώ Επιλέξτε Νομό");
var englishMessages = new Array("Please Select Departure Port", "Please Select Destination Accomodation", "Please Select Destination", "Please Select County");
var message = "";

switch(element.name)
{
case fields[0]:
	if(lang == 0)
		message = greekMessages[0];
	else if(lang == 1)
		message = englishMessages[0];
break;
case fields[1]:
	if(lang == 0)
		message = greekMessages[1];
	else if(lang == 1)
		message = englishMessages[1];
break;
case fields[2]:
	if(lang == 0)
		message = greekMessages[2];
	else if(lang == 1)
		message = englishMessages[2];
break;
case fields[3]:
	if(lang == 0)
		message = greekMessages[3];
	else if(lang == 1)
		message = englishMessages[3];
break;
default: 
	message = "Please select a Value from the List";
break;
}

if (element.value == "")
{
	alert(message);
	element.focus();
return false;
}

return;
} 
//-->