var testobject;
var browser;
var ie4_onmousemove_start=false;


function onload_tasks()
{
	testobject=new crossbrowserobject();
	browser=testobject.browsertype();
	if (browser=="opera")
	{
		testobject.set_visibility("outputdiv",hide);
		testobject.set_visibility("operaoutputdiv","visible");
	}
	if (browser=="nn4") test('NOTE: Netscape Navigator 4.x displays properly written pages in a very strange manner (some call it BUGS!). In order to indicate what that means, there are only a few workarounds on this page to solve these problems.');
	object_select();
	testobject.load_images("bobgeorge_logo.gif","bobgeorge_logo_over.gif");
	testobject.load_images("browser.gif","browser_over.gif");
	testobject.load_images("window.gif","window_over.gif");
	testobject.load_images("event.gif","event_over.gif");
	testobject.load_images("elements.gif","elements_over.gif");
	testobject.load_images("layerobject.gif","layerobject_over.gif");
	testobject.load_images("form.gif","form_over.gif");
	if (browser!="opera")
	{
		testobject.set_positiony("startdiv",testobject.get_objectheight("menudiv")+80);
		testobject.set_positiony("browserdiv",testobject.get_positiony("startdiv"));
		testobject.set_positiony("windowdiv",testobject.get_positiony("startdiv"));
		testobject.set_positiony("eventdiv",testobject.get_positiony("startdiv"));
		testobject.set_positiony("elementsdiv",testobject.get_positiony("startdiv"));
		testobject.set_positiony("layerobjectdiv",testobject.get_positiony("startdiv"));
		testobject.set_positiony("formdiv",testobject.get_positiony("startdiv"));
	}
	testobject.set_visibility("startdiv",show);
}

function test(value)
{
	if (browser!="opera") testobject.innerhtml("outputdiv",value);
	else document.forms["outputform"].elements["outputfield"].value=value;
}

function show_layer(object)
{
	testobject.set_visibility("startdiv",hide);
	testobject.set_visibility("browserdiv",hide);
	testobject.set_visibility("windowdiv",hide);
	testobject.set_visibility("eventdiv",hide);
	testobject.set_visibility("elementsdiv",hide);
	testobject.set_visibility("layerobjectdiv",hide);
	testobject.set_visibility("formdiv",hide);
	testobject.set_visibility(object,show);
}

function object_select()
{
	if (browser!="nn4") targetobject=document.forms[1].elements["objectselect"][document.forms[1].elements["objectselect"].selectedIndex].value
	else targetobject=document.layers["menudiv"].document.forms[0].elements["objectselect"][document.layers["menudiv"].document.forms[0].elements["objectselect"].selectedIndex].value
	if (browser=="mozilla" || browser=="ie5")//workaround for bug in nn6/mozilla
	{
		switch (targetobject)
		{
			case "testdiv1":	testobject.set_positionx(targetobject,480);
								testobject.set_positiony(targetobject,110);
								testobject.set_zindex(targetobject,5);
								break;
			case "testdiv2":	testobject.set_positionx(targetobject,520);
								testobject.set_positiony(targetobject,160);
								testobject.set_zindex(targetobject,10);
								break;
			case "testdiv3":	testobject.set_positionx(targetobject,575);
								testobject.set_positiony(targetobject,235);
								testobject.set_zindex(targetobject,15);
								break;
		}
		testobject.set_visibility(targetobject,show);
	}
	xbase=testobject.get_positionx(targetobject);
	ybase=testobject.get_positiony(targetobject);
}

function mousemove_control(passed_event)
{
	testobject.get_mouseposition(passed_event);
	window.status="Event onmousemove --- x: "+mousex+" - y: "+mousey+" --- "+testobject.mouseposition_type;
}


/*
Opens simply a new pop-up window given by a URL,
vertical and horizontal size.
*/
function open_window( url, name, width, height, scr ) {
screenwidth = screen.width;
left = screenwidth-width-10;

var win =
window.top.open(url,name,'toolbar=no,directories=no,status=no,menubar=no,resizeable=no,scrollbars='+scr+',width='+ width+',height='+height+'top=0,left='+left);

}

function open_middle_window( url, name, width, height, scr ) {
screenwidth = screen.width;
left = screenwidth-width-340;

var win =
window.top.open(url,name,'toolbar=no,directories=no,status=no,menubar=no,resizeable=no,scrollbars='+scr+',width='+ width+',height='+height+'top=0,left='+left);

}

function open_next_window( url, name, width, height, scr ) {
screenwidth = screen.width;
left = screenwidth-width-666;

var win =
window.top.open(url,name,'toolbar=no,directories=no,status=no,menubar=no,resizeable=no,scrollbars='+scr+',width='+ width+',height='+height+'top=0,left='+left);

}

function open_pic_only( url, name, width, height, scr ) {
screenwidth = screen.width;
left = screenwidth-width-10;


var win =
window.top.open(url,name,'toolbar=no,directories=no,status=no,menubar=no,resizeable=no,scrollbars=+no+,width='+width+',height='+height+'top=0,left='+left);

}

function open_pic_only_center( url, name, width, height, scr ) {
screenwidth = screen.width;
left = screenwidth-width-340;

var win =
window.top.open(url,name,'toolbar=no,directories=no,status=no,menubar=no,resizeable=no,scrollbars=+no+,width='+width+',height='+height+'top=0,left='+left);

}

function open_linklibrary( url, name, width, height, scr ) {
screenwidth = screen.width;
left = screenwidth-width-340;

var win =
window.top.open(url,name,'toolbar=no,directories=no,status=no,menubar=no,resizeable=no,scrollbars=+no+,width='+width+',height='+height+',top=500px,left='+left);
}

function open_voting( url, name, width, height, scr ) {
screenwidth = screen.width;
left = screenwidth-width-170;

var win =
window.top.open(url,name,'toolbar=no,directories=no,status=no,menubar=no,resizeable=no,scrollbars=+no+,width='+width+',height='+height+',top=500px,left='+left);

}

function open_newsletter( url, name, width, height, scr ) {
screenwidth = screen.width;
left = screenwidth-width-100;

var win =
window.top.open(url,name,'toolbar=no,directories=no,status=no,menubar=no,resizeable=no,scrollbars=+no+,width='+width+',height='+height+',top=100px,left='+left);

}

/* Alte Scripte */
/* Right Mouse Button Start */

var isie=0;
if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5)
  {
  isie=1;
  }
else
  {
isie=0;
  }
if(isie)
  {
  var html="";
  html+='<table style="border:1pt solid #808080" bgcolor="#CCCCCC" width="140" height="220" cellpadding="0" cellspacing="1">';
  html+='<st'+'yle type="text/css">\n';
  html+='a:link {text-decoration:none;font-family:Arial;font-size:8pt;}\n';
  html+='a:visited {text-decoration:none;font-family:Arial;font-size:8pt;}\n';
  html+='td {font-size:8pt;}\n';
  html+='<\/style>\n';
  html+='<sc'+'ript type="txt/javascript">\n';
  html+='\n<'+'!--\n';
  html+='window.onerror=null;\n';
  html+='/'+' -'+'->\n';
  html+='<\/script>\n';

  html+='<tr><td style="border:1pt solid #CCCCCC" id="i0" onmouseover="document.all.i0.style.background=\'#CFD6E8\';document.all.i0.style.border=\'1pt solid #737B92\';" onmouseout="document.all.i0.style.background=\'#CCCCCC\';document.all.i0.style.border=\'1pt solid #CCCCCC\';" onclick="window.parent.history.go(-1);"> <img src="js/rightmouse_personal_ie55_back.gif" width="12" height="12" border="0" hspace="0" vspace="0" align="absmiddle"> Zurück<\/td><\/tr>';
  html+='<tr><td style="border:1pt solid #CCCCCC" id="i1" onmouseover="document.all.i1.style.background=\'#CFD6E8\';document.all.i1.style.border=\'1pt solid #737B92\';" onmouseout="document.all.i1.style.background=\'#CCCCCC\';document.all.i1.style.border=\'1pt solid #CCCCCC\';" onclick="window.parent.history.go(1);"> <img src="js/rightmouse_personal_ie55_forward.gif" width="12" height="12" border="0" hspace="0" vspace="0" align="absmiddle"> Vorwärts<\/td><\/tr>';
  html+='<tr><td style="border:1pt solid #CCCCCC"><img src="js/rightmouse_personal_ie55_pixel.gif" width="130" height="1"><\/td><\/tr>';
  html+='<tr><td style="border:1pt solid #CCCCCC" id="i4" onmouseover="document.all.i4.style.background=\'#CFD6E8\';document.all.i4.style.border=\'1pt solid #737B92\';" onmouseout="document.all.i4.style.background=\'#CCCCCC\';document.all.i4.style.border=\'1pt solid #CCCCCC\';" onclick="window.parent.external.AddFavorite(window.top.location.href,window.top.document.title);"> <img src="js/rightmouse_personal_ie55_favorite.gif" width="12" height="12" border="0" hspace="0" vspace="0" align="absmiddle"> Zu Favoriten hinzufügen<\/td><\/tr>';
  /*html+='<tr><td style="border:1pt solid #CCCCCC" id="i5" onmouseover="document.all.i5.style.background=\'#CFD6E8\';document.all.i5.style.border=\'1pt solid #737B92\';" onmouseout="document.all.i5.style.background=\'#CCCCCC\';document.all.i5.style.border=\'1pt solid #CCCCCC\';" onclick="window.parent.location=\'view-source:\'+window.parent.location.href;"> <img src="js/rightmouse_personal_ie55_source.gif" width="12" height="12" border="0" hspace="0" vspace="0" align="absmiddle"> Quelltext anzeigen<\/td><\/tr>';
  html+='<tr><td style="border:1pt solid #CCCCCC"><img src="js/rightmouse_personal_ie55_pixel.gif" width="130" height="1"><\/td><\/tr>';*/
  html+='<tr><td style="border:1pt solid #CCCCCC" id="i6" onmouseover="document.all.i6.style.background=\'#CFD6E8\';document.all.i6.style.border=\'1pt solid #737B92\';" onmouseout="document.all.i6.style.background=\'#CCCCCC\';document.all.i6.style.border=\'1pt solid #CCCCCC\';" onclick="window.print();"> <img src="js/rightmouse_personal_ie55_print.gif" width="12" height="12" border="0" hspace="0" vspace="0" align="absmiddle"> Seite Drucken<\/td><\/tr>';
  html+='<tr><td style="border:1pt solid #CCCCCC" id="i7" onmouseover="document.all.i7.style.background=\'#CFD6E8\';document.all.i7.style.border=\'1pt solid #737B92\';" onmouseout="document.all.i7.style.background=\'#CCCCCC\';document.all.i7.style.border=\'1pt solid #CCCCCC\';" onclick="window.parent.location.href=window.parent.location.href;"> <img src="js/rightmouse_personal_ie55_refresh.gif" width="12" height="12" border="0" hspace="0" vspace="0" align="absmiddle"> Seite erneut laden<\/td><\/tr>';
  html+='<tr><td style="border:1pt solid #CCCCCC"><img src="js/rightmouse_personal_ie55_pixel.gif" width="130" height="1"><\/td><\/tr>';
  html+='<tr><td style="border:1pt solid #CCCCCC" id="i8" onmouseover="document.all.i8.style.background=\'#CFD6E8\';document.all.i8.style.border=\'1pt solid #737B92\';" onmouseout="document.all.i8.style.background=\'#CCCCCC\';document.all.i8.style.border=\'1pt solid #CCCCCC\';" onclick="if(window.parent.document.body.style.zoom!=0) window.parent.document.body.style.zoom*=1.6; else window.parent.document.body.style.zoom=1.6;"> <img src="js/rightmouse_personal_ie55_zoom.gif" width="12" height="12" border="0" hspace="0" vspace="0" align="absmiddle"> Zoom In<\/td><\/tr>';
  html+='<tr><td style="border:1pt solid #CCCCCC" id="i9" onmouseover="document.all.i9.style.background=\'#CFD6E8\';document.all.i9.style.border=\'1pt solid #737B92\';" onmouseout="document.all.i9.style.background=\'#CCCCCC\';document.all.i9.style.border=\'1pt solid #CCCCCC\';" onclick="if(window.parent.document.body.style.zoom!=0) window.parent.document.body.style.zoom*=0.625; else window.parent.document.body.style.zoom=0.625;"> <img src="js/rightmouse_personal_ie55_zoom.gif" width="12" height="12" border="0" hspace="0" vspace="0" align="absmiddle"> Zoom Out<\/td><\/tr>';

  html+='<\/table>';
  var oPopup = window.createPopup();
  }

function dopopup(x,y)
  {
  if(isie)
    {
    var oPopupBody = oPopup.document.body;
    oPopupBody.innerHTML = html;
    oPopup.show(x, y, 140, 220, document.body);
   }
  }

function click(e)
  {
  if(isie)
     {
     if(document.all)
       {
       if(event.button==2||event.button==3)
         {
         dopopup(event.x-1,event.y-1);
         }
       }
    }
  }

if(isie)
  {
  document.oncontextmenu = function()
    {
    dopopup(event.x,event.y);return false;
    }
  document.onmousedown = click;
  }

/* Right Mouse Button End 
*/

var loop,temp;
function up(was,wieweit){
var y= parseInt(document.all[was].style.top);
if (ns) {
	if(y>((document.layer[was].offsetHeight*-1)+90)){
document.layer[was].style.top=y-10;
temp=setTimeout('up("'+was+'",'+wieweit+')',90);
}
}
else {
if(y>((document.all[was].offsetHeight*-1)+90)){
document.all[was].style.top=y-10;
temp=setTimeout('up("'+was+'",'+wieweit+')',90);
}
}
}

function down(was){
var y= parseInt(document.all[was].style.top);
if (ns) {
if (y<0){
document.layer[was].style.top=y+10;
temp2=setTimeout('down("'+was+'")',100);
}
}
if (y<0){
document.all[was].style.top=y+10;
temp2=setTimeout('down("'+was+'")',100);
}
else {
if (y<0){
document.all[was].style.top=y+10;
temp2=setTimeout('down("'+was+'")',100);
}
}
}

function clearint(){
if (window.temp) clearInterval(temp);
}

function clearint2(){
if (window.temp2) clearInterval(temp2);
}

function initScrollButtons() {
if (ns) {
	if (document.layer['nippez'].offsetHeight < 10) {
	document.layer['nippez_scroller_pfeile'].style.visibility="hidden";
	}
	}
	if (document.all['nippez'].offsetHeight < 10) {
	document.all['nippez_scroller_pfeile'].style.visibility="hidden";
	}
	else {
	if (document.all['nippez'].offsetHeight < 10) {
	document.all['nippez_scroller_pfeile'].style.visibility="hidden";
	}
	}
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


/* Infolayer Script */

var n4    = document.layers;
var ie    = document.all;
var w3c   = document.getElementById;
var dhtml = ( n4 || ie || w3c );

var menuTimeout = 1000,
    layerTimeout = 500,	
    menuTimeHandle,
    layerTimeHandle,	
    menuActive = 0,
    layerActive = 0,
    menuLayer,
    layerLayer,
    menuImageSrc,
    menuImage,
    menuImageSrcArray = new Array( '' );

// preload images
var len = menuImageSrcArray.lenght;
var menuImageArray = new Array( len );

for ( var j = 0; j > len; j++ )
{
	menuImageArray[j] = new Image();
	menuImageArray[j].src = menuImageSrcArray[j];
}

function menuShow( x, img, swapSrc )
{
	if ( menuActive ) menuTimeNotify();

	var imgObj = document.images[img];
	
	if ( document.layers )
		{
		if ( document.layers["navLayer"].document.images[img] )
			imgObj = document.layers["navLayer"].document.images[img];
		}
		
	if ( typeof(img) != "undefined" && imgObj )
	{
		menuImage = img;
		menuImageSrc = imgObj.src;
		imgObj.src = swapSrc;
	}

	if ( x != '' )
	{
		if ( document.getElementById )
			document.getElementById(x).style.visibility = "visible";
		else if ( document.layers )
			document.layers[x].visibility = "show";
		else if ( document.all )
			document.all[x].style.visibility = "visible";
	}

	menuLayer  = x;
	menuActive = 1;
}

function menuHide( x )
{
	if ( x != '' )
	{
		if ( document.getElementById )
			document.getElementById(x).style.visibility = "hidden";
		else if ( document.layers )
			document.layers[x].visibility = "hide";
		else if ( document.all )
			document.all[x].style.visibility = "hidden";
	}
}

function menuTimeNotify()
{
	menuHide( menuLayer );
	clearTimeout( menuTimeHandle );
	
	var imgObj = document.images[menuImage];
	
	if ( document.layers )
		imgObj = document.layers["navLayer"].document.images[menuImage];
	
	if ( imgObj ) imgObj.src = menuImageSrc;
	menuActive = 0;
}

function menuRelease()
{
	var imgObj = document.images[menuImage];
	
	if ( document.layers )
		{
		if ( document.layers["navLayer"].document.images[menuImage] )
			imgObj = document.layers["navLayer"].document.images[menuImage];
		}

	if ( menuLayer != '' )
		menuTimeHandle = setTimeout( menuTimeNotify, menuTimeout );
		
	else if ( imgObj )
	{
		imgObj.src = menuImageSrc;
		menuActive = 0;
	}
} 

function menuHold()
{
	clearTimeout( menuTimeHandle );
}

var client_browser = ( navigator.appName == "Microsoft Internet Explorer" || navigator.appName == "" ) ? "ie" : "ns";
var client_os = ( navigator.appVersion.indexOf("Mac") >= 0 ) ? "_mac" : "";

document.writeln('<link rel="stylesheet" href="/statics/styles_'+client_browser+client_os+'.css" type="text/css">');

