function timeToCheckMails(t) {
  setTimeout("mailCheck()", t);
}

function mailCheck() {
  var mailstatus = "false";
  var lang = "EN";
  try {
    lang = parent.inTopName.lang;
    mailstatus = parent.inTopName.mailstatus;        
    var actMailImg = new Image();
    actMailImg.src = parent.inTop.document.images['email_off'].src;
    if (mailstatus == "true" && (actMailImg.src.indexOf("/cfintranet/images/top/" + lang + "/email_animated.gif") == -1)) { 
      parent.inTop.document.images['email_off'].src = "/cfintranet/images/top/" + lang + "/email_animated.gif";
    } else if (mailstatus == "false" && (actMailImg.src.indexOf("/cfintranet/images/top/" + lang + "/email_off.png") == -1)) {
      parent.inTop.document.images['email_off'].src = "/cfintranet/images/top/" + lang + "/email_off.png";
    }
  } catch (e) { }
  timeToCheckMails(5000);
}



function replaceIt() {
    var vormals = document.rightSearch.searchpattern.value;
    var jetzt = vormals.replace(/%/,"*");
    document.rightSearch.searchpattern.value = jetzt;
    document.rightSearch.searchpattern.focus();
}


function setHeaderAndSite(val, form) {
  if (val == "documents") {
    form.SPO_headerType.value=val;
    form.LOADSITE.value="documents/documents_list";
  } else if (val == "calendar") {
    form.SPO_headerType.value=val;
    form.LOADSITE.value="calendar/calendar_search";
  } else if (val == "addresses") {
    form.SPO_headerType.value=val;
    form.LOADSITE.value="addresses/address_list";
  } else if (val == "contacts") {
    form.SPO_headerType.value="addresses";
    form.LOADSITE.value="contacts/contact_list";
  } else if (val == "tasks") {
    form.SPO_headerType.value="tasks";
    form.LOADSITE.value="tasks/tasks_search";
  } else if (val == "projects") {
    form.SPO_headerType.value="projects";
    form.LOADSITE.value="projects/projects_search";
  } else if (val == "bookmarks") {	
    form.SPO_headerType.value="bookmarks";
    form.LOADSITE.value="bookmarks/bookmarks_list";
   } else if (val == "knowledge") {	
    form.SPO_headerType.value="knowledge";
    form.LOADSITE.value="knowledge/knowledge_list";
  }
}

function date(page, height, width) {
  DW = window.open(page,"Datum","height="+height+",width="+width+",scrollbars=yes,menubar=no,resizable=yes");
  b = navigator.appName;
  Ver = parseInt(navigator.appVersion);
    if (b == "Netscape" && Ver >=3 || b == "Microsoft Internet Explorer" && Ver >=4 ) {
      DW.resizeTo(width,height);
      DW.focus();
    }
}

function openPopUp(page, target, height, width) {
  DWN = window.open(page, target, "height="+height+",width="+width+",scrollbars=no,menubar=no,resizable=yes");
  br = navigator.appName;
  Ver = parseInt(navigator.appVersion);
    if (br == "Netscape" && Ver >=3 || br == "Microsoft Internet Explorer" && Ver >=4 ) {
      DWN.resizeTo(width,height);
      DWN.focus();
    }
}
	
function onlineHelp(page, height, width) {
  DWNO = window.open(page, "_blank","height="+height+",width="+width+",scrollbars=yes,menubar=no,resizable=yes");
  bro = navigator.appName;
  Ver = parseInt(navigator.appVersion);
    if (bro == "Netscape" && Ver >=3 || bro == "Microsoft Internet Explorer" && Ver >=4 ) {
      DWNO.resizeTo(width,height);
      DWNO.focus();
    }
}

function changeImg(lang, img1, img2) {
  if (document.images) {
    active = new Image ();
    normal = new Image ();
    active.src = '/EZWeb/images/' + img2 + '.png';
    normal.src = '/EZWeb/images/' + img1 + '.png';
      if (img1 != img2) {
        document.images[img1].src = active.src;
      } else {
        document.images[img1].src = normal.src;
      }
   }
}

/*********************************************************************************   
PopupDescriptions 
*   Copyright (C) 2001 Thomas Brattli
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by Thomas Brattli
*
*   Script date: 09/04/2001 (keep this date to check versions) 
*********************************************************************************/
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=lib_bwcheck()

fromX = -100 //How much from the actual mouse X should the description box appear?
fromY = 10 //How much from the actual mouse Y should the description box appear?

function makeObj(obj){								
   	this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
	if(!this.evnt) return false
	this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;	
   	this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.css.document:0;		
	this.writeIt=b_writeIt;																
	return this
}

var px = bw.ns4||window.opera?"":"px";

function b_writeIt(text){
	if (bw.ns4){this.wref.write(text);this.wref.close()}
	else this.wref.innerHTML = text
}

var descx = 0
var descy = 0
function popmousemove(e){descx=bw.ns4||bw.ns6?e.pageX:event.x; descy=bw.ns4||bw.ns6?e.pageY:event.y}

var oDesc;
var msg;
function popup(message) {
  msg = message
  setTimeout("check()", 1200);
}

function check() {
  if (msg != "") {
    popupDisplay();
  }
}

function popupDisplay() {

   if(oDesc){
      oDesc.writeIt('<div class="clDescription"><table border="0" width="220" class="ca-term-info" cellpading="0" cellspacing="0"><tr><td align="center" class="ca-term-head" width="100%">Info</td></tr><tr><td class="ca-term-note">'+msg+'</td></tr></table></div>')
      if (bw.ie5||bw.ie6) {
         descy = descy+document.body.scrollTop
      }
      if (!document.body.offsetWidth) {
         oDesc.css.left = (descx+fromX)+px
      } else {
         if ((descx+fromX+220) > document.body.offsetWidth) {
            oDesc.css.left = (document.body.offsetWidth-221)+px
         } else if ((descx+fromX) < 0) {
            oDesc.css.left = (1)+px
         } else {
            oDesc.css.left = (descx+fromX)+px
         }
      }
      oDesc.css.top = (descy+fromY)+px
      oDesc.css.visibility = "visible"
   }
}

function popout(){
 if(oDesc) 
  oDesc.css.visibility = "hidden"
  msg = "";
}

function setPopup(){
 if(bw.ns4)document.captureEvents(Event.MOUSEMOVE)
  document.onmousemove = popmousemove;
  oDesc = new makeObj('divDescription')
}


function WinMail(page, height, width) {
  MailWin = window.open(page,"popup","height="+height+",width="+width+",scrolling=yes,scrollbars=yes,Menubar=yes,resizable=yes");
  b = navigator.appName;
  Ver = parseInt(navigator.appVersion);
  if (b == "Netscape" && Ver >=3 || b == "Microsoft Internet Explorer" && Ver >=
4 ) {
  MailWin.focus();
 }
}

