// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// zmain.js
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// defines, variables and initialisation
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

   var FRAMEWINDOW_FIXED = 0x1;
   var FRAMEWINDOW_MODAL = 0x2;

   isIE = window.clientInformation ? true : false;
   isN4 = document.layers ? true : false;
   isN6  = navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 5;
   isO5 = navigator.userAgent.indexOf("Opera") != -1 && parseInt(navigator.appVersion) >= 4;

   ie = document.all != null && !isO5;
   safari = navigator.userAgent.indexOf("Safari") != -1 && navigator.userAgent.indexOf("Safari/85") == -1;
   moz = !ie && !safari && document.getElementById != null && document.layers == null && navigator.userAgent.indexOf("Netscape/7.02") == -1 && (navigator.userAgent.indexOf("Gecko") || navigator.userAgent.indexOf("Firefox"));
   mac = (navigator.userAgent.indexOf("Macintosh") != -1 || navigator.userAgent.indexOf("Mac_PowerPC") != -1);

   if (safari) {
      document.write("<style> input.button, input.button[disabled] { font-size: 12px; } </style>");
   }

   var zConstants = {
      POPUPS_DISABLED_MESSAGE : "It appears that you may have a popup blocker enabled that is preventing a new window from opening.  You should either disable your popup blocker, or explicitly allow this site to create popups."
   };

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// cookie functions
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

   function openWindow(url,width,height,options) {
      var w = window.open(url,"EditWindow" + Math.round(Math.random() * 100000),"width=" + width + ",height=" + height + ",modal=" + (options & FRAMEWINDOW_MODAL) + ",scrollbars=no,resizable=yes,titlebar=yes,menubar=no,toolbar=no");
      if (!w) { alert(zConstants.POPUPS_DISABLED_MESSAGE); }
   }

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// cookie functions
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

   function setCookie(sName,sValue,expires,path,domain) {
      document.cookie = sName + "=" + escape(sValue) + "; expires=" + (expires == null ? new Date("January 2, 2030").toGMTString() : expires) + "; path=" + ((path == null)  ? "/" : path) + ((domain == null)  ? "" : "; domain=" + domain);
   }

   function delCookie(sName,path,domain) {
      document.cookie = sName + "=" + escape(getCookie(sName)) + ";expires=" + new Date("January 2, 1970").toGMTString() + "; path=" + ((path == null) ? "/" : path) + ((domain == null)  ? "" : "; domain=" + domain);
   }

   function getCookie(sCookie) {
      var aCookie = document.cookie.split(";");
      for (var i = 0; i < aCookie.length; i++) {
         var aCrumb = aCookie[i].split("=");
         if (sCookie == trim(unescape(aCrumb[0]))) { return(unescape(aCrumb[1])); }
      }
      return(null);
   }

   function getCookieDomain(fullhost) {
      var hs = fullhost.split(".");
      if (hs.length - 2 < 0) {
        return("");
      } else {
        return("." + hs[hs.length - 2] + "." + hs[hs.length - 1]);
      }
   }

// ----------------------------------------------------------------------------
//   event management
// ----------------------------------------------------------------------------


if (typeof aeOL == 'undefined')
{
 var aeOL = [];
 var addEvent = function(o, n, f, l)
 {
  var d = 'addEventListener', h = 'on' + n, t, a;
  if (o[d] && !l) return o[d](n, f, false);
  if (!o.aE) { o.aE = aeOL.length || 1; aeOL[o.aE] = { o:o } }
  t = aeOL[o.aE][n] || (aeOL[o.aE][n] = []);
  for (var i = 0; i < t.length; i++)
   for (var j = 0; j < t[i].length; j++)
    if (t[i][j] == f) return;
  if (o[h] && o[h]._ae)
  {
   a = t[t.length - 1];
   a[a.length] = f;
  }
  else
  {
   t[t.length] = o[h] ? [o[h], f] : [f];
   o[h] = new Function('e', 'var r = true, i = 0, o = aeOL[' + o.aE + '].o,' +
    'a = aeOL[' + o.aE + ']["' + n + '"][' + (t.length - 1) + '];' +
    'for (; i < a.length; i++) { ' +
   'o._f = a[i]; r = o._f(e||window.event) != false && r; o._f = null;' +
    '} return r');
   o[h]._ae = 1;
  }
 };

 var removeEvent = function(o, n, f, l)
 {
  var d = 'removeEventListener', t, a, i, j, s;
  if (o[d] && !l) return o[d](n, f, false);
  if (!o.aE || !aeOL[o.aE]) return;
  t = aeOL[o.aE][n];
  i = t.length;
  while (i--)
  {
   a = t[i];
   j = a.length;
   s = 0;
   while (j--)
   {
    if (a[j] == f) s = 1;
    if (s) a[j] = a[j + 1];
   }
   if (s) { a.length--; break }
  }
 };

}









function   z_ShowBlock(e,i,left) {
		var o = document.getElementById(i);
		var y = 0;
		if (document.all) {
			if (document.documentElement && document.documentElement.scrollTop) {
				y = event.clientY + document.documentElement.scrollTop - 175;
				if (left) {
					x = event.clientX + document.documentElement.scrollLeft - 300;
				} else {
					x = event.clientX + document.documentElement.scrollLeft + 30;
				}
			} else {
				y = event.clientY + document.body.scrollTop - 175;
				if (left) {
					x = event.clientX + document.body.scrollLeft - 300;
				} else {
					x = event.clientX + document.body.scrollLeft + 30;
				}
			}
		} else {
			y = e.pageY - 175;
			x = e.pageX + 30;
		}
		o.style.position="absolute";
		o.style.top = y + "px";
		o.style.left = x + "px";
		o.style.display = "block";
		w = o.offsetWidth - 8;
		o.style.width = w;
	   }



function   z_HideBlock(i) {
		var o = document.getElementById(i);
		o.style.display = 'none';
	   }






// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// end of javascript library
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
