// AMPsoft Script
// Created by Alberto Martinez Perez (http://www.ampsoft.net/)

// ***** Misc *****
var WINDOW_TOP=25, WINDOW_LEFT=25, SYSTRAY_HEIGHT=56, WINDOW_TITLEBAR=24;

var lastPopup=null;

function openPopup(page,targetWindow,width,height,scrollBars,resizable){
 var options=new String(), scroll=new String("no"), resize=new String("no");

 if (scrollBars) scroll="yes";
 if (resizable) resize="yes";
 options="width="+width+",height="+height+
  ",screenY="+WINDOW_TOP+",top="+WINDOW_TOP+",screenX="+WINDOW_LEFT+",left="+WINDOW_LEFT+
  ",status=no,location=no,toolbar=no,menubar=no,hotkeys=no"+
  ",resizable="+resize+",scrollbars="+scroll;
 lastPopup=window.open(page,targetWindow,options,true);
 lastPopup.window.focus();
 return lastPopup;
}


function showImage(image,title,width,height) {
  totalWidth=width+75;
  if (totalWidth>screen.width-WINDOW_LEFT-8)
    totalWidth=screen.width-WINDOW_LEFT-8;
  totalHeight=height+125;
  if (totalHeight>screen.height-WINDOW_TOP-SYSTRAY_HEIGHT-WINDOW_TITLEBAR)
    totalHeight=screen.height-WINDOW_TOP-SYSTRAY_HEIGHT-WINDOW_TITLEBAR;
 openPopup("Imagen.php?image="+escape(image)+"&title="+escape(title),"images",totalWidth,totalHeight,true,true);
 return false;
}



function maskedEmail(domain,text,name,suffix) {
  var address=name+'@'+domain+'.'+suffix;
  if (text=="") text=address;
  document.write('<a hr'+'ef="ma'+'i'+'lto:'+address+'">'+text+'</a>');
}

function maskedEmailImage(domain,image,name,suffix,width,height,alt,className) {
  var address=name+'@'+domain+'.'+suffix;
  document.write('<a hr'+'ef="ma'+'i'+'lto:'+address+'"><img src="'+image+
                 '" width="'+width+'" height="'+height+'" alt="'+alt+'"'+' title="'+alt+'"');
  if (className) document.write(' class="'+className+'"');
  document.write('></a>');
}

// AMPsoft General Script
// Created by Alberto Martinez Perez (http://www.ampsoft.net/)