// JavaScript Document
var timeout_personal;
var personalmenu = true;
function hw_show_personal(show, mode) {
	if (!personalmenu) return;
	if (show) 
	{
		document.getElementById('p-personal-menu').style.display = 'block';
		if (mode=='init') timeout_personal = setTimeout('hw_show_personal(false)', 1000);
	}
	else 
	{
		document.getElementById('p-personal-menu').style.display = 'none';
		clearTimeout(timeout_personal);
	}
}	

var timeout_more;
var moremenu = true;
function ca_more_toggle(show, mode) {
	if (!moremenu) return;
	if (show) 
	{
		morebox_style = document.getElementById('ca-more-box').style;
		morebox_style.display = 'block';
//		morebox_style.top=(mouse_y+10)+"px";
//		morebox_style.left=(mouse_x+15)+"px";
	
		if (mode=='init') timeout_more = setTimeout('ca_more_toggle(false)', 1000);
		else if (timeout_more) clearTimeout(timeout_more);
	}
	else 
	{
		document.getElementById('ca-more-box').style.display = 'none';
		if (timeout_more) clearTimeout(timeout_more);
	}
}	

function check_pagename(pagename)
{
	forbidden = new Array('[', ']', '{', '}', '&', '?', '<', '>', '\\', ',');
	valid = true;
	if (pagename=="") return false;
	for (i=0; i<forbidden.length; i++) 
		if (pagename.indexOf(forbidden[i])!=-1)  
		{
			valid=false;
			hw_alert('Das Zeichen '+forbidden[i]+' ist nicht erlaubt', 'ok');
			return false;
		}
	return true;
}

var mouse_x=0; 
var mouse_y=0; 

if (navigator.appName == "Netscape") 
{ 
	document.captureEvents(Event.MOUSEMOVE); 
} 

document.onmousemove = mousexy;	

function mousexy(e) { 
	if (navigator.appName == "Netscape") 
	{ 
		mouse_x = e.pageX; 
		mouse_y = e.pageY; 
	} 
	else 
	{ 
		var obj = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ?
         				window.document.documentElement : window.document.body || null;
		
		mouse_x = window.event.clientX + obj.scrollLeft; 
		mouse_y = window.event.clientY + obj.scrollTop; 
	} 
} 

var page_height = false;
var page_width = false;

function get_page_size()
{
	if (window.innerHeight && window.scrollMaxY) 
	{
		page_width = document.body.scrollWidth;
		page_height = window.innerHeight + window.scrollMaxY;
	} 
	else if (document.body.scrollHeight > document.body.offsetHeight)  // all but Explorer Mac
	{ 
		page_width = document.body.scrollWidth;
		page_height = document.body.scrollHeight;
	} else if (	document.documentElement && 
				document.documentElement.scrollHeight > document.documentElement.offsetHeight) // Explorer 6 strict mode
	{
		page_width = document.documentElement.scrollWidth;
		page_height = document.documentElement.scrollHeight;
	} 
	else // Explorer Mac...would also work in Mozilla and Safari
	{ 
		page_width = document.body.offsetWidth;
		page_height = document.body.offsetHeight;
	}
}
/*
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}
window.attachEvent("onload", correctPNG);

*/