
function enviaresersp(EW_this)
{	ma = EW_this.con_email.value;
	if (ma =='' || ma.length==0) 	{	alert("Por favor ingrese el campo obligatorio: E-mail"); EW_this.con_email.focus(); return false; 	}
	
	filter=/^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
	if (!filter.test(ma))			{	alert("Ingrese una dirección de correo válida"); EW_this.con_email.focus();	return false; }
	
	ma = EW_this.con_nombre.value;
	if (ma =='' || ma.length==0) 	{	alert("Por favor ingrese el campo obligatorio: Nombre"); EW_this.con_nombre.focus(); return false; 	}
	
	ma = EW_this.con_pax.value;
	if (ma =='' || ma.length==0) 	{	alert("Por favor ingrese el campo obligatorio: Personas (adultos)"); EW_this.con_pax.focus(); return false; 	}
	
	ma = EW_this.con_fecha.value;
	if (ma =='' || ma.length==0) 	{	alert("Por favor ingrese el campo obligatorio: Fecha llegada"); EW_this.con_fecha.focus(); return false; 	}
	
	ma = EW_this.con_fechasal.value;
	if (ma =='' || ma.length==0) 	{	alert("Por favor ingrese el campo obligatorio: Fecha llegada"); EW_this.con_fechasal.focus(); return false; 	}
return true;
}
function enviareseren(EW_this)
{	ma = EW_this.con_email.value;
	if (ma =='' || ma.length==0) 	{	alert("Please enter the required field: E-mail"); EW_this.con_email.focus(); return false; 	}
	
	filter=/^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
	if (!filter.test(ma))			{	alert("Enter a valid email addres"); EW_this.con_email.focus();	return false; }
	
	ma = EW_this.con_nombre.value;
	if (ma =='' || ma.length==0) 	{	alert("Please enter the required field: Name"); EW_this.con_nombre.focus(); return false; 	}
	
	ma = EW_this.con_pax.value;
	if (ma =='' || ma.length==0) 	{	alert("Please enter the required field: You are reserving for (Adults)"); EW_this.con_pax.focus(); return false; 	}
	
	ma = EW_this.con_fecha.value;
	if (ma =='' || ma.length==0) 	{	alert("Please enter the required field: Arrival Date"); EW_this.con_fecha.focus(); return false; 	}
	
	ma = EW_this.con_fechasal.value;
	if (ma =='' || ma.length==0) 	{	alert("Please enter the required field: Departure Date"); EW_this.con_fechasal.focus(); return false; 	}

return true;
}

/*    */

function enviamailsp(EW_this)
{	ma = EW_this.con_email.value;
	if (ma =='' || ma.length==0) 
	{	alert("Por favor ingrese el campo obligatorio: E-mail"); EW_this.con_email.focus(); return false; 	}
	
	filter=/^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
	if (!filter.test(ma))	
	{	alert("Ingrese una dirección de correo válida"); EW_this.con_email.focus();	return false; }
	
	ma = EW_this.con_com.value;
	if (ma =='' || ma.length==0) 
	{	alert("Por favor ingrese el campo obligatorio: Comentario"); EW_this.con_com.focus(); return false; 	}

return true;
}
function enviamailen(EW_this)
{	ma = EW_this.con_email.value;
	if (ma =='' || ma.length==0) 
	{	alert("Please enter the required field: E-mail"); EW_this.con_email.focus(); return false; 	}
	
	filter=/^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
	if (!filter.test(ma))	
	{	alert("Enter a valid email addres"); EW_this.con_email.focus();	return false; }
	
	ma = EW_this.con_com.value;
	if (ma =='' || ma.length==0) 
	{	alert("Please enter the required field: Comentario"); EW_this.con_com.focus(); return false; 	}

return true;
}


/*    */

function irpa(ya)
{	document.location.href=ya;
}


popes=1
function popitup(url)
{	newwindow=window.open(url,'name'+popes,'height=250,width=300,status=no,scrollbar=no');
	if (window.focus) { newwindow.focus(); }
	popes++; return false;
}
function poper(url)
{	newwindow=window.open(url,'name'+popes);
	if (window.focus) { newwindow.focus(); }
	popes++; return false;
}


function ilum(me)
{		 if(me.className=='mtop')  { me.className='mtop2'; }  
	else if(me.className=='mtop2') { me.className='mtop';  } 
	else if(me.className=='op')    { me.className='op2';   } 
	else if(me.className=='op2')   { me.className='op';    } 
}

function prenda(me)
{	ideses = document.getElementById('ides').value.split(',');
	for(k=0; k<ideses.length; k++)	{	document.getElementById('m'+ideses[k]).className='op';	}
	me.className='opon';
}

function fotosprod()
{	if(document.getElementById('opini') && document.getElementById('opini').value!='')
	{	tede='m'+document.getElementById('opini').value; 
		document.getElementById(tede).className='opon';
	}
	/*if(document.getElementById('listafotos') && document.getElementById('listafotos').value!='')
	{	vecfodes=document.getElementById('listafotos').value.split('~~'); sale='';
		for(k=0; k<vecfodes.length; k++)	
		{	vec=vecfodes[k].split('::');	//vecfo[k]=vec[0];	vecde[k]=vec[1]; 
			if(k==0) { sale+='<table border=0 cellpadding=0 cellspacing=0 style="margin-bottom:2px; border-bottom:1px solid #c0c0c0">'
							+'<tr><td><img src="archivos/g_'+vec[0]+'" width="350" height="263" alt="" id="g_foto"></td></tr>'
							+'<tr><td class="peq">'+vec[1]+'</td></tr></table>'; }
			sale+='<div class="fotos"><img src="archivos/'+vec[0]+'" width="48" height="36" onclick="" style="cursor:hand;cursor:pointer"></div>';
		}
		document.getElementById('lasfotos').innerHTML=sale;
	}*/
	/*$(function() {
    $('#s1').after('<div id="nav" class="nav">').cycle({
       	fx:      'fade',
	    click:   '#s1',
	    timeout:  0,
		speed:   600, 
	    timeout: 3000, 
	    pause:   1,
		pager:  '#nav' 
	    });
	});*/
	$(function() {
    $('#slideshow').cycle({
        fx:     'turnDown',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav',
        pagerAnchorBuilder: function(idx, slide) {   return '#nav li:eq(' + (idx) + ') a';        }
    });

    $('#direct').click(function() {
        $('#nav li:eq(2) a').triggerHandler('click');
        return false;
    });
    
});
}

function fotoscont()
{	if(document.getElementById('fotosizquierda') && document.getElementById('lado'))
	{	sale='<div class="basefoto"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="200" height="200" id="fotos" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" '
			+' value="fotos.swf?tira='+document.getElementById('fotosizquierda').value+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed '
			+' src="fotos.swf?tira='+document.getElementById('fotosizquierda').value+'" wmode="transparent" quality="high" width="200" height="200" name="fotos" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></div>';
		document.getElementById('lado').innerHTML=sale;
	}
	
	if(document.getElementById('opini') && document.getElementById('opini').value!='')
	{	tede='m'+document.getElementById('opini').value; 
		document.getElementById(tede).className='opon';
	}
	
	if(document.getElementById('opini') && document.getElementById('opini').value=='' && document.getElementById('ides').value!='')
	{	tedes=document.getElementById('ides').value.split(','); 
		if(tedes.length>0) { 		document.getElementById('m'+tedes[0]).className='opon'; }
	}
	
	if(document.getElementById('con_fecha') && document.getElementById('con_fechasal'))	
	{	/*Calendar.setup(
		{	inputField : "con_fecha", 
			ifFormat : "%d/%m/%Y", 
			button : "cx_fi" 
		}
		);*/
		Calendar.setup(
		{	inputField : "con_fechasal", 
			ifFormat : "%d/%m/%Y", 
			button : "cx_fs" 
		}
		);
	}
}



/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""

function ajaxpage(url, containerid)
{	var page_request = false
	if (window.XMLHttpRequest) // if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
	else if (window.ActiveXObject)
	{ // if IE
		try {	page_request = new ActiveXObject("Msxml2.XMLHTTP")	} 
		catch (e)
		{	try	{	page_request = new ActiveXObject("Microsoft.XMLHTTP")	
				}
			catch (e){}
		}
	}
	else	return false
	page_request.onreadystatechange=function(){	loadpage(page_request, containerid)	}
	if (bustcachevar) //if bust caching of external page
		bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
	page_request.open('GET', url+bustcacheparameter, true)
	page_request.send(null)
}

function loadpage(page_request, containerid)
{	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
	document.getElementById(containerid).innerHTML=page_request.responseText;
	fotoscont(); fotosprod();
}

function loadobjs(){
if (!document.getElementById)	return
for (i=0; i<arguments.length; i++)
{	var file=arguments[i]
	var fileref=""
	if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
		if (file.indexOf(".js")!=-1){ //If object is a js file
			fileref=document.createElement('script')
			fileref.setAttribute("type","text/javascript");
			fileref.setAttribute("src", file);
		}
		else if (file.indexOf(".css")!=-1){ //If object is a css file
			fileref=document.createElement("link")
			fileref.setAttribute("rel", "stylesheet");
			fileref.setAttribute("type", "text/css");
			fileref.setAttribute("href", file);
		}
	}
	if (fileref!="")
	{	document.getElementsByTagName("head").item(0).appendChild(fileref)
		loadedobjects+=file+" " //Remember this object as being already added to page
	}
}
}


