//
//  Script per obrir una nova finestra dinàmicament
//
//  Origen de l'script:  Semic Internet
//

function openWindowDinamic(url, window_name, width, height, scroll)
{
  var left, top, scrollbars;

  if(width>=screen.availWidth)
  {
    width = screen.availWidth - 50;
    left = 10;
    scrollbars = ', scrollbars=yes';
  }
  else
  {
    left = screen.availWidth/2 - width/2;
  }

  if(height>=screen.availHeight)
  {
    height = screen.availHeight - 50;
    top = 10;
    scrollbars = ', scrollbars=yes';
  }
  else
  {
    top = screen.availHeight/2 - height/2;
  }

  if(scroll=='yes')
  {
    scrollbars = ', scrollbars=yes';
  }
  else
  {
    scrollbars = ', scrollbars=no';
  }

  window.open(url, window_name, 'resize=no, menubar=no, left=' + left + ', top=' + top + scrollbars + ', width=' + width + ', height=' + height);
}




/*
//
//  Script per inhabilitar l'ús del botó dret dins d'una pàgina
//
//  Origen de l'script:  http://www.forosdelweb.com/showthread.php?p=774047#post774047
//

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;}

document.oncontextmenu=new Function("return false")




//
//  Script per impedir copiar el text d'una pàgina
//
//  Origen de l'script:  http://www.forosdelweb.com/showthread.php?p=774047#post774047
//

function disableselect(e){
return false
}

function reEnable(){
return true
}

//if IE4+
document.onselectstart=new Function ("return false")

//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
*/
