function load_images(folder,amount){
var root="../../images/user/"+folder;
for(i=1;i<amount;i++){eval("img"+i+"=new Image();img"+i+".src='"+root+"/banner"+i+".jpg'");}
}
function fader_values(lower,higher,elm){
step=3;
pause=0;
opacity=10;
initial=lower;
pics=higher;
canvas=elm;
}
function fader_changes(){
eval("document.getElementById('"+canvas+"').style.filter='Alpha(Opacity="+opacity+"0)'");
eval("document.getElementById('"+canvas+"').style.MozOpacity='"+(opacity/10)+"'");
eval("document.getElementById('"+canvas+"').style.KhtmlOpacity='"+(opacity/10)+"'");
eval("document.getElementById('"+canvas+"').style.opacity='"+(opacity/10)+"'");
}
function fader_execute(){ 
if(step==0){
opacity--;
if(opacity==0){step++;}
fader_changes();
}
else{
if(step==1){
initial++;
if(initial==pics)initial=1;
eval("document.getElementById('"+canvas+"').src=img"+initial+".src");
step++;
}
else{
if(step==2){
opacity++;
if(opacity==10){step++;}
fader_changes();
}
else{
pause++;
if(pause==100){
pause=0;
step=0;
}
}
}
}
setTimeout('fader_execute()',50);
}
function enlarge_thumb(wd,hg,path,tit){
lf=(screen.width-wd)/2;
tp=(screen.height-hg)/2;
newin=window.open('','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+wd+',height='+hg+',left='+lf+',top='+tp);
newin.document.write("<html><head><title>"+tit+"</title></head><body style='margin:0px;padding:0px'><img src='"+path+"' width='"+wd+"' height='"+hg+"' /></body></html>");
}
function check_string(val){
var have_char=false;
val=val.replace(/\r/g,"");
val=val.replace(/\n/g,"");
for(i=0;i<val.length;i++){
if(val.charAt(i)!="" && val.charAt(i)!=" "){
have_char=true;
break;
}
}
return have_char;
}
function return_value(val,def,oper){
if(oper=="select"){
if(!check_string(val) || val==def){return "";}
else{return val;}
}
else{
if(!check_string(val)){return def;}
else{return val;}
}
}
function new_target(succ,fail){
document.f.succesful.value=succ;
document.f.failure.value=fail;
new_win=window.open("","my_win","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=150");
new_win.moveTo(Math.round((screen.width-400)/2),Math.round((screen.height-150)/2));
document.f.target="my_win";
document.f.submit();
}

function compile_info(){
var aux="";
document.f.tours.value=aux;
var trs=new Array("","Conociendo la selva 3 días / 2 noches_","Adrenalina en la jungla 3 días / 2 noches_","Entre la jungla y el río 3 días / 2 noches_","Entre la jungla y el río 4 días / 3 noches_","Adrenalina en la jungla 4 días / 3 noches_");
for(i=1;i<6;i++){
eval("if(document.f.tour"+i+".checked){aux+='"+trs[i]+"'}");
}
document.f.tours.value=aux;
}
