function stopmouse(e) { 
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))  
 		return false; 
      else if  
      (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {  
 		alert("No se puede!!");
return false;  
 		}
return true; 
      } 




function ap_getObj(name) {
if (document.getElementById) {
return document.getElementById(name).style;
} else if (document.all) {
return document.all[name].style;
} else if (document.layers) {
return document.layers[name];
}
}
function ap_showWaitMessage(div,flag) {
if (!DHTML)
return;
var x = ap_getObj(div);
x.visibility = (flag) ? 'visible':'hidden'
if(! document.getElementById)
if(document.layers)
x.left=280/2;
// return true;
}





function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}



function namosw_page_left(element) 
{
  if (navigator.appName.indexOf('Netscape', 0) != -1) {
    x = element.pageX;
  } else {
    x = element.offsetLeft;
    for (el = element.offsetParent; el; el = el.offsetParent)
      x += el.offsetLeft;
  }
  return x;
}

function namosw_page_top(element) 
{
  if (navigator.appName.indexOf('Netscape', 0) != -1) {
    y = element.pageY;
  } else {
    y = element.offsetTop;
    for (el = element.offsetParent; el; el = el.offsetParent)
      y += el.offsetTop;
  }
  return y;
}

function namosw_page_right(el) {
  wid =  (navigator.appName.indexOf('Netscape', 0) != -1) ? window.innerWidth : document.body.offsetWidth;
  return wid - namosw_page_left(el);
}

function namosw_page_bottom(el) {
  hei =  (navigator.appName.indexOf('Netscape', 0) != -1) ? window.innerHeight : document.body.offsetHeight;
  return hei - namosw_page_top(el);
}

function namosw_set_visible(el, flag) {
  if (navigator.appName.indexOf('Netscape', 0) != -1) {
    el.visibility = flag ? 'show' : 'hide';
  } else {
    el.style.visibility = flag ? 'visible' : 'hidden';
  }
}

function namosw_set_pos(el, x, y)
{
  if (navigator.appName.indexOf('Netscape', 0) != -1) {
    el.left = x;
    el.top  = y;
  } else {
    el.style.pixelLeft = x;
    el.style.pixelTop  = y;
  }
}

function namosw_left(el) {
  return (navigator.appName.indexOf('Netscape', 0) != -1) ? el.left : el.style.pixelLeft;
}

function namosw_top(el) {
  return (navigator.appName.indexOf('Netscape', 0) != -1) ? el.top : el.style.pixelTop;
}

function namosw_is_relative(el) {
  return (navigator.appName.indexOf('Netscape', 0) != -1) ? el.position == 'relative' : 
                                             el.style.position == 'relative';
}

function namosw_is_space(c)
{
  return (c == ' ' || c == '\t' || c == '\r' || c == '\n');
}

function namosw_process_byword(list, index)
{
  var el = list[index];
  if (navigator.appName.indexOf('Netscape', 0) != -1)
    return;
  if (!el)
    return;
  if (el.byword == false)
    return;

  var dest = "";
  var src = el.innerHTML;
  var objNum = document.NamoAnimationObjects.length;
  var wordi = 0, i = 0, mark;
  while (i < src.length) {
    mark = i;
    while (i < src.length) {
      while (i < src.length && namosw_is_space(src.charAt(i))) i++;
      if    (i < src.length && src.charAt(i) != '<') break;
      while (i < src.length && src.charAt(i) != '>') i++;
      if    (i < src.length && src.charAt(i) == '>') i++;
    }
    dest += src.substring(mark, i);
    if (i >= src.length) break;
    dest += '<span id=\"' + el.name + 'word' + (wordi+1) + '\" style=\"position:relative\">';
    mark = i;
    while (i < src.length && !namosw_is_space(src.charAt(i)) && src.charAt(i) != '<') i++;
    while (i < src.length && namosw_is_space(src.charAt(i)) == ' ') i++;
    if (el.byword == false) while (i < src.length && src.charAt(i) != '<') i++;
    dest += src.substring(mark, i);
    dest += '</span>';
    wordi++;
  }
  el.innerHTML = dest;
  el.posLeft   = 0;
  el.style.visibility = 'visible';

  list[index] = namosw_new_animation_object(el.name+'word1', el.startCondObj, el.startCondTime, 
el.startXPos, el.startYPos, el.pathType, false, el.zoom, el.stepNum);
  for (i = 1; i < wordi; i++) {
    list[objNum+i-1] = namosw_new_animation_object(el.name+'word'+(i+1), (el.byword ? (el.name+'word'+i) : el.startCondObj), (el.byword ? 0 : el.startCondTime), el.startXPos, el.startYPos, el.pathType, false, el.zoom, el.stepNum);
    list[objNum+i-1].style.posLeft = 0;
    list[objNum+i-1].style.visibility = 'visible';
  }
  el.startCondTime = -1;
}

function namosw_new_animation_object(name, obj, time, xpos, ypos, path, byword, zoom, stepNum) 
{
  var str = (navigator.appName.indexOf('Netscape', 0) != -1) ? 'document.'+name : 'document.all[\''+name+'\']';
  var object;

  if (name == '') return 0;

  object = eval(str);
  if (!object) return 0 ;

  object.name     = name;
  object.startCondObj  = obj;
  object.startCondTime = time;
  object.startXPos     = xpos;     // left, center, right
  object.startYPos     = ypos;     // top,  center, bottom
  object.pathType      = path;     // line, arc, spiral
  object.byword        = byword;   // true, false
  object.zoom          = zoom;
  object.stepNum       = stepNum;
  return object;
}

function namosw_animate(str) 
{
  var live_object_num = 0;
  for (var i = 0; i < document.NamoAnimationObjects.length; i++) {
    var el = document.NamoAnimationObjects[i];
    if (!el) continue;
    if (el.countDown > 0) {
      el.countDown = (0 < el.countDown-10) ? el.countDown-10 : 0;
      live_object_num++;
      continue;
    }
    if (el.countDown < 0)
      continue;

    if (el.pathType == 'line') {
      newx = el.sx + el.step * (el.ex - el.sx) / el.stepNum;
      newy = el.sy + el.step * (el.ey - el.sy) / el.stepNum;
    } else if (el.pathType == 'arc') {
      linex = el.sx + el.step * (el.ex - el.sx) / el.stepNum;
      liney = el.sy + el.step * (el.ey - el.sy) / el.stepNum;

      x = (el.ex + el.sx) / 2;
      y = (el.ey + el.sy) / 2;
      sinv = Math.sin(Math.PI*el.step/el.stepNum*(el.ex-el.sx > 0 ? -1:1));
      cosv = Math.cos(Math.PI*el.step/el.stepNum);
      newx = ((cosv*(el.sx-x) - sinv*(el.sy-y) + x) + linex) / 2;
      newy = ((sinv*(el.sx-x) + cosv*(el.sy-y) + y) + liney) / 2;
    } else if (el.pathType == 'spiral') {
      sinv = Math.sin(2*Math.PI*el.step/el.stepNum);
      cosv = Math.cos(2*Math.PI*el.step/el.stepNum);
      r = (el.stepNum-el.step)/el.stepNum;
      newx = el.ex + (cosv*(el.sx-el.ex) - sinv*(el.sy-el.ey))*r;
      newy = el.ey + (sinv*(el.sx-el.ex) + cosv*(el.sy-el.ey))*r;
    }
	if (el.style) {
      if (el.zoom == 'zoomin')
      el.style.fontSize = 50+50*el.step/el.stepNum + '%';
      else if (el.zoom == 'zoomout')
      el.style.fontSize = 200-100*el.step/el.stepNum + '%';
	}
    namosw_set_pos(el, newx, newy);
    namosw_set_visible(el, true);

    if (el.step++ == el.stepNum) {
      namosw_set_pos(el, el.ex, el.ey);
      el.step = 0;
      el.countDown = -1;
      // trigger other object(self can be trigger)
      for (var j = 0; j < document.NamoAnimationObjects.length; j++) {
        var obj = document.NamoAnimationObjects[j];
        if (obj.countDown < 0 && obj.startCondObj == el.name) {
          obj.countDown = obj.startCondTime;
          live_object_num++;
          if (i < j) {
            obj.countDown += 10;
            live_object_num--;
          }
        }
      }
    } else {
      live_object_num++;
    }
  }
  if (live_object_num > 0)
    window.setTimeout("namosw_animate();", 10);
}

function namosw_init_animation()
{
  var i    = 0;
  var list = new Array;

  list[i++] = namosw_new_animation_object('alayer1', null, 1, 'left', 'center', 'spiral', false, 'zoomin', 20);
  document.NamoAnimationObjects = list;

  var length = list.length;
  for (i = 0; i < length; i++)
    namosw_process_byword(list, i);

  for (i = 0; i < list.length; i++) {
    if (!list[i]) continue;
    list[i].countDown = (list[i].startCondObj == null) ? list[i].startCondTime : -1;
    list[i].step      = 0;
    list[i].sx        = (list[i].startXPos == 'left')  ? -namosw_page_left(list[i])  :
   			(list[i].startXPos == 'right') ?  namosw_page_right(list[i]) : 0;
    list[i].sy        = (list[i].startYPos == 'top')   ? -namosw_page_top(list[i])   :
   			(list[i].startYPos == 'bottom')?  namosw_page_bottom(list[i]): 0;
    list[i].ex      = 0;
    list[i].ey       = 0;
    if (!namosw_is_relative(list[i])) {
      list[i].sx += namosw_left(list[i]);
      list[i].sy += namosw_top(list[i]);
      list[i].ex += namosw_left(list[i]);
      list[i].ey += namosw_top(list[i]);
    }
    if (list[i].pathType == 'spiral') {
      list[i].sx = Math.max(-200+list[i].ex, Math.min(200+list[i].ex, list[i].sx));
      list[i].sy = Math.max(-200+list[i].ey, Math.min(200+list[i].ey, list[i].sy));
    }
    namosw_set_pos(list[i], list[i].sx, list[i].sy);
    namosw_set_visible(list[i], false);
  }
  window.setTimeout("namosw_animate();", 10);
}


function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function na_change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}

function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}


var startMsg = "LOS MEJORES JUEGOS A LOS MEJORES PRECIOS !!!.....  ";

var str     = "";
var msg     = "";
var leftMsg = "";


function setMessage()
{
    if (msg == "")
    {
        str = " ";
        msg = startMsg;
        leftMsg = "";
    }

    if (str.length == 1)
    {
        while (msg.substring(0, 1) == " ")
        {
            leftMsg = leftMsg + str;
            str = msg.substring(0, 1);
            msg = msg.substring(1, msg.length);
        }

        leftMsg = leftMsg + str;
        str = msg.substring(0, 1);
        msg = msg.substring(1, msg.length);

        for (var ii = 0; ii < 120; ii++)
        {
           str = " " + str;
        }
    }
    else
        str = str.substring(10, str.length);

    window.status = leftMsg + str;
// This editable value (1000 = 1 second) 
// corresponds to the speed of the shooting
// message.
    timeout = window.setTimeout('setMessage()',10);

}


function createHexArray(n)
{
   this.length=n;
   for (var i=1; i<=n; i++)
      this[i]=i-1;

   this[11]="A";
   this[12]="B";
   this[13]="C";
   this[14]="D";
   this[15]="E";
   this[16]="F";

   return this;
}


hx = new createHexArray(16);


function convertToHex(x)
{
   var high=x/16;
   var s=high+"";
   s=s.substring(0,2);
   high=parseInt(s,10);
   var left=hx[high+1];
   var low=x-high*16;
   s=low+"";
   s=s.substring(0,2);
   low=parseInt(s,10);
   var right=hx[low+1];
   var string=left+""+right;
   return string;
}

function makeRainbow(text)
{
   text=text.substring(3,text.length-4);
   color_d1=255;
   mul=color_d1/text.length;
   for(i=0;i < text.length;i++)
   {
      color_d1=255*Math.sin(i/(text.length/3)); "255*Math.sin(i/(text.length/3))"
      color_h1=convertToHex(color_d1);
      color_d2=mul*i;
      color_h2=convertToHex(color_d2);
      document.write("<FONT COLOR=\"#FF"+color_h1+color_h2+"\">"+text.substring(i,i+1)+"</FONT>");
   }
}




function changePage()
{
   var f = document.forms.navigation;

   var uri = f.pages.options[f.pages.selectedIndex].value;

	if(uri!="")   

newPage =
   
	
window.open(uri,"NewPage","height=480,width=640,location=no,scrollbars=yes,menubar=no,toolbar=no,resizable=yes,status=yes");
  
   }
