Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/04/2011, 15:28
Rockero777
 
Fecha de Ingreso: abril-2011
Ubicación: Lima
Mensajes: 11
Antigüedad: 13 años
Puntos: 0
Pregunta Hacer que Ventana de aviso salga solo una vez

Hola! tengo un codigo javascript que hace mostrar una ventana de aviso, quisiera que solo aparezca solo una vez, como puedo hacer eso?, muchisimas gracias, este es el codigo, pero que tengo que modificarle?
Código Javascript:
Ver original
  1. //bienvenida solamente una vez por sesión del visitante (0=no, 1=yes)
  2. var once_per_browser=0
  3. var ns4=document.layers
  4. var ie4=document.all
  5. var ns6=document.getElementById&&!document.all
  6. if (ns4)
  7. crossobj=document.layers.pginicio
  8. else if (ie4||ns6)
  9. crossobj=ns6? document.getElementById("pginicio") : document.all.pginicio
  10. function closeit(){
  11. if (ie4||ns6)
  12. crossobj.style.visibility="hidden"
  13. else if (ns4)
  14. crossobj.visibility="hide"
  15. }
  16. function get_cookie4(Name) {
  17.   var search = Name + "="
  18.   var returnvalue = "";
  19.   if (document.cookie4.length > 0) {
  20.     offset = document.cookie4.indexOf(search)
  21.     if (offset != -1) {
  22.       offset += search.length
  23.       end = document.cookie4.indexOf(";", offset);
  24.       if (end == -1)
  25.       end = document.cookie4.length;
  26.       returnvalue=unescape(document.cookie4.substring(offset, end))
  27.       }
  28.    }
  29.   return returnvalue;
  30. }
  31. function showornot(){
  32. if (get_cookie4('postdisplay')==''){
  33. showit()
  34. document.cookie4="postdisplay=yes"
  35. }
  36. }
  37. function showit(){
  38. if (ie4||ns6)
  39. crossobj.style.visibility="visible"
  40. else if (ns4)
  41. crossobj.visibility="show"
  42. }
  43. if (once_per_browser)
  44. showornot()
  45. else
  46. showit()

gracias