var zpoblacion
var zcp
var zprovincia
var zpaix
var ztipocliente
var zdiafecha
var zmesfecha
var zyearfecha
var anom;
var sesion;
var chkey;
var chlog;

function valorascci()
{

   
  url="http://www.splendidtravel.es/cgi-bin/usuarios/users.exe/getanonimo?"
  url=url+"&sid="+Math.random()

  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { anom = e.responseText ;}  
                 }
	 , onFailure: function(e) {
  		             alert('Error en la lectura de los datos');
                 }
        		
 });



} 


function showcontra(donde,idses,idanon)
{

var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
  url="http://www.splendidtravel.es/cgi-bin/usuarios/users.exe/formcontra?idsesion="+sesion+"&idanonimo="+idanon
  url=url+"&sid="+Math.random()

$(donde).innerHTML=url;
  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText; }  
                 }
 });

} 


function getcontra(donde,idses,idanon)
{

m = $('mailcontra').getValue();

if (comprobarMAIL(m)==true)
 {

  $('errormail').style.display="none";
  url="http://www.splendidtravel.es/cgi-bin/usuarios/users.exe/contra?idsesion="+sesion+"&idanonimo="+idanon+"&mail="+$('mailcontra').getValue()
  url=url+"&sid="+Math.random()


  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText; }  
                 }
 });
}
else
{
     $('errormail').style.display="block";

}

} 


function formregistro(donde,idses,idanon)
{
var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
  document.location.href='#';


  url="http://www.splendidtravel.es/cgi-bin/usuarios/users.exe/formregistro?idsesion="+idses+"&idanonimo="+idanon
  url=url+"&sid="+Math.random()



  new Ajax.Request(url, { method: 'get', 
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText ;writepoblacion();writecp();writeprovincia();writepais(); writetipocliente();writediafecha();writemesfecha();writeyearfecha();}  
                 }
 });
 
} 








function registrarse(donde){

  document.location.href='#';
var text="";

url="http://www.splendidtravel.es/cgi-bin/usuarios/users.exe/check?key="+$('key').getValue()+"&keyuser="+$('keyuser').getValue()

new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { chkey = e.responseText ; }  
                 }
 });

url="http://www.splendidtravel.es/cgi-bin/usuarios/users.exe/checklogin?login="+$('loginreg').getValue()

new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { chlog = e.responseText ; }  
                 }
 });
 
 


if ($('nombre').getValue()==""){
    text = "El Nombre es obligatorio<br>\n";
    }

if ($('apellido1').getValue()==""){
    text = text+"El Primer Apellido es obligatorio<br>\n";
    }



if ($('cif').getValue()==""){
    text = text+"El Cif es obligatorio<br>\n";
    ret=false;
    }

m = $('email').getValue();

if (comprobarMAIL(m)==false){
    text = text+"El E-Mail no tiene un formato correcto. Debe contener una @ y un .<br>\n";
    }

if (ztipocliente != null) {
if (ztipocliente.getComboText()==""){
    text = text+"El Tipo de Cliente es obligatorio<br>\n";
    ret=false;
    }
}

if ($('direccion').getValue()==""){
    text = text+"La Direccion es obligatoria<br>\n";
    ret=false;
    }


if (zpoblacion != null) {
if (zpoblacion.getComboText()==""){
    text = text+"La Poblacion es obligatoria<br>\n";
    ret=false;
    }
}


if (zcp != null) {
if (zcp.getComboText()==""){
    text = text+"El Codigo Postal es obligatorio<br>\n";
    ret=false;
    }
}


if (zprovincia != null) {
if (zprovincia.getComboText()==""){
    text = text+"La Provincia es obligatoria<br>\n";
    ret=false;
    }
}


if (zpais != null) {
if (zpais.getComboText()==""){
    text = text+"El Pais es obligatorio<br>\n";
    ret=false;
    }
}

if ($('loginreg').getValue()==""){
    text = text+"El Nombre de usuario es obligatorio<br>\n";
    ret=false;
    }

if (chlog=="1"){
    text = text+"El Nombre de usuario ya existe<br>\n";
    ret=false;
    }

if ($('passreg').getValue()==""){
    text = text+"La contraseña es obligatoria<br>\n";
    ret=false;
    }

if ($('passreg').getValue()!=$('pass2reg').getValue()){
    text = text+"Las contraseñas no coinciden<br>\n";
    ret=false;
    }


if ($('keyuser').getValue()==""){
    text = text+"No ha introducido el codigo de la imagen.<br>\n";
    ret=false;
    }

if (chkey=="0"){
    text = text+"La Clave introducida no es correcta.<br>\n";
    ret=false;
    }



if ($('privacidad').checked == false){
   text = text+"Debe aceptar la politica de privacidad para seguir con el registro.<br>\n";
}



if (text!="") {
   document.location.href='#';
    $('errorkey').innerHTML = "Errores Encontrados / Errors Founded:<br><br>"+text;
    $('errorkey').style.display="block"   ;

}
else
{
  $('errorkey').innerHTML = "";
  url="http://www.splendidtravel.es/cgi-bin/usuarios/users.exe/registro?idanonimo="+anom+"&login="+$('loginreg').getValue()+"&pass="+$('passreg').getValue()+"&empresa="+$('empresa').getValue()+"&nombre="+$('nombre').getValue()

  url=url+"&apellido1="+$('apellido1').getValue()+"&cif="+$('cif').getValue()+"&mail="+$('email').getValue()
 
  url=url+"&direccion="+$('direccion').getValue();

  if ($('apellido2') != null) { url=url+"&apellido2="+$('apellido2').getValue()}
  if (zpoblacion != null) { url=url+"&poblacion="+zpoblacion.getComboText();}
  if (zcp != null) { url=url+"&cp="+zcp.getComboText();}
  if (zprovincia != null) { url=url+"&provincia="+zprovincia.getComboText();}
  if (zpais != null) { url=url+"&pais="+zpais.getComboText();}
  if (ztipocliente != null) { url=url+"&tipocliente="+ztipocliente.getComboText();}
  if (zdiafecha != null) { url=url+"&dia="+zdiafecha.getComboText();}
  if (zmesfecha != null) { url=url+"&mes="+zmesfecha.getComboText();}
  if (zyearfecha != null) { url=url+"&year="+zyearfecha.getComboText();}
  if ($('telefono') != null) { url=url+"&telefono="+$('telefono').getValue()}
  if ($('telefono') != null) { url=url+"&telefono="+$('telefono').getValue()}
  if ($('mobil') != null) { url=url+"&mobil="+$('mobil').getValue()}
  if ($('fax') != null) { url=url+"&fax="+$('fax').getValue()}
  if ($('deseo') != null) { url=url+"&ofertas="+$('deseo').checked}




  url=url+"&sid="+Math.random()

var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$('OVERADDED').innerHTML = ""+loadialog+url+""
document.getElementById('shade').style.display="block";
document.getElementById('added').style.display="block";
document.getElementById('OVERADDED').style.display="block";


  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { 
				$(donde).innerHTML = e.responseText ; 
				
				document.getElementById('shade').style.display="none";
				document.getElementById('added').style.display="none";
				document.getElementById('OVERADDED').style.display="none";
				$('login').value=$('loginreg').getValue() ;
				}  
                 }
 });
 

}


}










 
 function recargarCP() 
 {
  zpoblacion.loadXML ("http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/poblacionesXMLinv?filtro="+zcp.getComboText());
  new Ajax.Request("http://www.splendidtravel.es/cgi-bin/vestibule.exe/provinciasXML?filtro="+zcp.getComboText()+'&tipo=1', { method: 'get', 
  	onSuccess: function(e) {
  		           if (e.responseText != "") { zprovincia.setComboText (e.responseText); }  
               }
  });
  return false;	
 }
 



function recargarpoblaciones() {

  zpoblacion.loadXML ("http://www.splendidtravel.es/cgi-bin/vestibule.exe/poblacionesXML?filtro=alme");

}


function writepoblacion(){
 if ( document.getElementById('newpoblacion') != null )  {
     window.dhx_globalImgPath="http://www.splendidtravel.es/imgShop/";
     zpoblacion=new dhtmlXCombo("newpoblacion","alfa2",167);
     zpoblacion.enableFilteringMode(true,"http://www.splendidtravel.es/cgi-bin/vestibule.exe/poblacionesXML",true);
     }
    
}

function writecp(){
    if ( document.getElementById('newcp') != null )  {
      window.dhx_globalImgPath="http://www.splendidtravel.es/imgShop/";
      zcp=new dhtmlXCombo("newcp","alfa2",167);
     }
}


function writetipocliente(){

  if ( document.getElementById('tipocliente') != null )  {
     window.dhx_globalImgPath="http://www.splendidtravel.es/imgShop/";
     ztipocliente=new dhtmlXCombo("tipocliente","alfa2",167);
     ztipocliente.loadXML("http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/tipocliente");     
     ztipocliente.addOption([['1','Mayorista',''],['2','Minorista',''],['3','Exento','']]);
    } 

}


function writeprovincia(){
  if ( document.getElementById('newprovincia') != null )  {
     window.dhx_globalImgPath="http://www.splendidtravel.es/imgShop/";
     zprovincia=new dhtmlXCombo("newprovincia","alfa2",167);
   }
}

function writepais(){
 if ( document.getElementById('newpais') != null )  {
     window.dhx_globalImgPath="http://www.splendidtravel.es/imgShop/";
     zpais=new dhtmlXCombo("newpais","alfa2",167);
     }
}

function writediafecha(){
  if ( document.getElementById('diafecha') != null )  {
     window.dhx_globalImgPath="http://www.splendidtravel.es/imgShop/";
     zdiafecha=new dhtmlXCombo("diafecha","alfa2",62);
     zdiafecha.addOption([['1','1'],['2','2'],['3','3'],['4','4'],['5','5'],['6','6'],['7','7'],['8','8'],['9','9'],['10','10']]);
     zdiafecha.addOption([['11','11'],['12','12'],['13','13'],['14','14'],['15','15'],['16','16'],['17','17'],['18','18'],['19','19'],['20','20']]);
     zdiafecha.addOption([['21','21'],['22','22'],['23','23'],['24','24'],['25','25'],['26','26'],['27','27'],['28','28'],['29','29'],['30','30'],['31','31']]);
    }
}


function writemesfecha(){
  if ( document.getElementById('mesfecha') != null )  {
     window.dhx_globalImgPath="http://www.splendidtravel.es/imgShop/";
     zmesfecha=new dhtmlXCombo("mesfecha","alfa2",62);
     zmesfecha.loadXML("http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/meses");
    }


}

function writeyearfecha(){
  if ( document.getElementById('yearfecha') != null )  {
     window.dhx_globalImgPath="http://www.splendidtravel.es/imgShop/";
     zyearfecha=new dhtmlXCombo("yearfecha","alfa2",62);
     zyearfecha.loadXML("http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/years");
    }

}




function login(donde)
{



document.location.href='#';

  url="http://www.splendidtravel.es/cgi-bin/usuarios/users.exe/login?idanonimo="+anom+"&login="+$('login').getValue()+"&pass="+$('pass').getValue()
  url=url+"&sid="+Math.random()


  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML =  e.responseText; getsesion(); }  
                 }
 });

return false;

} 




function login2(donde)
{


  document.location.href='#';


  url="http://www.splendidtravel.es/cgi-bin/usuarios/users.exe/login?idanonimo="+anom+"&login="+$('login2').getValue()+"&pass="+$('pass2').getValue()
  url=url+"&sid="+Math.random()

  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $('login').value = $('login2').getValue();$('pass').value = $('pass2').getValue();$(donde).innerHTML = e.responseText ;getsesion();  }  
                 }
 });
 
} 


function getsesion()
{

  document.location.href='#';

  url="http://www.splendidtravel.es/cgi-bin/usuarios/users.exe/getsesion?login="+$('login').getValue()+"&pass="+$('pass').getValue()
  url=url+"&sid="+Math.random()

  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { sesion = e.responseText ; getdatosusuario(divuser); }  
                 }
 });
 
} 




function getdatosusuario(donde)
{



  document.location.href='#';

  url="http://www.splendidtravel.es/cgi-bin/usuarios/users.exe/getdatosusuario?idsesion="+sesion

  if ($('login') != null) {url=url+ "&login="+$('login').getValue()+"&pass="+$('pass').getValue()}

  url=url+"&sid="+Math.random()


  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML=e.responseText ; adddata(); }  
                 }
 });

 
}



function logout(donde)
{


var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"


  document.location.href='#';
  sesion="";
  
  $(donde).innerHTML ="<div id=labeluser>Usuario:</div><div id=conimg><input type=text id=login name=login></div>"
  $(donde).innerHTML = $(donde).innerHTML + "<div id=labeluser>Contraseña:</div><div id=conimg><input type=password id=pass name=pass></div>"
  $(donde).innerHTML = $(donde).innerHTML + "<DIV ID=botonregistro><a href=# onClick=formregistro('CENTRAL');><img src=http://www.splendidtravel.es/imgshop/registro.jpg></a></DIV>"
  $(donde).innerHTML = $(donde).innerHTML + "<DIV ID=botonentrar><a href=# onClick=login('CENTRAL');><img src=http://www.splendidtravel.es/imgshop/botonentrarsmall.jpg></a></DIV>"
  $(donde).innerHTML = $(donde).innerHTML + "<div id=linkcontra><img src=http://www.splendidtravel.es/imgshop/flecha.jpg align=absmiddle><a href=# onclick=showcontra('central',sesion,anom); id=contra> Si ha olvidado su contraseña, pulse aquí.</a></div>"
  
showdestacados('CENTRAL',sesion,anom);
shownovedades('CENTRAL',sesion,anom);
quitardata();

} 


function logoutusuario(donde)
{


var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"


  document.location.href='#';
  sesion="";
  
  $(donde).innerHTML ="<div id=labeluser>Usuario:</div><div id=conimg><input type=text id=login name=login></div>"
  $(donde).innerHTML = $(donde).innerHTML + "<div id=labeluser>Contraseña:</div><div id=conimg><input type=password id=pass name=pass></div>"
  $(donde).innerHTML = $(donde).innerHTML + "<DIV ID=botonregistro><a href=# onClick=formregistro('CENTRAL');><img src=http://www.splendidtravel.es/imgshop/registro.jpg></a></DIV>"
  $(donde).innerHTML = $(donde).innerHTML + "<DIV ID=botonentrar><a href=# onClick=login('CENTRAL');><img src=http://www.splendidtravel.es/imgshop/botonentrarsmall.jpg></a></DIV>"
  $(donde).innerHTML = $(donde).innerHTML + "<div id=linkcontra><img src=http://www.splendidtravel.es/imgshop/flecha.jpg align=absmiddle><a href=# onclick=showcontra('central',sesion,anom); id=contra> Si ha olvidado su contraseña, pulse aquí</a></div>"
  
quitardata();

} 


function writecalendar()
{
	document.write(getCalendarStyles());
        var cfecha = new CalendarPopup("divfecha");
        cfecha.setTodayText("Hoy");
	cfecha.setWeekStartDay(1);
	cfecha.setMonthNames("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
	cfecha.setMonthAbbreviations("Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic");
	cfecha.setDayHeaders("D","L","M","M","J","V","S");
}



function setproducto(donde,cat,subcat,pagina,idses,idanon){

document.location.href='#';

//var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
//loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/image/shop/loading.swf>"
//loadialog = loadialog + "<param name=quality value=high>"
//loadialog = loadialog + "<embed src=http://www.splendidtravel.es/image/shop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"
//$('central').innerHTML = "prueba";


var total = document.getElementsByName("sublp_"+donde);

cerrartodomenuprincipal();

for (var i = 0; i < total.length; i++ ) {
         if (total[i].style.display == "block") {   total[i].style.display = "none";}
		else {   total[i].style.display = "block"; 

 }   
	
showlistaproductos('central',donde,cat,subcat,pagina,idses,idanon);}

return false;

}



function setsubproducto(donde,cat,subcat,pagina,idses,idanon){

cerrartodosubmenu()

var total = document.getElementsByName("subsublp_"+donde+"_"+cat);

for (var i = 0; i < total.length; i++ ) {
                         total[i].style.display = "block"; 
					 
    }  

    showlistaproductos('central',donde,cat,subcat,pagina,idses,idanon);
    
    return false;

}

function setsubsubproducto(donde,cat,subcat,pagina,idses,idanon){

    document.location.href='#';

    showlistaproductos('central',donde,cat,subcat,pagina,idses,idanon);

    return false;

}



function cerrartodomenuprincipal(){

var ar = document.getElementById("MENUPRODUCTOS").getElementsByTagName("div"); 
     for (var i=0; i<ar.length; i++){
		if (ar[i].className=="sublineaproductos") //DynamicDrive.com change
				ar[i].style.display = "none";
			}

var ar = document.getElementById("MENUPRODUCTOS").getElementsByTagName("div"); 
     for (var i=0; i<ar.length; i++){
		if (ar[i].className=="subsublineaproductos") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
}

function cerrartodosubmenu(){


var ar = document.getElementById("MENUPRODUCTOS").getElementsByTagName("div"); 
     for (var i=0; i<ar.length; i++){
		if (ar[i].className=="subsublineaproductos") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
}

function esconder() {

document.getElementById('added').style.display="none";
document.getElementById('OVERADDED').style.display="none";
document.getElementById('shade').style.display="none";

return false;
}



function mostrar(id,idsesion,idanonimo) {


if (isInteger($('canped').getValue() ) && ($('canped').getValue() != "") && (parseInt($('canped').getValue())>0 )) {

 
 
  addcarro(id,idsesion,idanonimo);
  document.getElementById('shade').style.display="block";
  document.getElementById('added').style.display="block";
  document.getElementById('OVERADDED').style.display="block";

  document.location.href='#';

}

else
{
alert('La Cantidad solo puede ser un numero entero mayor de 0/ The Quantity must be an Integer Value and greater than 0');
}


return false;


}


function eliminararticulo(id,idsesion,idanonimo) {


document.getElementById('OVERADDED').style.display="block";
document.getElementById('added').style.display="block";
document.getElementById('shade').style.display="block";

document.getElementById('OVERADDED').innerHTML="<DIV id=TEXTO> ¿Esta seguro de querer eliminar el articulo del carro?</div>"
document.getElementById('OVERADDED').innerHTML=document.getElementById('OVERADDED').innerHTML+"<DIV id=TEXTO> Are you sure that you want to delete this article?</div>"
document.getElementById('OVERADDED').innerHTML= document.getElementById('OVERADDED').innerHTML + "<DIV id=botonsi><a href=# onClick=borrararticulocarro('"+id+"','"+idsesion+"','"+idanonimo+"');><img src=http://www.splendidtravel.es/imgshop/si.gif border=0 ></a></div>"
document.getElementById('OVERADDED').innerHTML= document.getElementById('OVERADDED').innerHTML + "<DIV id=botonno><a href=# onClick=esconder();><img src=http://www.splendidtravel.es/imgshop/no.gif border=0 ></a></div>"
document.location.href='#';

return false;


}

function popprint(idses,idanon,numped){

 window.open('http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/popprint?idanonimo='+idanon+'&idsesion='+idses+'&numped='+numped,'','width=650,height=500,scrollbars=yes')
}


function comprobarMAIL(str) 
 {
  var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	
	if (str.indexOf(at)==-1) return false
  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) return false
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) return false
  if (str.indexOf(at,(lat+1))!=-1) return false
  if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) return false
  if (str.indexOf(dot,(lat+2))==-1) return false
  if (str.indexOf(" ")!=-1) return false

  return true					
 }



function adddata() {

if (anom!="") {
var l;

urlbase= "www.dnsnavia.com/splendidtravel"
for (x=1; x<=document.getElementsByTagName("a").length; x++) {


  l=document.getElementsByTagName("a")[x-1].href;
  var bc=l;

 //Primero hemos de quitar el idsesion y el idanonimo de la lista.

 if (l.indexOf("&idsesion=") != -1){ 
         var stri= l.substring(0,l.indexOf("&idsesion="));
        
	 l=stri;
   
      }

//Y luego le añadimos el nuevo

  if (   (l.indexOf(".jpg")== -1) && (l.indexOf(urlbase) != -1) ){  document.getElementsByTagName("a")[x-1].href = l+"&idsesion="+sesion+"&idanonimo="+anom; }

  if (bc.indexOf("#") != -1)  {document.getElementsByTagName("a")[x-1].href=document.getElementsByTagName("a")[x-1].href+"#"}
}
}

}


function quitardata() {
 


   var l;

   urlbase= "www.dnsnavia.com/splendidtravel"

   for (x=1; x<=document.getElementsByTagName("a").length; x++) {

		l=document.getElementsByTagName("a")[x-1].href;
		var bc=l;

		if (l.indexOf("&idsesion=") != -1){ 
         		var stri= l.substring(0,l.indexOf("&idsesion="));        
			l=stri;
					      }
		

  if (   (bc.indexOf("&idsesion=") != -1)){document.getElementsByTagName("a")[x-1].href = l+"&idsesion=&idanonimo="+anom; }

  if (bc.indexOf("#") != -1)  {document.getElementsByTagName("a")[x-1].href=document.getElementsByTagName("a")[x-1].href+"#"}
		}
  





}



function showbuscador(donde,idses,idanon)
{

var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"

  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/buscador?idsesion="+sesion+"&idanonimo="+idanon
  url=url+"&sid="+Math.random()

  new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText; }  
                 }
 });

} 


function finalizar(donde,idses,idanon,numped)
{
var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loadingfin.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loadingfin.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
     document.location.href='#';

  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/finalizar?idsesion="+sesion+"&idanonimo="+idanon+"&numped="+numped
  url=url+"&sid="+Math.random()


  new Ajax.Request(url, { method: 'get', 
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText ;showcarro(divcarro,sesion,idanon);}  
                 }
 });
 

} 



function addcarro(id,idses,idanon)
{

  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/addcarro?id="+id+"&idsesion="+sesion+"&idanonimo="+idanon
  url=url+"&cantidad="+$('canped').getValue()+"&sid="+Math.random()



if ($('talla') != null){ 

  if (document.ftalla.talla.length != null) {
              
		for(i=0;i<document.ftalla.talla.length;i++)
                       if(document.ftalla.talla[i].checked)  {url=url+"&talla="+document.ftalla.talla[i].value}
		  }
   else
 {
   url=url+"&talla="+document.ftalla.talla.value
 }
}

if ($('color') != null){ 
  if (document.fcolor.color.length != null) {
              
		for(i=0;i<document.fcolor.color.length;i++)
                       if(document.fcolor.color[i].checked)  {url=url+"&color="+document.fcolor.color[i].value}
		  }
   else
 {
  url=url+"&color="+document.fcolor.color.value
 }
}





  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $('OVERADDED').innerHTML = e.responseText; }  
                 }
 });



  showcarro(divcarro,idses,idanon);

} 



function borrararticulocarro(id,idses,idanon)
{

  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/borrarcarro?id="+id+"&idsesion="+sesion+"&idanonimo="+idanon
  url=url+"&sid="+Math.random()

  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") {   
 					showcarro(divcarro,sesion,idanon);
				        showdetallecarro('CENTRAL',sesion,idanon);
				        $('OVERADDED').innerHTML = e.responseText; }  
                 }
 });
 

  
} 


var xmlHttp2
var lb
var url

function buscar(donde,idses,idanon,pagina,qb)
{
var concepto;
if (qb=="") {concepto=$('que').getValue();}
  else {concepto=qb;}

if (concepto == "") {
  alert('Debe introducir un concepto de búsqueda \n You must fill the search concept');
}
else
{

var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
  document.location.href='#';







 url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/buscar?pagina="+pagina+"&que="+concepto+"&idsesion="+sesion+"&idanonimo="+idanon
 url=url+"&sid="+Math.random()


  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText; }  
                 }
 });

}
} 


function showcarro(donde,idses,idanon)
{


var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
 
 url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/carro?idsesion="+sesion+"&idanonimo="+idanon
  url=url+"&sid="+Math.random()
 

  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText; }  
                 }
 });

} 


function confirmarpaso1(donde,idses,idanon)
{
var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
     document.location.href='#';

  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/confirmarpaso1?idsesion="+sesion+"&idanonimo="+anom
  url=url+"&sid="+Math.random()

  new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText ;}  
                 }
 });
esconder();

} 


function confirmarpaso2(donde,idses,idanon)
{
var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$('OVERADDED').innerHTML = ""+loadialog+""
document.getElementById('shade').style.display="block";
document.getElementById('added').style.display="block";
document.getElementById('OVERADDED').style.display="block";

  document.location.href='#';
  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/confirmarpaso2?idsesion="+sesion+"&idanonimo="+anom
  url=url+"&sid="+Math.random()+"&pago="+$('pago').getValue()+"&comentarios="+$('comentarios').getValue()

  new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { 
					$(donde).innerHTML = e.responseText ;
					document.getElementById('shade').style.display="none";
					document.getElementById('added').style.display="none";
					document.getElementById('OVERADDED').style.display="none";
					}  
                 }
 });

} 

var url

function showdestacados(donde,idses,idanon)
{

var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"

 url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/destacados?idsesion="+sesion+"&idanonimo="+idanon
 url=url+"&sid="+Math.random()

 new Ajax.Request(url, { method: 'get', asynchronous: true, 
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = $(donde).innerHTML = '<div id="logomain"><img src="http://www.splendidtravel.es/imgshop/mainimg.jpg"></div>' +e.responseText; igualar();}  
                 }
 });


} 


function shownovedades(donde,idses,idanon)
{

var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"



 url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/novedades?idsesion="+sesion+"&idanonimo="+idanon
 url=url+"&sid="+Math.random()

 new Ajax.Request(url, { method: 'get', asynchronous: true, 
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = $(donde).innerHTML+e.responseText; igualar2();}  
                 }
 });
 

} 



function igualar(){

maxh=0;

for (x=1; x<=document.getElementsByTagName("div").length; x++) {


	 l = document.getElementsByTagName("div")[x-1].name;

         if (l == "lproddes") {
		
			if (maxh<document.getElementsByTagName("div")[x-1].offsetHeight) {
				maxh=document.getElementsByTagName("div")[x-1].offsetHeight;

				}
	    		 }
 
  

		}


for (x=1; x<=document.getElementsByTagName("div").length; x++) {


	 l = document.getElementsByTagName("div")[x-1].name;

         if (l == "lproddes") {
		
			document.getElementsByTagName("div")[x-1].style.height=maxh;

				
	    		 }
 
  

		}


}



function igualar2(){

maxh=0;

for (x=1; x<=document.getElementsByTagName("div").length; x++) {


	 l = document.getElementsByTagName("div")[x-1].name;

         if (l == "lprod") {
		
			if (maxh<document.getElementsByTagName("div")[x-1].offsetHeight) {
				maxh=document.getElementsByTagName("div")[x-1].offsetHeight;

				}
	    		 }
 
  

		}


for (x=1; x<=document.getElementsByTagName("div").length; x++) {


	 l = document.getElementsByTagName("div")[x-1].name;

         if (l == "lprod") {
		
			document.getElementsByTagName("div")[x-1].style.height=maxh;

				
	    		 }
 
  

		}


}


function showdetallecarro(donde,idses,idanon)
{
var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
 
  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/detallecarro?idsesion="+sesion+"&idanonimo="+idanon
  url=url+"&sid="+Math.random()

  new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText ;}  
                 }
 });

} 



function showdetalleproducto(donde,id,idses,idanon)
{
var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/detalleproducto?idsesion="+sesion+"&idanonimo="+idanon+"&id="+id
  url=url+"&sid="+Math.random()

  new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText; }  
                 }
 });

} 


function showlistaproductos(donde,que,cate,subcat,pagina,idses,idanon)
{
var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
 url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/listaproductos?familia="+que+"&categoria="+cate+"&subcategoria="+subcat+"&pagina="+pagina+"&idsesion="+sesion+"&idanonimo="+idanon
 url=url+"&sid="+Math.random()

  new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText; }  
                 }
 });


} 


function showmenutienda(donde,idses,idanon)
{
var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/menutienda?idsesion="+sesion+"&idanonimo="+idanon
  url=url+"&sid="+Math.random()


  new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText; }  
                 }
 });
} 



function showmenutoptienda(donde,idses,idanon)
{
var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/menutoptienda?idsesion="+sesion+"&idanonimo="+idanon
  url=url+"&sid="+Math.random()


  new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText; }  
                 }
 });
} 



function showprint(donde,idses,idanon,numped)
{
var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/detalleimpresion?idanonimo="+idanon+"&numped="+numped
  url=url+"&sid="+Math.random()

  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText ;}  
                 }
 });

} 




function modcarro(donde,idprod,cantidad,idses,idanon)
{
  
  var  perm = 1;

  if (cantidad == "0") {
     
	  if ($('nuevacantidad')!= null) { 
			


			if ($('nuevacantidad').value == "") {
								perm=0;
								alert('Debes indicar una cantidad para poder modificarla\nYou must enter a quantity to modify it');
				
								}
			else
				{
				if ( (isInteger($('nuevacantidad').getValue())) && ($('nuevacantidad').getValue() != "")  && (parseInt($('nuevacantidad').getValue())>0 ) ){permm=1;}
  					else
						{
						perm=0;
						alert('La Cantidad no puede ser decimal mayor de 0\nThe quantity cannot be a decimal value greater than 0');
							}
				}


				}

	}


 if (perm==1) {

  var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
  loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
  loadialog = loadialog + "<param name=quality value=high>"
  loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


 // $(donde).innerHTML = "<div id=LOADER>"+loadialog+"</div>"
  
  url="http://www.splendidtravel.es/cgi-bin/v5shop/v5shop.exe/modcarro?id="+idprod+"&idsesion="+sesion+"&idanonimo="+idanon
  if (cantidad != "0") {url=url+"&cantidad="+cantidad+"&sid="+Math.random()}
    else 
     {
       if ($('nuevacantidad')!= null) { url=url+"&cantidad="+$('nuevacantidad').value+"&sid="+Math.random() }
     }
  


$(donde).innerHTML =url;
  new Ajax.Request(url, { method: 'get', asynchronous: false,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { 
  					showcarro(divcarro,sesion,idanon);
				        showdetallecarro(donde,sesion,idanon);
   				        document.getElementById('shade').style.display="none";
				        document.getElementById('added').style.display="none";
				        document.getElementById('OVERADDED').style.display="none";
				}  
                 }
 });

}

} 



function popmodcarro(donde,idprod,nombre,cantidad,idses,idanon)
{
  
  document.getElementById('shade').style.display="block";
  document.getElementById('added').style.display="block";
  document.getElementById('OVERADDED').style.display="block";

  $('OVERADDED').innerHTML="<DIV id=texto>Modificar cantidad / Modify Quantity</div>";
  $('OVERADDED').innerHTML=$('OVERADDED').innerHTML+"<DIV id=subtexto>"+nombre+"</div>";
  $('OVERADDED').innerHTML=$('OVERADDED').innerHTML+"<DIV id=cantidad>Antigua Cantidad: "+cantidad+"</div>";
  $('OVERADDED').innerHTML=$('OVERADDED').innerHTML+"<DIV id=cantidad>Nueva Cantidad: <input id=nuevacantidad name=nuevacantidad value="+cantidad+" onkeypress=soloNumeros(event.keypress) ></div>";
  $('OVERADDED').innerHTML=$('OVERADDED').innerHTML+"<DIV id=botoncambiar><a href=# onclick=modcarro('"+donde+"','"+idprod+"','0','"+idses+"','"+idanon+"')><img src=http://www.splendidtravel.es/imgshop/cambiar.jpg></a></div>";
  $('OVERADDED').innerHTML=$('OVERADDED').innerHTML+"<DIV id=botoncancelar><a href=# onclick=esconder()><img src=http://www.splendidtravel.es/imgshop/cancelar.jpg></a></div>";

} 




function cargarbuscadorsucursales()
{


  url="http://www.splendidtravel.es/cgi-bin/sucursales/sucursales.exe/cargarselect?que=pais";
  url=url+"&sid="+Math.random()


  new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $('suc_pais').innerHTML = e.responseText; }  
                 }
 });
return false;
} 



function buscarsucursal(donde)
{

var loadialog = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=300 height=150>"
loadialog = loadialog + "<param name=movie value=http://www.splendidtravel.es/imgshop/loading.swf>"
loadialog = loadialog + "<param name=quality value=high>"
loadialog = loadialog + "<embed src=http://www.splendidtravel.es/imgshop/loading.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=300 height=150></embed></object>"


$(donde).innerHTML = "<div id=LOADERSUCURSAL>"+loadialog+"</div>"
  url="http://www.splendidtravel.es/cgi-bin/sucursales/sucursales.exe/busqueda?idsesion="+sesion+"&idanonimo="+anom;
  url=url+"&sid="+Math.random()
 
  if ($('cpsucursal') != null) {url=url+"&cp="+$('cpsucursal').value;}
  if ($('poblacionsucursal') != null) {url=url+"&poblacion="+$('poblacionsucursal').value;}
  if ($('provinciasucursal') != null) {url=url+"&provincia="+$('provinciasucursal').value;}
  if ($('paissucursal') != null) {url=url+"&pais="+$('paissucursal').value;}

  new Ajax.Request(url, { method: 'get', asynchronous: true,
  	  onSuccess: function(e) {
  		             if (e.responseText != "") { $(donde).innerHTML = e.responseText; }  
                 }
 });
return false;
} 





