
// WINDOWS.JS: Llibreria de funcions JavaScript

// Per:  Maurice E.Muller Foundation Website
// De:   Francesc Benavent (www.asterisc.com)
// Data: Agost 1999 - Agost 1999

//window.name="MAIN_WINDOW";

// --------------------------------------------------------- TEST
function Windows_Test(){
  alert("Windows_Test(): OK");
}


// --------------------------------------------------------- CLOSE ME
function Windows_CloseMe() {
  window.close();
}


// --------------------------------------------------------- OPEN WIN
function Windows_OpenWin(file,w,h) {
  window.open(file,"","width="+w+",height="+h+"");
}


// --------------------------------------------------------- OPEN MAP
function Windows_OpenMap() {
  window.open(Path_Root+"/map.htm","MAP","width=460,height=360");
}

// --------------------------------------------------------- OPEN TECH
function Windows_OpenTech() {
  window.open(Path_Root+"/technical.htm","TECH","width=460,height=300");
}

// --------------------------------------------------------- OPEN CRED
function Windows_OpenCred() {
  window.open(Path_Root+"/credits.htm","CRED","width=460,height=360,scrollbars");
}

// --------------------------------------------------------- OPEN INFO
function Windows_OpenInfo(file) {

  window.open("info"+file+".htm","INFO","width=400,height=270,scrollbars");
}


// --------------------------------------------------------- OPEN GLOSSARY
function Windows_OpenGlossary(node) {
  if (node.length==0) { info="00"; }
  if (node.length==1) { info="00"; }
  if (node.length==2) { info=node; }
  if (node.length==3) { info=node.substring(0,2); }    
  if (node.length==4) { info=node.substring(0,2); }
  if (node.length==5) { info=node.substring(0,2); }      
  
  window.open("/ccs/tool/info"+info+".htm","INFO","width=400,height=270,scrollbars");
}

// --------------------------------------------------------- OPEN HELP
function Windows_OpenHelp(file) {
  window.open("help"+file+".htm","INFO","width=400,height=270,scrollbars");
}

// --------------------------------------------------------- OPEN ATLAS
function Windows_OpenAtlas(code) {

  var code1 = code.substring(0,2);
  var code2 = code.substring(2,4);
  var pagePath = Path_Root+'/atlas/main/'+code1+'/'+code2+'.htm';

  window.open(pagePath,"","");
//  document.location=pagePath;
}


// --------------------------------------------------------- OPEN ZOOM SOLID
function Windows_OpenZoomSolid(title,imagePath,imageW,imageH) {

  var windowW=imageW+20;
  var windowH=imageH+30;

  var zoomWindow = window.open("","","width="+windowW+",height="+windowH+",scrollbars=no,resizable=no");

  if (zoomWindow!=null)
  {
	pixelPath =  Path_Root+'/shared/pixs/pix.gif';
	zoomContent='<HTML><HEAD><TITLE>'+title+'</TITLE></HEAD><BODY BGCOLOR="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">';
        zoomContent += '<font face="Arial, Helvetica, sans-serif" size="1">&copy; F.M.E.M. - SPAIN &nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:infomuller@mullerfoundation.org">infomuller@mullerfoundation.org</a></font>';
        zoomContent += '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" VSPACE="0" HSPACE="0" ALIGN="CENTER">';
        zoomContent += '<TR><TD></TD><TD><IMG SRC="'+pixelPath+'" WIDTH="'+imageW+'" HEIGHT="1"></TD></TR>';
        zoomContent += '<TR><TD><IMG SRC="'+pixelPath+'" WIDTH="1" HEIGHT="'+imageH+'"></TD><TD ALIGN="CENTER" VALIGN="MIDDLE">';
        zoomContent += '<IMG SRC="'+imagePath+'" BORDER="0" VSPACE="0" HSPACE="0">';
        zoomContent += '</TD></TR></TABLE>';
        zoomContent += '</BODY></HTML>';
        zoomWindow.document.write(zoomContent);
        zoomWindow.document.close();
  }
   else
  {
        alert("ERROR: Can't open a zoom window");
  }

}

// --------------------------------------------------------- OPEN ZOOM LIQUID

function Windows_OpenZoomLiquid(title,imagePath,imageW,imageH,windowW,windowH) {

  var zoomWindow = window.open("","","width="+windowW+",height="+windowH+",scrollbars=yes,resizable=yes");

  if (zoomWindow!=null)
  {
	pixelPath =  Path_Root+'/shared/pixs/pix.gif';
	zoomContent='<HTML><HEAD><TITLE>'+title+'</TITLE></HEAD><BODY BGCOLOR="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">';
        zoomContent += '<font face="Arial, Helvetica, sans-serif" size="1">&copy; F.M.E.M. - SPAIN &nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:infomuller@mullerfoundation.org">infomuller@mullerfoundation.org</a></font>';
        zoomContent += '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" VSPACE="0" HSPACE="0" ALIGN="CENTER">';
        zoomContent += '<TR><TD></TD><TD><IMG SRC="'+pixelPath+'" WIDTH="'+imageW+'" HEIGHT="1"></TD></TR>';
        zoomContent += '<TR><TD><IMG SRC="'+pixelPath+'" WIDTH="1" HEIGHT="'+imageH+'"></TD><TD ALIGN="CENTER" VALIGN="MIDDLE">';
        zoomContent += '<IMG SRC="'+imagePath+'" BORDER="0" VSPACE="0" HSPACE="0">';
        zoomContent += '</TD></TR></TABLE>';
        zoomContent += '</BODY></HTML>';
        zoomWindow.document.write(zoomContent);
        zoomWindow.document.close();
  }
   else
  {
        alert("ERROR: Can't open a zoom window");
  }

}


// --------------------------------------------------------- ZOOM ATLAS MODEL
function Windows_ZoomAtlasModel(filename) {

  var temp = filename.substring(0,2);
  var imagePath =  Path_Root+'/images/atlas/models/zoom/'+temp+'/'+filename+'.jpg';
  var temp = filename.substring(2,3).toUpperCase();
  var title = 'Zoom Atlas Model '+filename.substring(0,2)+'-'+temp+filename.substring(3,4)+'.'+filename.substring(4,5);

  Windows_OpenZoomSolid(title,imagePath,250,460)

}

// --------------------------------------------------------- ZOOM ATLAS CASE

function Windows_ZoomAtlasCase(filename) {

  var temp = filename.substring(0,2);
  var imagePath =  Path_Root+'/images/atlas/cases/zoom/'+temp+'/'+filename+'.jpg';
  var temp = filename.substring(2,3).toUpperCase();
  var title = 'Zoom Atlas Case '+filename+ '  &copy F.M.E.M';

  Windows_OpenZoomLiquid(title,imagePath,540,360,400,400);

}
// --------------------------------------------------------- ZOOM GAME MODEL
function Windows_ZoomGameModel(filename) {

//    alert ("Linea 155 - zoom game MODEL ????");
//  var temp = filename.substring(0,2);
  var imagePath =  Path_Root+'/images/game/models/zoom/'+filename+ '  &copy F.M.E.M';
  var title = 'Zoom Game Model ??-??.?';

  Windows_OpenZoomLiquid(title,imagePath,10,10,400,400);

}

// --------------------------------------------------------- ZOOM GAME TREATMENT
function Windows_ZoomGameTreatment(filename) {

  if (filename=="00/0.jpg") { return; }
  var imagePath =  Path_Root+'/images/game/treats/zoom/'+filename+ '  &copy F.M.E.M';
  var temp = filename.substring(5,6).toUpperCase();
  var title = 'Zoom Game Treatment '+filename.substring(3,5)+'-'+temp+filename.substring(6,7)+'.'+filename.substring(7,8)+' ('+filename.substring(8,9)+')';

  Windows_OpenZoomLiquid(title,imagePath,720,516,600,400)

}


// --------------------------------------------------------- ZOOM SLIDESHOW
function Windows_ZoomSlideshow(number) {

  var imagePath =  Path_Root+'/images/slideshow/'+Slideshow_Conference+'conf/zoom/'+number+'.jpg';
  var title = 'Zoom Slideshow '+Slideshow_Conference.toUpperCase()+number;

  Windows_OpenZoomSolid(title,imagePath,450,450)

}

