// Script for Alpinet.org.
// (c) 1999-2003 Alpinet.org, all rights reserved.

// www.alpinet.org
// v4.05 (c) 1999-2003 Ionut Nechita djonexx at alpinet dot org
// ------------------------------------------/

var ferShowFoto = null;
var ferView   = null;
var ferPopup    = null;


init();

function init() { 
  window.status = "Alpinet";
}


// ---- global site functions

function movr(obj, idx) {
  //obj = window.event.srcElement;
  if((obj.style != null) && (obj.className != null)) {
    obj.className = obj.className + "ovr";
  }
  if(obj.innerText)
    window.status = "Alpinet: " + obj.innerText;
  else
    window.status = "Alpinet";
  return true;
}

function mout(obj, idx) {
  // obj = window.event.srcElement;
  
  if((obj.style != null) && (obj.className != null)) {
    obj.className = obj.className.substr(0, obj.className.length -3);
    
  }
  window.status = "Alpinet";
  return true;
}

function cl(link) {
  window.status = "Loading ...";
  document.location.href = link;
  return true;
}

function Status(s) {
  if(s != null && s != "")
    s = ": "+s;
  window.status = "Alpinet" + s;
  return true;
}

function LoadPopup(doc) {
  WindowWidth= 300;
  WindowHeight= 200;

  ferPopup = window.open(doc, "AlpinetPopup", 'status=no,toolbar=0,scrollbars=no,menubar=0,titlebar=0,resizable=0,width='+WindowWidth+',height='+WindowHeight+',left='+((screen.width-WindowWidth)/2)+',top='+((screen.height-WindowHeight)/2));
  //fer.moveTo(screen.width/2-150, screen.height/2-100);
  ferPopup.focus();
}

function ClosePopup() {
  if(ferPopup && !ferPopup.closed)
  ferPopup.close();
}

function LoadPicture(doc)   {
  WindowWidth= 700;
  WindowHeight= 530;
  ferShowFoto=window.open(doc,"Foto",'status=no,toolbar=0,scrollbars=yes,menubar=0,titlebar=0,resizable=1,width='+WindowWidth+',height='+WindowHeight+',left='+((screen.width-WindowWidth)/2)+',top='+((screen.height-WindowHeight)/2));
  ferShowFoto.focus();
}

function ContactUser(doc) {
  WindowWidth= 400;
  WindowHeight= 408;
  ferContact=window.open(doc,"ContactUser",'status=no,toolbar=0,scrollbars=no,menubar=0,titlebar=0,resizable=1,width='+WindowWidth+',height='+WindowHeight+',left='+((screen.width-WindowWidth)/2)+',top='+((screen.height-WindowHeight)/2));
  ferContact.focus();  
}

function showCalendar(doc, frm, fld, year, month, day) {
  WindowWidth= 278;
  WindowHeight= 300;

  f= document.forms[frm];

  ferCalendar=window.open(doc+ "dta="+ escape(f.elements[fld].value)+ "&year="+ year+ "&month="+ month+ "&day="+ day+ "&frm="+ frm+ "&fld="+ fld,"datePicker",'status=no,toolbar=0,scrollbars=no,menubar=0,titlebar=0,resizable=0,width='+WindowWidth+',height='+WindowHeight+',left='+((screen.width-WindowWidth)/2)+',top='+((screen.height-WindowHeight)/2));
  ferCalendar.focus();  
}

function ViewPhoto(photo, awidth, aheight) {

  var scroll = "no";
  if(awidth > screen.width) {
    scroll="yes";
    awidth = screen.width;
    aheight = height+20;  
  }

  if(aheight > screen.height) {
    scroll="yes";
    aheight= screen.height;
  }
  
  var leftpos = (screen.width-awidth)/2;
  var toppos = (screen.height-aheight)/2;

  if(ferView && !ferView.closed)
  ferView.close();
  ferView = window.open(photo, "Foto", "status=no,toolbar=0,scrollbars="+scroll+",menubar=0,titlebar=0,resizable=0,width="+awidth+",height="+aheight+"top="+toppos+"left="+leftpos);
  ferView.focus();
}

function ViewFlash(flash) {
  var height = 400;
  var width  = 400;
  var leftpos = ((screen.width-width)/2);
  var toppos = ((screen.height-height)/2);  
  ferView = window.open(photo, "Foto", "status=no,toolbar=0,scrollbars=no,menubar=0,titlebar=0,resizable=1,width="+width+",height="+height+"top="+toppos+"left="+leftpos);
  ferView.focus();
}
