var http_path = "";

     if ( document.location.href.search('/booking_v3/') != -1 ) http_path = '../../';
else if ( document.location.href.search('.php') != -1 || document.location.href.search('/webcams/') != -1 ) http_path = '../';

//******************************************************************//
//************************ Mostrar informe       *******************//
//******************************************************************//

function infoGlobito(mEvent) {
     if ( (obj = _obj(mEvent)) == null ) return;
     if ( !obj.id ) return;
     var arr = reg[obj.id];
     var texto = '<b>'+arr[0]+'</b>';
     _globito_dibujar(mEvent,texto);

}

function _obj(mEvent) {

     if (mEvent.srcElement) var obj = mEvent.srcElement;
     else if (mEvent.target) var obj = mEvent.target;
     return obj;
}

function ajustar(obj1,obj2,menos) {

     //alert(document.getElementById(obj2));

     if ( document.getElementById(obj1) == null ||document.getElementById(obj2) == null ) return false;
     var alto = document.getElementById(obj1).offsetHeight-menos;
     if ( alto < 1 ) return;
     document.getElementById(obj2).style.height = alto+"px";
     document.getElementById(obj2).setAttribute("height", alto);
}

function ingresarOpinion(id_hotel) {

    var url = http_path+'server/opiniones.ingresar.php?IdHotel='+id_hotel;
    abrirPopup(url,"ingresarOpinion",'600','430');
}

function hiddeForm() {
    WCH.Apply('divBannerUp');
}

function showForm() {
    WCH.Discard('divBannerUp');
}

function getXMLHttpRequest(){
        var req=false;
        if (window.XMLHttpRequest){
                try{
                        req=new XMLHttpRequest();
                }catch(e){
                        req=false;
                }
        }else{
                if (window.ActiveXObject){
                        try{
                                req=new ActiveXObject("Msxml2.XMLHTTP");
                        }catch(e){
                                try{
                                        req=new ActiveXObject("Msxml.XMLHTTP");
                                }catch(e){
                                        req=false;
                                }
                        }
                }
        }
        return req;
}

var httpReq=getXMLHttpRequest();
/*function leerUrl(method,url){

     httpReq.open( method , url ,false);
     httpReq.send( null );
     document.write(httpReq.responseText);
}*/

function leerUrl(method,url,query){

     httpReq.open( method , url ,false);

     if ( method == "POST" )
          httpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

     httpReq.send(query);

     return httpReq.responseText;
}

function cargarCookiesBuscador(fm) {

     _cookie = new cookies("ask");

     if ( getCookie( 'int_pasajeros' )  ) fm.paxs.value           = getCookie( 'int_pasajeros' );
     if ( getCookie( 'url_seccion' ) && fm.url_seccion != null )   fm.url_seccion.value    = getCookie( 'url_seccion' );



     if ( getCookie( 'arrDate_day' ) ) {
          fm.arrDate_day.value    = getCookie( 'arrDate_day' );
          fm.arrDate_mon.value    = getCookie( 'arrDate_mon' );
          fm.arrDate_year.value   = getCookie( 'arrDate_year' );
          fm.arrDate.value        = getCookie( 'arrDate_day' )+"/"+getCookie( 'arrDate_mon' )+"/"+getCookie( 'arrDate_year' );
     }

     if ( getCookie( 'deptDate_day' ) ) {
          fm.deptDate_day.value    = getCookie( 'deptDate_day' );
          fm.deptDate_mon.value    = getCookie( 'deptDate_mon' );
          fm.deptDate_year.value   = getCookie( 'deptDate_year' );
          fm.deptDate.value        = getCookie( 'deptDate_day' )+"/"+getCookie( 'deptDate_mon' )+"/"+getCookie( 'deptDate_year' );
     }
}

function irACategoria(fm) {


     var url = document.getElementById('url_seccion').value;

     setCookie( 'int_pasajeros' , document.getElementById('paxs').value );
     setCookie( 'arrDate_day',    document.getElementById('arrDate_day').value );
     setCookie( 'arrDate_mon',    document.getElementById('arrDate_mon').value );
     setCookie( 'arrDate_year',   document.getElementById('arrDate_year').value );
     setCookie( 'deptDate_day',   document.getElementById('deptDate_day').value );
     setCookie( 'deptDate_mon',   document.getElementById('deptDate_mon').value );
     setCookie( 'deptDate_year',  document.getElementById('deptDate_year').value );
     setCookie( 'url_seccion',    url );

     document.location = url;
}


function validar_formulario_comercio(fm) {

     _cookie = new cookies("ask");

     if ( !fm.chr_nombre.value )   { alert('Debe completar el campo "Nombre y Apellido"');fm.chr_nombre.focus();return false; }
     if ( !fm.eml_mail.value )     {  alert('Debe completar el campo "Correo electrónico"');fm.eml_mail.focus();return false; }
     if ( !fm.txt_consulta.value ) { alert('Debe completar el campo "Consulta"');fm.txt_consulta.focus();return false; }

     setCookie( 'chr_nombre' ,          fm.chr_nombre.value );
     setCookie( 'eml_mail' ,            fm.eml_mail.value );
     setCookie( 'txt_consulta',         fm.txt_consulta.value );

     //fm.url_desde.value = document.location.href;

     return true;
}

function mostrarFoto(chr_imagen) {
     url = http_path+'server/foto.php?chr_imagen='+chr_imagen;
     abrirPopup(url,"ampliarFoto","350","200" );
}

function enviarAmigo(id_hotel) {

     var url = http_path+'server/enviar.amigo.php?id_hotel='+id_hotel;
     abrirPopup(url,"enviarAmigo",'300','300');
}

function vista360(id_hotel) {

     var url = http_path+'server/vista360.php?id_hotel='+id_hotel;
     abrirPopup(url,"vista360",'600','380');
}

function imprimirHotel(id_hotel) {
     var url   = http_path+'server/hotel.imprimir.php?id_hotel='+id_hotel+"&imprimir=1";
     abrirPopup(url,"imprimirHotel",680,450,false,false,true,true);
}

function VerFoto(alto,largo,img) {
     largo -= 30;
     alto -= 50;
     var url   = http_path+"templates/verfoto.php?img="+img;
     abrirPopup(url,"foto",largo,alto);
}

function VerFotoCom(largo,alto,img,Sitio) {
     var url   = http_path+"directorio/templates/verfoto.php?img="+img;
     abrirPopup(url,"fotocom",largo,alto);
}

function VerFotoAgenda(largo,alto,img,Sitio) {
     var url   = http_path+"agenda/templates/verfoto.php?img="+img;
     abrirPopup(url,"fotocom",largo,alto);
}

function ImpCupon(IdComercio) {

     var url = http_path+"directorio/templates/cupon.php?IdComercio="+IdComercio;
     abrirPopup(url,"cupon","510","425");
}

function VerMapa(MapaXPos,MapaYPos,MapaCodigo) {

     var url = http_path+"directorio/templates/cybermapa.php?MapaXPos="+MapaXPos+"&MapaYPos="+MapaYPos+"&MapaCodigo="+MapaCodigo;
     abrirPopup(url,"cybermapa","560","480");
}

function VerVista360(IdComercio) {

     var url = http_path+"directorio/templates/vista360.php?IdComercio="+IdComercio;
     abrirPopup(url,"vista360","268","229");
}


function validar_formulario_contacto(fm) {

     _cookie = new cookies("ask");

     setCookie( 'chr_nombre' ,          fm.chr_nombre.value );
     setCookie( 'chr_apellido' ,        fm.chr_apellido.value );
     setCookie( 'eml_mail' ,            fm.eml_mail.value );
     setCookie( 'txt_consulta',         fm.txt_consulta.value );

     //fm.url_desde.value = document.location.href;

     return true;
}

function cargarCookies(fm) {

     _cookie = new cookies("ask");



     if ( getCookie( 'chr_nombre' )    && fm.chr_nombre != null )    fm.chr_nombre.value     = getCookie( 'chr_nombre' );
     if ( getCookie( 'chr_apellido' )  && fm.chr_apellido != null )  fm.chr_apellido.value   = getCookie( 'chr_apellido' );
     if ( getCookie( 'chr_telefono' )  && fm.chr_telefono != null )  fm.chr_telefono.value   = getCookie( 'chr_telefono' );
     if ( getCookie( 'eml_mail' )      && fm.eml_mail != null )      fm.eml_mail.value       = getCookie( 'eml_mail' );
     if ( getCookie( 'int_pasajeros' ) && fm.int_pasajeros != null ) fm.int_pasajeros.value  = getCookie( 'int_pasajeros' );
     if ( getCookie( 'txt_consulta' )  && fm.txt_consulta != null )  fm.txt_consulta.value   = getCookie( 'txt_consulta' );



     if ( getCookie( 'arrDate_day' ) && fm.arrDate_day != null ) {
          fm.arrDate_day.value    = getCookie( 'arrDate_day' );
          fm.arrDate_mon.value    = getCookie( 'arrDate_mon' );
          fm.arrDate_year.value   = getCookie( 'arrDate_year' );
          fm.arrDate.value        = getCookie( 'arrDate_day' )+"/"+getCookie( 'arrDate_mon' )+"/"+getCookie( 'arrDate_year' );
     }

     if ( getCookie( 'deptDate_day' ) && fm.deptDate_day != null ) {
          fm.deptDate_day.value    = getCookie( 'deptDate_day' );
          fm.deptDate_mon.value    = getCookie( 'deptDate_mon' );
          fm.deptDate_year.value   = getCookie( 'deptDate_year' );
          fm.deptDate.value        = getCookie( 'deptDate_day' )+"/"+getCookie( 'deptDate_mon' )+"/"+getCookie( 'deptDate_year' );
     }

     if  ( getCookie( 'int_cotizacion_grupo' ) == 1 ) fm.int_cotizacion_grupo.checked = true;
}



function validar_formulario(fm) {

     _cookie = new cookies("ask");

     if ( !valForm(fm) ) return false;


     setCookie( 'chr_nombre' ,      fm.chr_nombre.value );
     setCookie( 'chr_apellido' ,    fm.chr_apellido.value );
     setCookie( 'chr_telefono' ,    fm.chr_telefono.value );
     setCookie( 'eml_mail' ,        fm.eml_mail.value.toLowerCase() );
     setCookie( 'chr_pais' ,        fm.chr_pais.value );
     setCookie( 'chr_provincia' ,   fm.chr_provincia.value );
     setCookie( 'int_pasajeros' ,   fm.int_pasajeros.value );
     setCookie( 'arrDate_day',      fm.arrDate_day.value );
     setCookie( 'arrDate_mon',      fm.arrDate_mon.value );
     setCookie( 'arrDate_year',     fm.arrDate_year.value );
     setCookie( 'deptDate_day',     fm.deptDate_day.value );
     setCookie( 'deptDate_mon',     fm.deptDate_mon.value );
     setCookie( 'deptDate_year',    fm.deptDate_year.value );
     setCookie( 'txt_consulta',     fm.txt_consulta.value );

     setCookie( 'int_cotizacion_grupo', ( fm.int_cotizacion_grupo.checked == true ? 1 : '' ) );

     //fm.url_desde.value = document.location.href;

     return true;
}


function set_cookies_form_booking(f) {

     _cookie = new cookies("ask");

     setCookie( 'eml_mail' ,             f.txtEmail.value );
     setCookie( 'chr_nombre' ,           f.txtHoldersFirstName.value );
     setCookie( 'chr_apellido' ,         f.txtHoldersLastName.value );
     setCookie( 'chr_calle' ,            f.txtAddressStreet.value );
     setCookie( 'chr_calle_numero' ,     f.txtAddressNumber.value );
     setCookie( 'chr_calle_piso' ,       f.txtAddressFloor.value );
     setCookie( 'chr_codigo_postal' ,    f.txtAddressPostalCode.value );
     setCookie( 'chr_pais' ,             f.cboCountry.value );
     setCookie( 'chr_provincia' ,        f.txtAddressCity.value );
     setCookie( 'chr_telefono' ,         f.txtPhoneNumber.value );
     setCookie( 'txt_observaciones' ,    f.txtObservaciones.value );

}

function cargarCookiesFormBooking() {

     _cookie = new cookies("ask");

     var fm = document.formulario;

     if ( getCookie( 'eml_mail' )             && fm.txtEmail             != null ) fm.txtEmail.value             = getCookie( 'eml_mail' );
     if ( getCookie( 'chr_nombre' )           && fm.txtHoldersFirstName  != null ) fm.txtHoldersFirstName.value  = getCookie( 'chr_nombre' );
     if ( getCookie( 'chr_apellido' )         && fm.txtHoldersLastName   != null ) fm.txtHoldersLastName.value   = getCookie( 'chr_apellido' );
     if ( getCookie( 'chr_calle' )            && fm.txtAddressStreet     != null ) fm.txtAddressStreet.value     = getCookie( 'chr_calle' );
     if ( getCookie( 'chr_calle_numero' )     && fm.txtAddressNumber     != null ) fm.txtAddressNumber.value     = getCookie( 'chr_calle_numero' );
     if ( getCookie( 'chr_calle_piso' )       && fm.txtAddressFloor      != null ) fm.txtAddressFloor.value      = getCookie( 'chr_calle_piso' );
     if ( getCookie( 'chr_codigo_postal' )    && fm.txtAddressPostalCode != null ) fm.txtAddressPostalCode.value = getCookie( 'chr_codigo_postal' );
     if ( getCookie( 'chr_pais' )             && fm.cboCountry           != null ) fm.cboCountry.value           = getCookie( 'chr_pais' );
     if ( getCookie( 'chr_provincia' )        && fm.txtAddressCity       != null ) fm.txtAddressCity.value       = getCookie( 'chr_provincia' );
     if ( getCookie( 'chr_telefono' )         && fm.txtPhoneNumber       != null ) fm.txtPhoneNumber.value       = getCookie( 'chr_telefono' );
     if ( getCookie( 'txt_observaciones' )    && fm.txtObservaciones     != null ) fm.txtObservaciones.value     = getCookie( 'txt_observaciones' );
}

function abrirGaleria(id_hotel,chr_foto,idioma) {
     url = http_path+'server/galeria.php?id_hotel='+id_hotel+( chr_foto ? '&chr_foto='+chr_foto : '' )+'&idioma='+idioma;
     abrirPopup(url,"galeria","634","450");
}

function abrirPopup(url,nombre,Largo,Alto,leftPos,topPos,ampliar,scroll,menubar) {

     Alto = Math.abs(Alto)+20;
     Largo = Math.abs(Largo)+20;

     if ( !leftPos && !topPos ) {

          var w = screen.width;
          var h = screen.height;
          var popW = Largo, popH = Alto;
          var leftPos = (w-popW)/2, topPos = (h-popH)/2;
     }

     window.open(url,nombre,"resizable="+(ampliar ? "yes" : "no")+",status=no,menubar="+(menubar ? "yes" : "no")+",scrollbars="+(scroll ? "yes" : "no")+",width="+Largo+",height="+Alto+",left="+leftPos+",top="+topPos+",center=1");
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function mostrar_espere() {

     var obj = document.getElementById('ifrEspere');

     if ( obj == null ) return;

     var w = getWindowWidth();
     var h = getWindowHeight();
     var popW = obj.width;
     var popH = obj.height;
     var leftPos = (w/2) - (popW/2);
     var topPos  = (h/2) - (popH/2);

     obj.style.left = leftPos;
     obj.style.top  = topPos;
}

function ocultar_espere() {

     var obj = document.getElementById('ifrEspere');
     if ( obj == null ) return;

     obj.style.left = "-500px";
     obj.style.top  = "0px";
}



function VeryEmail(emailStr) {

                var emailPat=/^(.+)@(.+)$/
                var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
                var validChars="\[^\\s" + specialChars + "\]"
                var quotedUser="(\"[^\"]*\")"
                var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
                var atom=validChars + '+'
                var word="(" + atom + "|" + quotedUser + ")"
                var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
                var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
                var matchArray=emailStr.match(emailPat)
                if (matchArray==null) return true;
                var user=matchArray[1]
                var domain=matchArray[2]
                if (user.match(userPat)==null) return true;
                var IPArray=domain.match(ipDomainPat)
                if (IPArray!=null) {
                        for (var i=1;i<=4;i++) {
                                if (IPArray[i]>255) return true;
                        }
                }

                var domainArray=domain.match(domainPat)
                if (domainArray==null) return true;

                var atomPat=new RegExp(atom,"g")
                var domArr=domain.match(atomPat)
                var len=domArr.length
                if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) {return true;}
                if (len<2) {return true;}
}

//********************************************************************************
//******************************** GLOBITO CON INFORMACION       *****************
//********************************************************************************

var old_formato    = null;
var reg            = new Array();

function _globito_dibujar(mEvent,texto) {

     document.getElementById('div_globito_inner').innerHTML = texto;

     var globo = document.getElementById('div_globito');

     //**** Setear tamaño del globo
     var globo_width  = globo.offsetWidth;
     var globo_height = globo.offsetHeight;

     //**** Setear posicion del mouse
     var mouse_pos_x  = mEvent.clientX+document.body.scrollLeft;
     var mouse_pos_y  = mEvent.clientY+document.body.scrollTop;

     //alert(mEvent.clientX);

     //**** Setear tamaño de pantalla
     var screen_width  = getWindowWidth()+document.body.scrollLeft;

     //**** Espacio width
     var espacio_width  = screen_width-mouse_pos_x;
     var espacio_height = mouse_pos_y-document.body.scrollTop;

     //**** Definir formato
          if ( espacio_width > globo_width && espacio_height > globo_height ) formato = '1';
     else if ( espacio_width > globo_width && espacio_height < globo_height ) formato = '2';
     else if ( espacio_width < globo_width && espacio_height > globo_height ) formato = '3';
                                                                         else formato = '4';




     switch(formato) {

            case '1': pos_x = mouse_pos_x + 5;
                      pos_y = mouse_pos_y - globo_height - 5;
                      break;

            case '2': pos_x = mouse_pos_x + 10;
                      pos_y = mouse_pos_y + 10;
                      break;

            case '3': pos_x = mouse_pos_x - globo_width - 5;
                      pos_y = mouse_pos_y - globo_height - 5;
                      break;

            case '4': pos_x = mouse_pos_x - globo_width - 5;
                      pos_y = mouse_pos_y + 5;
                      break;
     }



     globo.style.left = pos_x;
     globo.style.top  = pos_y;

     if ( formato == old_formato ) return;

     switch (formato) {

             case '1': var str = '<table border="0" cellspacing="0" cellpadding="0" width=200>'+
                                   '<tr>'+
                                     '<td width="16" height="16"><img src="../webart/g01.gif" width="16" height="16"></td>'+
                                     '<td class="g0100" bgcolor="#FFF5E3">&nbsp;</td>'+
                                     '<td width="16"><img src="../webart/g02.gif" width="16" height="16"></td>'+
                                   '</tr>'+
                                   '<tr bgcolor="#FFF5E3">'+
                                     '<td class="g1000">&nbsp;</td>'+
                                     '<td id="div_globito_inner" valign=top>'+texto+'</td>'+
                                     '<td class="g0010">&nbsp;</td>'+
                                   '</tr>'+
                                   '<tr>'+
                                     '<td height="46"><img src="../webart/g03.gif" width="16" height="46"></td>'+
                                     '<td background="../webart/g05.gif"><img src="../webart/g04.gif" width="35" height="46"></td>'+
                                     '<td><img src="../webart/g06.gif" width="16" height="46"></td>'+
                                   '</tr>'+
                                 '</table>';
                       break;

             case '2': var str = '<table border="0" cellspacing="0" cellpadding="0" width=200>'+
                                   '<tr>'+
                                     '<td height="46"><img src="../webart/g09.gif" width="16" height="46"></td>'+
                                     '<td background="../webart/g11.gif"><img src="../webart/g10.gif" width="35" height="46"></td>'+
                                     '<td><img src="../webart/g12.gif" width="16" height="46"></td>'+
                                   '</tr>'+
                                   '<tr bgcolor="#FFF5E3">'+
                                     '<td class="g1000">&nbsp;</td>'+
                                     '<td id="div_globito_inner" valign=top>'+texto+'</td>'+
                                     '<td class="g0010">&nbsp;</td>'+
                                   '</tr>'+
                                   '<tr>'+
                                     '<td width="16" height="16"><img src="../webart/g07.gif" width="16" height="16"></td>'+
                                     '<td class="g0001" bgcolor="#FFF5E3">&nbsp;</td>'+
                                     '<td width="16"><img src="../webart/g08.gif" width="16" height="16"></td>'+
                                   '</tr>'+
                                 '</table>';
                       break;

             case '3': var str = '<table border="0" cellspacing="0" cellpadding="0" width=200>'+
                                   '<tr>'+
                                     '<td width="16" height="16"><img src="../webart/g01.gif" width="16" height="16"></td>'+
                                     '<td class="g0100" bgcolor="#FFF5E3">&nbsp;</td>'+
                                     '<td width="16"><img src="../webart/g02.gif" width="16" height="16"></td>'+
                                   '</tr>'+
                                   '<tr bgcolor="#FFF5E3">'+
                                     '<td class="g1000">&nbsp;</td>'+
                                     '<td id="div_globito_inner" valign=top>'+texto+'</td>'+
                                     '<td class="g0010">&nbsp;</td>'+
                                   '</tr>'+
                                   '<tr>'+
                                     '<td height="46" width="16"><img src="../webart/g16.gif" width="16" height="46"></td>'+
                                     '<td background="../webart/g05.gif" align="right"><img src="../webart/g17.gif" width="36" height="46"></td>'+
                                     '<td width="16"><img src="../webart/g18.gif" width="16" height="46"></td>'+
                                   '</tr>'+
                                 '</table>';
                       break;

             case '4': var str = '<table border="0" cellspacing="0" cellpadding="0" width=200>'+
                                   '<tr>'+
                                     '<td height="46"><img src="../webart/g13.gif" width="16" height="46"></td>'+
                                     '<td background="../webart/g11.gif" align="right"><img src="../webart/g14.gif" width="35" height="46"></td>'+
                                     '<td><img src="../webart/g15.gif" width="16" height="46"></td>'+
                                   '</tr>'+
                                   '<tr bgcolor="#FFF5E3">'+
                                     '<td class="g1000">&nbsp;</td>'+
                                     '<td id="div_globito_inner" valign=top>'+texto+'</td>'+
                                     '<td class="g0010">&nbsp;</td>'+
                                   '</tr>'+
                                   '<tr>'+
                                     '<td width="16" height="16"><img src="../webart/g07.gif" width="16" height="16"></td>'+
                                     '<td class="g0001" bgcolor="#FFF5E3">&nbsp;</td>'+
                                     '<td width="16"><img src="../webart/g08.gif" width="16" height="16"></td>'+
                                   '</tr>'+
                                 '</table>';

                       break;

     }



     globo.innerHTML = str;
     old_formato = formato;
}

function _globito_ocultar() {

     var globo = document.getElementById('div_globito');
     if ( globo == null ) return;
     globo.style.left = "-1500";
}

function getWindowWidth() {
     var windowWidth = 0;
     if (typeof(window.innerWidth) == 'number') {
         windowWidth = window.innerWidth;
     }else {
         if (document.documentElement && document.documentElement.clientWidth) {
             windowWidth = document.documentElement.clientWidth;
         } else {
             if (document.body && document.body.clientWidth) {
                 windowWidth = document.body.clientWidth;
             }
         }
     }
     return windowWidth;
}

function getWindowHeight() {
     var windowHeight = 0;
     if (typeof(window.innerHeight) == 'number') {
         windowHeight = window.innerHeight;
     }else {
         if (document.documentElement && document.documentElement.clientHeight) {
             windowHeight = document.documentElement.clientHeight;
         } else {
             if (document.body && document.body.clientHeight) {
                 windowHeight = document.body.clientHeight;
             }
         }
     }
     return windowHeight;
}


//******************************************
//***** Administrar cookies
//******************************************

/*
function setCookie(name, value) {
      var expires = new Date();
      expires.setTime(today.getTime() + 3600000*24*365*3); // 3 años
      var curCookie = name + "=" + escape(value) +
                     ((expires) ? "; expires=" + expires : "");
                     //+((path) ? "; path=" + path : "") +
                     //((domain) ? "; domain=" + domain : "") +
                     //((secure) ? "; secure" : "")
      document.cookie = curCookie;
}

function getCookie( name ) {
      var start = document.cookie.indexOf( name + "=" );
      var len = start + name.length + 1;
      if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) return null;
      if ( start == -1 ) return null;
      var end = document.cookie.indexOf( ";", len );
      if ( end == -1 ) end = document.cookie.length;
      return unescape( document.cookie.substring( len, end ) );
}

function deleteCookie( name , path , domain) {
      if ( getCookie( name ) ) document.cookie = name + '=' +
         ( path ? ';path=' + path : '') +
         ( domain ? ';domain=' + domain : '' ) +
         ';expires=Thu, 01-Jan-1970 00:00:01 GMT';
}

function deleteAllCookies() {
      var Cookies = document.cookie.split("; ");
      for ( var Cnt=0; Cnt < Cookies.length; Cnt++ ) {
            var CurCookie = Cookies[Cnt].split("=");
            if ( CurCookie[0] ) deleteCookie( CurCookie[0] );
      };
};
*/
