//window.onerror = function(message,url,srcLine){return true;}

var        ifImg = document.images         ? true:false,
           ifAll = document.all            ? true:false,
           ifDom = document.getElementById ? true:false,
         ifLayer = document.layers         ? true:false,
      isNetscape = navigator.appName.indexOf('Netscape') >= 0 ? true:false,
         isOpera = navigator.userAgent.indexOf('Opera')  >= 0 ? true:false,

        ready2go = false,

           mausX = 0,
           mausY = 0,
        frmWidth = 0,
       frmHeight = 0,
         frmOfsX = 0,
         frmOfsY = 0,
              iW = 0,
              iH = 0,

        infoShow = false,
         infoDiv = null,
    infoDivStyle = null,
      infoHeight = 0,
       infoWidth = 0,
    iDivWidthAdd = 2,
    scrollBarsPx = 25,
      infoOfsetX = 5,
      infoOfsetY = 25,
   infoDivDesign = new Array('<table cellspacing="0" cellpadding="1" border="0"><tr><td class="infoBoxBorder"><div id="infoBoxDim"><table cellspacing="0" cellpadding="1" border="0"><tr>','<td class="infoBoxTitle" nowrap="nowrap">','</td></tr><tr>','<td class="infoBoxTxt" nowrap="nowrap">','</td></tr></table></div></td></tr></table>'),
      processWin = null,
             mpX = screen.width  ? Math.round(screen.width/2) : 400,
             mpY = screen.height ? Math.round(screen.height/2) : 300,
   prmProcessWin =  'width=300,height=100,top='+(mpY-50)+',left='+(mpX-150)+',location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no';

if(typeof window.defaultStatus=='string') window.defaultStatus='Willkommen im DomainEck!';

if(document.layers) alert('Willkommen\n\nUnsere Seiten unterst?tzen leider Ihren Browser (Netscape 4) nicht.\nBitte benutzen Sie den Microsoft Internet Explorer ab Version 4,\nNetscape 6+, Mozilla 1+, Firefox 1+, Opera 7+ oder kompatible.');


//-----------------------------------------------------------------------------------
function openStartProcessWin(txt){
 if(jsBrowser.split('_')[0]!='IE' && jsBrowser.split('_')[0]!='Mozilla') return;
 processWin = window.open('about:blank', 'processWin', prmProcessWin );
 processWin.document.write('<html>\n<head>\n<title>DomainEck</title>\n<style type="text/css">\n#ltBody{position:absolute;left:50px;top:42px;height:15px;width:200px;z-index:2;clip:rect(0px 200px 15px 0px);background-color:#2D77F5;}\n#txt{position:absolute;left:0px;top:0px;height:15px;width:200px;z-index:4;font-family:Arial,Verdana,Helvetica,sans-serif;font-size:8pt;color:#FFFFFF;}\n#lt{position:absolute;left:0px;top:0px;height:15px;width:40px;z-index:3;background-color:#1616AD;}\n</style>\n<script language="JavaScript" type="text/javascript">\nvar ltObj = null,ltPos=-40;\nwindow.onerror = function(message,url,srcLine){return true;}\nfunction ltAni(){ltPos+=4;if(ltPos>200)ltPos=-40;ltObj.left=ltPos;window.setTimeout(\'ltAni()\',30);}\nfunction init(){ltObj=document.getElementById ? document.getElementById(\'lt\').style : document.all[\'lt\'].style;ltAni();}\n</script>\n</head>\n<body onLoad="init()" onBlur="close()" bgcolor="#F8F9FB">\n<div id="ltBody"><div align="center" id="txt">'+txt+'</div><div id="lt"></div></div>\n</body>\n</html>');
 processWin.document.close();
 processWin.focus();
}

//-----------------------------------------------------------------------------------
function mo(status) {
 window.status=status;
 return true;
}

//-----------------------------------------------------------------------------------
function getFrmDim() {
 frmWidth  = isOpera || isNetscape ? window.innerWidth  : document.body.offsetWidth;
 frmHeight = isOpera || isNetscape ? window.innerHeight : document.body.offsetHeight;
 frmOfsX = isOpera || isNetscape ? window.pageXOffset : document.body.scrollLeft;
 frmOfsY = isOpera || isNetscape ? window.pageYOffset : document.body.scrollTop;
}

//-----------------------------------------------------------------------------------
function infoDivMove(e) {
 if(infoShow){
      e = window.Event && !isOpera ? e : window.event;
  mausX = window.Event && !isOpera ? e.pageX : e.clientX;
  mausY = window.Event && !isOpera ? e.pageY : e.clientY;
  mausX = isNetscape ? mausX : (mausX + document.body.scrollLeft);
  mausY = isNetscape ? mausY : (mausY + document.body.scrollTop);
  if(infoShow) infoDivStyle.left = ( ( ( ( (mausX + infoOfsetX + scrollBarsPx + infoWidth) > (frmOfsX + frmWidth) ) && ( (mausX - frmOfsX) > (frmOfsX + frmWidth - mausX) ) ) ? ( (mausX - infoOfsetX - infoWidth) > frmOfsX ? (mausX - infoOfsetX - infoWidth) : frmOfsX ) : ( (mausX + infoOfsetX + infoWidth) > (frmOfsX + frmWidth - scrollBarsPx) ? (frmOfsX + frmWidth - infoWidth - scrollBarsPx) : (mausX + infoOfsetX) ) ) + (ifLayer?'':'px') );
  if(infoShow) infoDivStyle.top = ( ( ( ( (mausY + infoOfsetY + scrollBarsPx + infoHeight) > (frmOfsY + frmHeight) ) && ( (mausY - frmOfsY) > (frmOfsY + frmHeight - mausY) ) ) ? (mausY - infoOfsetY - infoHeight) : (mausY + infoOfsetY) ) + (ifLayer?'':'px') );
 }
}

//-----------------------------------------------------------------------------------
function iBox(title,text,status) {
 if(!ready2go) return false;
 var range = null,
      cont = null,
       str = infoDivDesign[0]+(title ?(infoDivDesign[1]+title+infoDivDesign[2]):'')+infoDivDesign[3]+text+infoDivDesign[4]+"\n";
 window.status = status;
 getFrmDim();
 infoDivStyle.visibility = ifLayer ? 'show':'visible';
 if(ifAll){
   infoDiv.innerHTML = str;
 }else if(ifDom){
   if(typeof infoDiv.innerHTML == 'string'){
     infoDiv.innerHTML = str;
   }else{
     range = document.createRange();
     range.setStartBefore(infoDiv);
     cont = range.createContextualFragment(str);
     while(infoDiv.hasChildNodes())
       infoDiv.removeChild(infoDiv.lastChild);
     infoDiv.appendChild(cont);
   }
 }else{
   infoDiv.open();
   infoDiv.write(str);
   infoDiv.close();
 }
 infoHeight = ifLayer ? document.layers['infoBox'].document.height :
   ( ifDom ? document.getElementById('infoBoxDim').offsetHeight : document.all['infoBoxDim'].offsetHeight );
 infoWidth = ifLayer ? document.layers['infoBox'].document.width :
   ( ifDom ? document.getElementById('infoBoxDim').offsetWidth : document.all['infoBoxDim'].offsetWidth );
 if(infoWidth && !ifLayer) infoDivStyle.width = infoWidth + iDivWidthAdd + 'px';
 infoShow = true;
 return true;
}

//-----------------------------------------------------------------------------------
function iBoxClr() {
 if(!ready2go) return false;
 infoShow = false;
 window.status = '';
 infoDivStyle.visibility = ifLayer ? 'hide':'hidden';
 infoDivStyle.left = ifLayer ? '1':'1px';
 infoDivStyle.top  = ifLayer ? '-400':'-400px';
 return true;
}

//-----------------------------------------------------------------------------------
function infoBoxInit() {
 if(ifDom ||
   (ifAll && typeof document.all['infoBox']=='object') ||
   (ifLayer && typeof document.layers['infoBox']=='object')){
   infoDiv = ifLayer ? document.layers['infoBox'].document :
    ( ifDom ? document.getElementById('infoBox') : document.all['infoBox'] );
   infoDivStyle = ifLayer ? document.layers['infoBox'] :
    ( ifDom ? document.getElementById('infoBox').style : document.all['infoBox'].style );
   if(ifLayer){
     window.captureEvents(Event.MOUSEMOVE);
     window.onmousemove = infoDivMove;
     iW = window.innerWidth;
     iH = window.innerHeight;
     window.onresize = function(){if(iW!=window.innerWidth||iH!=window.innerHeight)self.location.reload();}
   }else{
     document.onmousemove = infoDivMove;
     infoDivStyle.top = '-400px';
   }
   ready2go=true;
 }
}

//-----------------------------------------------------------------------------------
function getDomain() {
 var href = window.location.href,
   doName = /^.+\.\w{2,6}$/i;
 href = href.replace(/https?:\/\//i,'');
 href = href.split('/')[0];
 return doName.test(href) ? href:'';
}

//-----------------------------------------------------------------------------------
function getCookie(name) {
 var co = document.cookie;
 if(co.indexOf(name+'=')== -1) return '';
 co = co.split(name+'=')[1];
 co = co.split(';')[0];
 return unescape(co);
}

//-----------------------------------------------------------------------------------
function setCookie(name,data) {
 var coDomain = getDomain(),
       coTime = new Date();
 coTime.setTime(coTime.getTime()+(90*86400000));//90 Tage
 document.cookie = name + '=' + escape(data) + '; expires=' + coTime.toGMTString() + '; path=/' +(coDomain != '' ? ('; domain=' + coDomain):'');
}

//-----------------------------------------------------------------------------------
function delCookie(name) {
 var coDomain = getDomain(),
         data = getCookie(name);
 if(data) document.cookie = name + '=' + escape(data) + '; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/' +(coDomain != '' ? ('; domain=' + coDomain):'');
}

//-----------------------------------------------------------------------------------
function displayOnOff(dsp) {
 if(!ready2go) return false;
 var obj = (ifDom ? document.getElementById(dsp):document.all[dsp]),
      on = obj.style.display == 'none' ? false:true;
 obj.style.display = on ? 'none':'';
 setCookie(dsp,on ? 'off':'on');
}

//-----------------------------------------------------------------------------------
function initDisplay(dsp,def) {
 var on = getCookie(dsp),
    obj = (ifDom ? document.getElementById(dsp):document.all[dsp]);
 if(!on) on=def;
 obj.style.display = on=='off' ? 'none':'';
 return true;
}

//-----------------------------------------------------------------------------------
function getBrowser() {
 var nav = navigator.userAgent.toLowerCase(),
     ver = /[0-9,\.\/]+/;
 if(nav.indexOf('opera')!= -1)
  return 'Opera_'+nav.split('opera')[1].match(ver);
 if(document.layers)
  return 'Netscape_4'+(nav.indexOf('4.')!=-1?('.'+nav.split('4.')[1].match(ver)):'');
 if(navigator.appName.toLowerCase().indexOf('netscape')!=-1)
  if(nav.indexOf('netscape')!=-1)
   return 'Netscape_'+nav.split('netscape')[1].match(ver);
  else
   return 'Mozilla'+(nav.indexOf('rv:')!=-1?('_'+nav.split('rv:')[1].match(ver)):'');
 if(nav.indexOf('msie')!=-1)
  return 'IE_'+nav.split('msie')[1].match(ver);
 return nav.replace(/ /g,'_');
}

//-----------------------------------------------------------------------------------
function getPlatform() {
 var nav = navigator.userAgent.toLowerCase();
 if(nav.indexOf('win')!=-1) return ('Windows ('+navigator.platform+')').replace(/ /g,'_');
 if(nav.indexOf('mac')!=-1) return ('Mac ('+navigator.platform+')').replace(/ /g,'_');
 if(nav.indexOf('x11')!=-1) return ('Unix ('+navigator.platform+')').replace(/ /g,'_');
 return nav.replace(/ /g,'_');
}

//-----------------------------------------------------------------------------------
function getScreen() {
 return screen.width+'x'+screen.height;
}

var jsBrowser  = getBrowser();
var jsPlatform = getPlatform();
var jsScreen   = getScreen();

//-----------------------------------------------------------------------------------
function showagb() {
	window.open('http://www.domaineck.de/showagb.php','AGB','width=800,height=557,resizable=0,menubar=0,personalbar=0,location=0,status=0,scrollbars=1,left=200,top=140');
}