function nwindow(mypage,myname,w,h,scroll,pos)
{
  if (pos=="random")
  {
    LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
    TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
  }
  else if (pos=="center")
  {
    LeftPosition=(screen.width)?(screen.width-w)/2:100;
    TopPosition=(screen.height)?(screen.height-h)/2:100;
  }
  else
  {
    LeftPosition=0;
    TopPosition=20;
  }

  settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
  win=window.open(mypage,myname,settings);

  if(win.focus)
  {
    win.focus();
  }
}

function redimensionar (ancho, alto)
{
  LeftPosition=(screen.width)?(screen.width-ancho)/2:100;
  TopPosition=(screen.height)?(screen.height-alto)/2:100;

  window.moveTo(LeftPosition,TopPosition);
  window.resizeTo(ancho,alto);
  window.focus();
}


function redondear(value, precision)
{
  value = "" + value //convert value to string
  precision = parseInt(precision);

  var whole = "" + Math.round(value * Math.pow(10, precision));
  var decPoint = whole.length - precision;

  if(decPoint != 0)
  {
    result = whole.substring(0, decPoint);
    result += ".";
    result += whole.substring(decPoint, whole.length);
  }
  else
  {
    result = 0;
    result += ".";
    result += whole.substring(decPoint, whole.length);
  }
  return (result);
}


function detenerError(){
return true
}
window.onerror=detenerError


var rector=3
var stopit=0 
var a=1
function init(which){
stopit=0
shake=which
shake.style.left=0
shake.style.top=0
}
function rattleimage(){
if ((!document.all&&!document.getElementById)||stopit==1)
return
if (a==1){
shake.style.top=parseInt(shake.style.top)+rector
}
else if (a==2){
shake.style.left=parseInt(shake.style.left)+rector
}
else if (a==3){
shake.style.top=parseInt(shake.style.top)-rector
}
else{
shake.style.left=parseInt(shake.style.left)-rector
}
if (a<4)
a++
else
a=1
setTimeout("rattleimage()",50)
}
function stoprattle(which){
stopit=1
which.style.left=0
which.style.top=0
}
function verifica_fechas(fechaa,fechab)//si fechaa es mayor que fechab devolverá true, sino false
{ 
	var fecha_uno=new Array;
	var fecha_dos=new Array;
	fecha_uno=fechaa.split('/');
	fecha_dos=fechab.split('/');
	if(fecha_uno[2]<fecha_dos[2]) return false;
	else if(fecha_uno[2]==fecha_dos[2]&&fecha_uno[1]<fecha_dos[1]) return false;
	else if(fecha_uno[2]==fecha_dos[2]&&fecha_uno[1]<=fecha_dos[1]&&fecha_uno[0]<fecha_dos[0]) return false;
	else return true;
	
} 
function quita_marco(Nflash,Tw,Th)
{
//Nflash -> nombre del flash
//Tw -> ancho del video
//Th -> alto del video
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+Tw+"' height='"+Th+"'>");
	document.write("<param name='movie' value='"+Nflash+"'>");
	document.write("<param name='quality' value='high'>");
	document.write("<embed src='"+Nflash+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+Tw+"' height='"+Th+"''></embed>");
	document.write("</object>");
}

