function validaBuscador(form){

	//{JS_OPT_AVANZADO} no!
	if (form.codigodepto){
		form.codigodepto.optional = true;
		form.codtipodepto.optional = true;
		form.deptocalle.optional = true;
		form.deptocapac.optional = true;
		form.codbarrio1.optional = true;
		form.codbarrio2.optional = true;
	}
	//{/JS_OPT_AVANZADO} no!
	
	form.checkin_dia.optional = true;
	form.checkin_mes.optional = true;
	form.checkin_ano.optional = true;

	form.checkout_dia.optional = true;
	form.checkout_mes.optional = true;
	form.checkout_ano.optional = true;

	form.fan_checkin.optional = true;
	form.fan_checkout.optional = true;
	form.fan_checkin.date = true;
	form.fan_checkout.date = true;

	//controlo que sea una fecha valida
	var checkin_str = "";
	var checkout_str = "";
	if (form.checkin_dia.value != "" || form.checkin_mes.value || form.checkin_ano.value)
		checkin_str = form.checkin_dia.value+"-"+form.checkin_mes.value+"-"+form.checkin_ano.value;
	if (form.checkout_dia.value != "" || form.checkout_mes.value || form.checkout_ano.value)
		var checkout_str = form.checkout_dia.value+"-"+form.checkout_mes.value+"-"+form.checkout_ano.value;
	form.fan_checkin.value = checkin_str;
	form.fan_checkout.value = checkout_str;
	if (!(verify(form)))
		return false;
	//fin controlo que sea una fecha valida

	//controlo que sea un rango valido
	var checkin = form.checkin_ano.value+form.checkin_mes.value+form.checkin_dia.value;
	var checkout = form.checkout_ano.value+form.checkout_mes.value+form.checkout_dia.value;
	if (checkin > checkout){
		alert("La fecha de Check-Out no puede ser menor a la fecha de Check-In");
		return false;
	}
	//fin controlo que sea un rango valido
	
	return true;	
}


Date.prototype.cambiaDia=cambiaDia;
Date.prototype.cambiaMes=cambiaMes;
Date.prototype.cambiaAnio=cambiaAnio;
Date.prototype.cambiaFecha=cambiaFecha;


   function cambiaFecha(){

     var fecha="";

     fecha += this.cambiaDia();
     fecha += ", ";
     fecha += this.cambiaMes();
     fecha += " ";
     fecha += this.getDate();
     fecha += ", ";
     fecha += this.cambiaAnio();

     return fecha; 
   }


   function cambiaMes(){

	var meses = new Array(12);

	meses[0]= "January"; 
	meses[1]= "February"; 
	meses[2]= "March"; 
	meses[3]= "April"; 
	meses[4]= "May"; 
	meses[5]= "June"; 
	meses[6]= "July"; 
	meses[7]= "August"; 
	meses[8]= "September"; 
	meses[9]= "October"; 
	meses[10]= "November"; 
	meses[11]= "December";


	return meses[this.getMonth()]; 
   }
 
   function cambiaDia(){

	var dias = new Array(7);

	dias[0]= "Sunday"; 
	dias[1]= "Monday"; 
	dias[2]= "Tuesday"; 
	dias[3]= "Wednesday"; 
	dias[4]= "Thursday"; 
	dias[5]= "Friday"; 
	dias[6]= "Saturday"; 

	return dias[this.getDay()]; 
   }


   function cambiaAnio(){
      return +this.getYear();
   }


function mOvr(src,clrOver) {
if (!src.contains(event.fromElement)) {
src.style.cursor = 'hand';
src.bgColor = clrOver;
}
}
function mOut(src,clrIn) {
if (!src.contains(event.toElement)) {
src.style.cursor = 'default';
src.bgColor = clrIn;
}
}
function mClk(src) {
if(event.srcElement.tagName=='TD'){
src.children.tags('A')[0].click();
}
}

//

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//


// FONT SIZE MANAGEMENT 
function FindObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=FindObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function ChangeProp(objName,x,theProp,theValue) { //v6.0
var obj = FindObj(objName);
if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
if (theValue == true || theValue == false)
eval("obj."+theProp+"="+theValue);
else eval("obj."+theProp+"='"+theValue+"'");
}
}

function LoadActualFontSize() {
tempArray = document.cookie.split(";");
for (tA = 0; tA < tempArray.length; tA++){
if (tempArray[tA].indexOf('fontSize') > -1){
fontSizeValue = tempArray[tA].split("=")
ACTUAL_FONTSIZE = parseInt(fontSizeValue[1]);
}
}
}

function SaveActualFontSize() {
var expire = new Date ();
expire.setTime (expire.getTime() + (6000 * 24 * 3600000));
expire = expire.toGMTString();
document.cookie="fontSize="+ACTUAL_FONTSIZE+"; path=/; expires="+expire;
}

function Bigger() {
ACTUAL_FONTSIZE = ACTUAL_FONTSIZE+1;
if (ACTUAL_FONTSIZE > LARGEST_FONTSIZE) { ACTUAL_FONTSIZE = LARGEST_FONTSIZE }
ChangeProp('texto','','style.fontSize',ACTUAL_FONTSIZE,'SPAN');
SaveActualFontSize();
//footer();
}

function Smaller() {
ACTUAL_FONTSIZE = ACTUAL_FONTSIZE-1
if (ACTUAL_FONTSIZE < SMALLEST_FONTSIZE) { ACTUAL_FONTSIZE = SMALLEST_FONTSIZE }
ChangeProp('texto','','style.fontSize',ACTUAL_FONTSIZE,'SPAN');
SaveActualFontSize();
//footer();
}

ACTUAL_FONTSIZE = 11;
SMALLEST_FONTSIZE = 11;
LARGEST_FONTSIZE = 20;

// FONT CONTRAST MANAGEMENT
function LoadActualContrast() {
tempArray = document.cookie.split(";");
for (tA = 0; tA < tempArray.length; tA++){
if (tempArray[tA].indexOf('contrast') > -1){
var ww = document.getElementById('texto');
ww.style.color = tempArray[tA].split("=");
}
}
}

function SaveActualCtrs() {
var expire = new Date ();
expire.setTime (expire.getTime() + (6000 * 24 * 3600000));
expire = expire.toGMTString();
document.cookie="contrast="+fino+"; path=/; expires="+expire;
}

function CMas() {
var fino;
var ww = document.getElementById('texto');
if (ww.style.color == '#333') {
fino = '#000';
ww.style.color = fino;
}
if (ww.style.color == '#7A7A7A' || ww.style.color == '') {
fino = '#333';
ww.style.color = fino;
}
//SaveActualCtrs();
}

function CMenos() {
var fino;
var ww = document.getElementById('texto');
if (ww.style.color == '#333') {
fino = '#7A7A7A';
ww.style.color = fino;
}
if (ww.style.color == '#000') {
fino = '#333';
ww.style.color = fino;
}
//SaveActualCtrs();
}


function OpenWindow(url)
{
	window.open(url,'','scrollbars=1,location=1,status=1,toolbar=1,resizable=1,width=700,height=600,top=10,left=10');
	return;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


///////////////////////


  
