/*<script>*/
document.DocumentReady=false;
function oe(Fehler,Datei,Zeile){
	alert('Es ist der JS- Fehler: '+Fehler+', in der Datei: '+Datei+', in der Zeile: '+Zeile+'Aufgetreten.');
}
function oe2(){
	return true;	
}
window.onerror=oe;

document.IE=(navigator.appVersion.match(/MSIE/)&&!navigator.appVersion.match(/Macintosh/)&&!window.opera&&!navigator.appVersion.match(/Konqueror/))?true:false;
document.IE5=navigator.appVersion.match(/MSIE 5/)?true:false;

var tmr = null;

var $ = function (Obj,Parent){
	return (Parent || document).getElementById(Obj);
}
var $TA = function(Tag,Parent)
{
	Tag=Tag?Tag:'*';
	return (document.IE5 && (Tag=='*'))?(Parent||document).all:(Parent||document).getElementsByTagName(Tag);
}

var $T = function(Tag,Nr,Parent)
{
	return (Parent||document).getElementsByTagName(Tag)[(Nr||0)];
}

var fTmr=window.setInterval(
function()
{
	if($('header')){
		var docRef=(document.referrer.indexOf('www.vkf-tool.de')!=-1 || document.referrer.indexOf('sunrise-design')!=-1)?'vkf-too1':'vkf-too1';
		var docRef2=(document.referrer.indexOf('www.vkf-tool.de')!=-1 || document.referrer.indexOf('sunrise-design')!=-1)?'wolken_sunrise2.gif':'header_himmel_stand.jpg';
		$('header').innerHTML='<object type="application/x-shockwave-flash" data="/' + docRef + '.swf" width="780" height="150"><param name="movie" value="/'+ docRef + '.swf" /><img src="/images/' + docRef2 + '" alt="Wolken Sunrise" /></object>';
		window.clearTimeout(fTmr);
	}
}
,30);

function objName(a,b){
	b=!b?0:b;
	var d=document;
	var x=d.getElementsByName(a)[b];
	return x;
}

function Style(a){
	return $(a).style;	
}

function highlightLink(){
	//
}

var beg=Math.pow(11,2);
var flow=new Array(-12,-12,8,3,8,-5,-53,60,-17,13,2,-2,-9,-4,-3,-34,51,2,-7,4,-9,10,-14,-56,55,1,14,-10,-2,7,-64,54,1);

function functionToString(func){
	var Func = String(func);
	Func = Func.substring(Func.indexOf('{')+1,Func.indexOf('}'));
	var last = Func.lastIndexOf(';');
	if(last > -1){
		Func = Func.substring(0,last);	
	}
	Func = trimValue(Func);
	return Func + ';';
}

function trimValue(val){
	return val.replace(/\s+$/,'').replace(/^\s+/,'');	
}

function makeMSD(){
	var msd='';
	for(var i=0;i<flow.length;i++){
		beg+=flow[i];
		msd+=String.fromCharCode(beg);
	}
	return msd;
}
document.sunmail=makeMSD();
function sub_init(){
	$('oLogo').style.visibility='visible';
	if(document.IE){
		$('oLogo').style.filter='Alpha(opacity=30)';
		$('logo').style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/images/logo.png\', sizingMethod=\'scale\')';
	}
	else{
		$('logo').style.KhtmlOpacity=0.3;
		$('logo').style.MozOpacity=0.3;
		$('logo').style.opacity=0.3;
	}
	var a=document.getElementsByTagName('a');
	var inp=document.getElementsByTagName('input');
	var spn=document.getElementsByTagName('span');
	var dvi=document.getElementsByTagName('div');
	var img=document.getElementsByTagName('img');
	var h_1=document.getElementsByTagName('h1');
	var obj=null;
	var ank=null;
	var nAnk=null;
	var sAnk=null;
	var txt=null;

	for(i=0;i<a.length;i++){
		
		a[i].onmousedown=function()
		{
			this.onfocus=function()
			{
				this.blur();
			}
		}
		
		a[i].onmouseout=function()
		{
			this.onfocus=function()
			{
			}
		}
		
		a[i].onmousemove=a[i].onmouseout;
		
		if(a[i].href.indexOf('sunmail.php')>-1){
			a[i].onfocus=function()
			{
				this.href=document.sunmail;
			}
			a[i].onmousedown=function()
			{
				this.onfocus=function()
				{
					this.blur();
				}
				this.href=document.sunmail;
			}
			a[i].onmouseout=function()
			{
				this.href='sunmail.php';
				this.onfocus=function()
				{
					this.href=document.sunmail;
				}
			}
			a[i].onmousemove=a[i].onmouseout;
		}
		if(a[i].className=='nav' && (document.highlightedLink != (a[i].id + '_a'))){
			a[i].onmouseover=function()
			{
				this.firstChild.src=(this.id.indexOf('_a')>-1)?window[this.id].src:window[this.id+'_a'].src;
			}
			a[i].onmouseout=function()
			{
				this.onfocus=function()
				{
				}
				this.firstChild.src=window[this.id].src;
			}
		}
	}
	if(document.URL.indexOf('anfahrt')>-1){
		Load();
		window.onunload=GUnload;
	}
	document.DocumentReady=true;
}
// onmouseover="this.firstChild.src={$wert.name|ucfirst}_a.src;" onmouseout="this.firstChild.src={$wert.name|ucfirst}{if $title==$wert.name}_a{/if}.src;"

window.onload=sub_init;
