var agt=navigator.userAgent.toLowerCase();
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

function SetFocus() {
  if (document.forms.length > 0) {
    var field = document.forms[0];
    for (i=0; i<field.length; i++) {
      if ( (field.elements[i].type != "image") && 
           (field.elements[i].type != "hidden") && 
           (field.elements[i].type != "reset") && 
           (!field.elements[i].readOnly) && 
           (field.elements[i].type != "submit") ) {

        document.forms[0].elements[i].focus();
            
        if ( (field.elements[i].type == "text") || 
             (field.elements[i].type == "password") )
          document.forms[0].elements[i].select();
        
        break;
      }
    }
  }
}

function sbkpopupWindow(open_URL) {
  window.open(open_URL,'sbkPopup','toolbar=no,location=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=1024,height=1024,screenX=1,screenY=1,top=1,left=1');
}

function sbkpopupClose() {
  document.sbkpopupWindow.close();
}

function frmbut_active () {
  if(document.getElementById("sbkfrm")) {
    document.getElementById("sbkfrm").style.backgroundColor = "#00A020";
    document.getElementById("sbkfrm").style.textDecoration= "underline";
    document.getElementById("sbkfrm").style.color = "#FFFFFF";
  }
}
function frmbut_inactive () {
  if(document.getElementById("sbkfrm")) {
    document.getElementById("sbkfrm").style.backgroundColor = "#f0f0C0";
    document.getElementById("sbkfrm").style.textDecoration= "none";
    document.getElementById("sbkfrm").style.color = "#606060";
  }
}  


function sbkButtonCorrect() {
  if (document.forms.length > 0) {
    if (is_ie) {
      if(document.getElementById("sbkfrm") ) {
        document.getElementById("sbkfrm").style.height = "25px"; 
        var i = 9 +"px";
       document.getElementById("sbkfrm").style.top =  i;
      }  
    } else {
      if(document.getElementById("sbkfrm") ) {
        document.getElementById("sbkfrm").style.height = "23px"; 
        var i = 7 +"px";
       document.getElementById("sbkfrm").style.top =  i;
      }  
    }
  }  
} 
// <!-- New Version of the Protector !!!
// This script is (C) Copyright 2004 Jim Tucek
// Leave these comments alone!  For more info, visit
// www.jracademy.com/~jtucek/email/
// Version 4.06 P=61 Q=23
// Information available at http://www.jracademy.com/~jtucek/email/download.php
//652 995 1003 682 52 1080 1251 25 326 1126 506 229 858 682 1251 995 1335 161 127 326
function burst(air,squirrel,art,tit) {
  air += ' ';
  var design = air.length;
  var birth = 0;
  var walk = '';
  for(var agreement = 0; agreement < design; agreement++) {
    birth = 0;
    while(air.charCodeAt(agreement) != 32) {
      birth = birth * 10;
      birth = birth + air.charCodeAt(agreement)-48;
      agreement++;
    }
    walk += String.fromCharCode(plead(birth,squirrel,art));
  }
  parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+walk+tit;
}//----------------- end of burst -----------------------------------------------

function cost(thing,area,effect) {
  thing += ' ';
  var leaf = thing.length;
  var family = 0;
  for(var oxygen = 0; oxygen < leaf; oxygen++) {
    family = 0;
    while(thing.charCodeAt(oxygen) != 32) {
      family = family * 10;
      family = family + thing.charCodeAt(oxygen)-48;
      oxygen++;
    }
    //document.write('&');
    //document.write('#');
    //document.write(plead(family,area,effect));
    document.write(String.fromCharCode(plead(family,area,effect)));
  }
}//------------------------ end of cost ----------------------------------------

function plead(bed,fire,government) {
  if (government % 2 == 0) {
    year = 1;
    for(var landing = 1; landing <= government/2; landing++) {
      mission = (bed*bed) % fire;
      year = (mission*year) % fire;
    }
  } else {
    year = bed;
    for(var hieroglyphic = 1; hieroglyphic <= government/2; hieroglyphic++) {
      mission = (bed*bed) % fire;
      year = (mission*year) % fire;
    }
  }
return year;
}//----------------------- end of plead ----------------------------------------


function WebCounter() {
  var data, p;
  var agt=navigator.userAgent.toLowerCase();
/* temp
  p='http';
  if((location.href.substr(0,6)=='https:')||(location.href.substr(0,6)=='HTTPS:')) {p='https';}
    data = '&r=' + escape(document.referrer) + '&n='
           + escape(navigator.userAgent) + '&p=' + escape(navigator.userAgent)
  if(navigator.userAgent.substring(0,1)>'3') {
     data = data + '&sd=' + screen.colorDepth + '&sw=' + escape(screen.width+ 'x'+screen.height)
   };
  document.write('<a href="http://www.counter-gratis.com/39264.html" target="_blank" >');
 document.write('<img alt="counter-gratis.com" border=0 hspace=0 '
     +'vspace=0 src="http://www.counter-gratis.com/counter.php?i=39264' + data + '"> <\/a>');
*/
}// --------------------------- end of WebCounter --------------------------------------

// (c) 2002 M.Bothge - Schwarzheide
// BILD IN NEUEM ZENTRIERTEN FENSTER ÖFFNEN
//
function OpenNewWindow(Picture,Breit,Hoch)
{
xsize = Breit+35;// Zusatz für Rand rechts und links
ysize = Hoch+75; //Zusatz für Rand oben und unten - damit Button angezeit werden kann

ScreenWidth = screen.width;
ScreenHeight = screen.height;

xpos = (ScreenWidth/2)-(xsize/2);
ypos = (ScreenHeight/2)-(ysize/2);

	NewWindow=window.open("","Picture","height="+ysize+",width="+xsize+",scrollbars=no,resizable=no,top="+ypos+",left="+xpos+"");
	NewWindow.document.write ("<html><head><title>BILDANZEIGE");
	NewWindow.document.write ("</title></head>");
                     NewWindow.document.write ("<body bgcolor='#cccccc' onload='focus()'>");
	//NewWindow.document.write ("<body bgcolor='#cccccc'>");
	NewWindow.document.write ("<table align='center'><tr>");
	NewWindow.document.write ("<td align='center' valign='top'>");
	NewWindow.document.write ("<table border='1' bgcolor='#000000' cellpadding='0' cellspacing='1'><tr><td align='center'>");
	NewWindow.document.write ("<img src=");
	NewWindow.document.write (Picture);
	NewWindow.document.write (">");
	NewWindow.document.write ("</tr></table>");
	NewWindow.document.write ("</td></tr><tr>");
	NewWindow.document.write ("<td align='center' valign='bottom'>");
	NewWindow.document.write ("<br><center><form><input type='button' value='FENSTER SCHLIESSEN' style='font-family: Verdana; font-size: 10px' onClick='self.close()'>");
	NewWindow.document.write ("</td></tr></table>");
	NewWindow.document.write ("</form></body></html>");
	NewWindow.document.close();
                     NewWindow.resizeTo(xsize,ysize);
} // --------------------------- End of OpenNewWindow -------------------------------------------

//----------------- checkFormA--------------------------------------------
function checkFormA(obj)
{
  var err_string = "";
  var re_email = /^([_a-zA-Z0-9-]+)(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,3})$/;
  var email = obj.email.value;
  if (obj.vorname.value.length < 2)
  {
    err_string = err_string + "\n Vorname leer";
  }
  if (obj.nachname.value.length < 2)
  {
    err_string = err_string + "\n Nachname leer";
  }
  if (obj.telp.value.length < 2)
  {
    err_string = err_string + "\n Telefon leer";
  }
  if (obj.email.value.length < 2)
  {
    err_string = err_string + "\n E-Mail leer";
  }
  if (re_email.test(email) == false)
  {
    err_string = err_string + "\n E-Mail falsch oder nicht angegeben";
  }
  if (err_string.length > 0)
  {
    alert(err_string); return false;
  }
  history.back();
}//----------------- checkFormA--------------------------------------------

function montre(id)
{
	with (document)
	{
		if (getElementById)
			getElementById(id).style.display = 'block';
		else if (all)
			all[id].style.display = 'block';
		else
			layers[id].display = 'block';
	}
}

function cache(id)
{
	with (document)
	{
		if (getElementById)
			getElementById(id).style.display = 'none';
		else if (all)
			all[id].style.display = 'none';
		else
			layers[id].display = 'none';
	}
}

function checkdata(obj)
{
  var err_string = "";
  var re_email = /^([_a-zA-Z0-9-]+)(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,3})$/;
  var email = obj.email.value;
  if (obj.email.value.length < 2)
  {
    err_string = err_string + "\n E-Mail leer";
  }
  if (re_email.test(email) == false)
  {
    err_string = err_string + "\n E-Mail falsch oder nicht angegeben";
  }
  if (err_string.length > 0)
  {
    alert(err_string); return false;
  }
  history.back();
}
var text_now = "";
var chars = 0;
var effect = "rtl";

function fill(n) {
 var empty_chars = "";
 for(var i = 0; i < n; ++i)
  empty_chars += " ";
 return(empty_chars);
}

function show_ticker(text, delay) {
 if(effect == "rtl") {
  chars += 1;
  text_now = fill(text.length - chars);
  text_now += text.substring(0, chars);
  if(chars >= text.length) effect = "ltn";
 }
 else if(effect == "ltn") {
  chars -= 1;
  text_now =
     text.substring((text.length - chars),(text.length - 1));
  text_now += fill(text.length - chars);
  if(chars <= 0) effect = "rtl";
 }
 document.getElementById("ticker").innerHTML = text_now;
 window.setTimeout
    ("show_ticker('" + text + "', " + delay + ")", delay);

} /*------------ end of show_ticker    */

function save_prev_site() {
  window.name = doucument.getElementById("prev").value;
  return true;
}
function donothing() {
 var i = 0;
}
/*##############   Layout same height ################################*/
/*---------------- correct_layout --------------------------------*/
function correct_layout() {

 var corr = 0;
 /*
   if (document.URL  == "http://localhost/www.divers-point_new.de/index.php") corr=0; //600
   if (document.URL  == "http://localhost/www.divers-point_new.de") corr=0;
   if (document.URL  == "http://www.divers-point_new.de/index.php") corr=0;
   if (document.URL  == "http://www.divers-point_new.de/") corr=200;
*/
   if (!document.getElementById('text_body-inside')) alert('FEHLER: text_body-insite');
   else {
   if (document.getElementById('text_body-inside').offsetHeight) {
      var div_heights = new Array(
        document.getElementById('text_body-inside').offsetHeight,
        document.getElementById('navigation-inside').offsetHeight,
        document.getElementById('right_body-inside').offsetHeight
      );
/*alert(div_heights);*/
      div_heights = div_heights.reverse(div_heights.sort(num_sort));
/*alert(div_heights);*/
/* +++ only for amazon's insert add 400 to max length ++++++++*/
      var style_height = div_heights[0]+corr + "px";
/*alert(style_height);*/
      document.getElementById('navigation-inside').style.height = style_height;
      document.getElementById('text_body-inside').style.height = style_height;
      document.getElementById('right_body-inside').style.height = style_height;
   }
   }
}/*----------------end of  correct_layout -----------------------------*/

/*---------------- num_sort(a,b) --------------------------------*/
function num_sort(a,b) {
   return a-b;
}/*----------------end of num_sort(a,b) --------------------------------*/
/*############## end of Layout same height ################################*/

blink(0.7);

function blink(speed)
{
if (speed) {
if (document.all)
setInterval("blink()", speed*500)
return;
}
var blink = document.all.tags("BLINK")
for (var i=0; i<blink.length; i++)
blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}
function emoticon(text) {
	var txtarea = document.post.yourmessage;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}

function bbcode(text) {
	var txtarea = document.post.yourmessage;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}




