/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function abre_centrada(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=0'
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}


var win2 = null;
function abre_centrada2(mypage,myname,w,h,scroll,resize,directories,toolbar,menus){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resize+',location='+directories+',toolbar='+toolbar+',menubar='+menus+',status=yes'
win2 = window.open(mypage,myname,settings)
if(win2.window.focus){win2.window.focus();}
}





function ir(destino){
document.location=destino;
}

/***************************************************************************************************/

var separador='.';
function comma(number)
{
  number=''+number;
  if (number.length>3){
  var mod=number.length%3;
  var output = (mod >0 ? (number.substring(0,mod)) : '');
    for (i=0; i < Math.floor(number.length / 3); i++){
      if ((mod==0) && (i==0))
        output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
      else
        output += separador + number.substring(mod + 3 * i, mod + 3 * i + 3);
    }
    return (output);
  }
 else return number;
}

/***************************************************************************************************/


var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
