/**
 * Buscador de vuelos
 */
 
 	function simpleSearch (select, context, window) {
 		if (select.options[select.selectedIndex].value != "") {
 			if(window=="parent") {
	 			parent.document.location.href = context + select.options[select.selectedIndex].value;
 			} else {
 				document.location.href = context + select.options[select.selectedIndex].value;
 			}
		}
 	}
	
	function combinedSearch (origin, dest, context) {
		if (origin.options[origin.selectedIndex].value != "" && dest.options[dest.selectedIndex].value != "") {
			var origValue = origin.options[origin.selectedIndex].value;
			var destValue = dest.options[dest.selectedIndex].value;
			var splitted = (origValue + "$$" + destValue).split("\$\$");
			document.location.href= context + splitted[0] + "-" + splitted[2] + "-" + splitted[1] + "-" + splitted[3];
		}
	}
	
	function airportsOfCitySearch (select, context) {
		simpleSearch (select, context)	
	}
	
	function airportsOfCountrySearch (select, context) {
		simpleSearch (select, context)	
	}
	
 function openWindowLink(nameWindow,heightWindow,widthWindow) {
			nameWindow = nameWindow + ".php";
			scrollbar = "scrollbars=no,";
			if(heightWindow>300) scrollbar = "scrollbars=yes,";
			heightWindow = "height="+heightWindow+",";
			widthWindow = "width="+widthWindow+",";
			window.open(nameWindow,"opWindow",heightWindow+widthWindow+scrollbar+"toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=no")
}

/* Buscardor Top*/
function submitForm()
{
	str = document.contactForm.message.value;
	numOfChar = str.length;
	if (numOfChar>1000) {
		alert("El tamaño máximo del mensaje es de 1000 carácteres (incluyendo espacios).");
	} else {
		document.contactForm.submit();
	}
}

function openWindowRaw(nameWindow,heightWindow,widthWindow) {
			nameWindow = "base/" + nameWindow;
			scrollbar = "scrollbars=no,";
			if(heightWindow>300) scrollbar = "scrollbars=yes,";
			heightWindow = "height="+heightWindow+",";
			widthWindow = "width="+widthWindow+",";
			window.open(nameWindow,"opWindow",heightWindow+widthWindow+scrollbar+"toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=no")
}

function addBookmark(url,title) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if (document.all) {
		window.external.AddFavorite(url, title);
	}
}
