var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) 
{

    if ((version >= 5.5) && (version <7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }
}


function initiate(val){
 stiva= new stoc();
	switch(val){
		case 'index':
		case 'impressum':
	
		stiva.current=document.getElementById('menu1');
		break;
		case 'unternehmen':
		stiva.current=document.getElementById('menu2');
		break;
		case 'beratung':
		stiva.current=document.getElementById('menu3');
		break;
		case 'leistungen':
		
		case 'viewprodukt':
		stiva.current=document.getElementById('menu4');
		
		break;
		case 'info':
		stiva.current=document.getElementById('menu5');
		break;
		case 'partner':
		stiva.current=document.getElementById('menu7');
		break;
		case 'kontakt':
		stiva.current=document.getElementById('menu6');
		break;
			case 'gallery':
		stiva.current=document.getElementById('menu8');
		break;
					case 'news':
		stiva.current=document.getElementById('menu9');
		break;
	}
}


function expand(t){
	if(stiva.allow==1){
	


	stiva.newone=t;
	hn=t.offsetHeight;
	hc=stiva.current.offsetHeight;
	startchange(hc,hn);
	}
}

function stoc(){
	this.current=null;
	this.newone=null;
	this.minh=36;
	this.maxh=96;
	this.factor=15;
	this.allow=1;
}

function startchange(hc,hn){
stiva.allow=0;
	stiva.newone.style.height=hn+"px";
	stiva.current.style.height=hc+"px";
	hc=hc-stiva.factor;
	
	hn=hn+stiva.factor;
	if(hn+stiva.factor>stiva.max){
	hn=stiva.max;
	}
	if(hn<=stiva.maxh){
		t=setTimeout('startchange('+hc+','+hn+')');
	} else {
	stiva.allow=1;
	stiva.current=stiva.newone;
	
	}

}


