<!--
/*
this script is property of firm EXIMA.
It's NOT for free Use!
*/
var PopMenu;

function WriteMess(WText){
if(!window.PopMenu)return;
PopMenu.innerHTML = WText;
}

function LoadStat(stat){
if(stat){
	PopMenu.style.background = 'white url(img/loading.gif) 50% 50% no-repeat';
	PopMenu.style.width = "200px";
	PopMenu.style.height = "70px";
}
else {
	PopMenu.style.background = '#ddd url(img/left_button.jpg) repeat-x 0 0';
	PopMenu.style.height = "auto";
}
}

function gABSx(TargObj) {
   var x = 0;
   if (TargObj && typeof TargObj.offsetParent != "undefined") {
     while (TargObj && typeof TargObj.offsetLeft == "number") {
       x += TargObj.offsetLeft;
       TargObj = TargObj.offsetParent;
     }
   }
   return x;
}


function gABSy(TargObj){
   var y = 0;
   if (TargObj && typeof TargObj.offsetParent != "undefined") {
     while (TargObj && typeof TargObj.offsetTop == "number") {
       y += TargObj.offsetTop;
       TargObj = TargObj.offsetParent;
     }
   }
   return y;
}

function PopON(TartgetID){
var Target = document.getElementById(TartgetID);
PopMenu = document.getElementById('PopUp');
PopMenu.style.top = gABSy(Target)+50+'px';
PopMenu.style.left = gABSx(Target)+50+'px';
PopMenu.style.visibility = 'visible';
PopMenu.style.width = "auto";
PopMenu.style.height = "auto";
// PopMenu.style.background = 'white';
}

function PopOFF(){
if(!window.PopMenu)return;
PopMenu.style.visibility = 'hidden';
PopMenu.style.height = 0;
PopMenu.style.width = 0;
PopMenu.innerHTML = '';
}

function hidemenu(){
		PopMenu.style.visibility="hidden";
}


function delayhidemenu(){
	delayhide=setTimeout("hidemenu()",300);
}

function clearhidemenu(){
	if (window.delayhide)
		clearTimeout(delayhide);
}


function OpenPiTab(Tab,MaxT){
var i;
for(i=0;i<MaxT;i++)
	if('Tab'+i == Tab) {
		document.getElementById('Tab'+i).style.display = 'block';
		document.getElementById('TabH'+i).style.background = 'url(img/reiters/rolew.gif) no-repeat 0 0';
		document.getElementById('TabH2'+i).style.background = 'url(img/reiters/rorew.gif) no-repeat 0 0';
	}
	else {
		document.getElementById('Tab'+i).style.display = 'none';
		document.getElementById('TabH'+i).style.background = 'url(img/reiters/roldg.gif) no-repeat 0 0';
		document.getElementById('TabH2'+i).style.background = 'url(img/reiters/rordg.gif) no-repeat 0 0';
	}
}


function SubmitForm(fname){
document.forms[fname].method="post";
document.forms[fname].target="uploadT";
document.forms[fname].action = 'sendmail.php?cmd=kontakt';
document.forms[fname].submit();
}


function submitK(ID){

var miss = 0;
var feld, i=0;
var felder = new Array();
felder[0] = 'fio';
felder[1] = 'mail';
// felder[2] = 'firma';
// felder[3] = 'country';
felder[2] = 'text';
felder[3] = 'code';

while(feld = document.kontakt.elements[felder[i]]){
	var out = document.getElementById(felder[i]);
	if(feld.value==''){
		miss++;
		out.style.background = 'transparent url(img/wichtig-r.gif) 0% 50% no-repeat';
		out.style.color = 'red';
	}else {
		out.style.background = 'transparent url(img/wichtig.gif) 0% 50% no-repeat';
		out.style.color = '#000';
	}
	i++;
}
if(!miss){
	PopOFF();
	PopON(ID);
	LoadStat(1);
	SubmitForm('kontakt');
}
}

function rewriteNN(nn){
document.kontakt.nn.value = nn;
var cnt = new Date();
document.images['codeimage'].src = 'img/codeimage.png?'+cnt.getTime();
document.kontakt.code.value = '';
}

function showRimgs(TID){
var SRCI = document.getElementById(TID);
var DSTI = new Image();
var XRatio = 300 / 56;
var YRatio = 300 / 50;
DSTI.src = SRCI.src;
var Ratio = (DSTI.width > DSTI.height ? XRatio : YRatio);

if((DSTI.width > 300)||(DSTI.height > 300)){
	document.images['image1'].width = Math.round(SRCI.width * Ratio);
	document.images['image1'].height = Math.round(SRCI.height * Ratio);
}else{
	document.images['image1'].width = DSTI.width;
	document.images['image1'].height = DSTI.height;
}
document.images['image1'].style.marginTop = (300 -document.images['image1'].height)/2+'px';
document.images['image1'].style.marginLeft = (300 -document.images['image1'].width)/2+'px';

document.images['image1'].src =SRCI.src;
}

var oldid = 0;

function setEffekt(id,wert) {
var td = document.getElementById(id).style;
td.opacity = (wert / 100);
td.KhtmlOpacity = (wert / 100);
td.filter = "alpha(opacity=" + wert + ")";
td.MozOpacity = (wert / 100);
}


function markierer(id){
var i, start=0;

if(id == oldid) return;

if(oldid){
	document.images[oldid].src ='img/'+oldid+'_d.png';
	document.getElementById(oldid+'_div').style.display = 'none';
}
document.images[id].src ='img/'+id+'.png';
document.getElementById(id+'_div').style.display = 'block';

oldid = id;
}

function infoPopON(eV, str){
var Target = document.getElementById('infoPop');
Target.innerHTML = str;
// Target.style.top = eV.clientY-40+'px';
// Target.style.left = eV.clientX+20+'px';
clearTimeout(Thandle);
Target.style.visibility="visible";
}

var Thandle;

function infoPopOFF(){
// var Target = document.getElementById('infoPop');
// Target.style.top = 0+'px';
// Target.style.left = 0+'px';
clearTimeout(Thandle);
Thandle = setTimeout('infoPopHIDDE()',500);
}

function infoPopHIDDE(){
var Target = document.getElementById('infoPop');
if(Target.style.visibility=="visible") Target.style.visibility="hidden";
}

function StHL(id){document.getElementById(id).style.backgroundColor='#d0d0df';}
function RstHL(id){document.getElementById(id).style.backgroundColor='';}
-->
