
function ftext(num){  
if (document.getElementById('slideshowcontrols').style.display == "block")
{ return }
document.getElementById('contacttext').style.display = "none"; 
document.getElementById('newstext').style.display = "none"; 
fshowtextimage(num); 
return
}
function fnews(num){  
if (document.getElementById('slideshowcontrols').style.display == "block")
{ return }

fclose();
fshowcnews(num); 
return
}
function testtt(knum){  
var h = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
var w = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;

wb =  document.getElementsByTagName('body')[0].clientWidth;
hb =  document.getElementsByTagName('body')[0].clientHeight;

document.getElementById('backgr').style.width = wb + 'px';
document.getElementById('backgr').style.height = hb + 'px';
document.getElementById('backgr').style.zIndex = 1;
//fclose();

s=850;
bildh=550;
kpro = knum;
if(knum==1)
{
 window.location = "../sas"
}
kpro = kpro -1;
currentimage = startp[kpro];
if (knum>0)
 {
 s = ppictw[currentimage]; 
 bildh = ppicth[currentimage];
 }
s=850;  // change 
// lw=Math.round((w-s)*0.5) -100;
// lw=100; // only in case now images printed
lw=Math.round((w-s)*0.5) ;
hl=Math.round((h-bildh)*0.5);
hl=Math.max(hl,80);
hla = hl+90;
hla=100;  //change
habstr= 630;
hla=Math.round((h-habstr)*0.5); //change

document.getElementById('slideshowimage').style.marginLeft = lw + 'px';
document.getElementById('slideshowcontrols').style.marginLeft =  lw + 'px' ;
document.getElementById('slideshowimage').style.top = hl + 'px';
document.getElementById('slideshowcontrols').style.top =  hl + 'px' ;
document.getElementById('slidetext').style.display = "none";
document.getElementById('abstract0').style.marginLeft =  lw + 'px' ;
//document.getElementById('abstract0').style.left =   '0px' ;
document.getElementById('abstract0').style.top =  hla + 'px' ;
document.getElementById('abstract0').style.height =  habstr + 'px' ;
document.getElementById('abstract0').style.width =  s + 'px' ;

//fshow(); change
//  displayabstr= 1;
currentimage = 1; // initialize new
//changeimage(0); change
// change
w=document.getElementsByTagName('body')[0].clientWidth;
var h = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
border = 10;
awtext = 450;
awtext = 800;
lwa = (w-awtext-border-border)*0.5-100;
lwa = lwa +13;
lwa = Math.round((w-awtext)*0.5);
document.getElementById('abstract0').style.marginLeft =  lwa + 'px' ;
// change
fshowtext();
//fshowabstract(knum); //change
fshowProjectText(knum);
displayabstr = 0;
//currentimage = currentimage -1 ; // change
return
}
function changeimage(change){
ll1 = endp[kpro];
ll0 = startp[kpro];
currentimage += change;
if(currentimage > ll1 ){
 currentimage = ll0;
}
else if(currentimage < ll0){
currentimage = ll1 ;
}
if (displayabstr == 0) {
  document.getElementById('abstract0').style.zIndex = -1; 
  document.getElementById('abstract0').style.display = "none"; 
  document.getElementsByName('AllText').style.display = "none"; 
  }
w=document.getElementsByTagName('body')[0].clientWidth;
var h = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
s = ppictw[currentimage]; 
bildh = ppicth[currentimage];
border = 10;
l = (w-s-border-border)*0.5 -100;
l1  = l -20;
lwc = l +25;
// 
// text width awtext, see in lkm1.css class abstract0
//
awtext = 450;
lwa = (w-awtext-border-border)*0.5-100;
lwa = lwa +13;
lwc = lwa;
hl=Math.round((h-bildh-border-border)*0.5);
hl=Math.max(hl,80);
hla = hl+60;
hb=h-hl-bildh-border-border;
//document.getElementById('image').style.marginLeft = l + 'px';
//kba = document.getElementById('slideshowimage').style.height - document.getElementById('image').height;
document.getElementById('slideshowimage').style.marginLeft =  l + 'px' ;
document.getElementById('slideshowcontrols').style.marginLeft =  lwc + 'px' ;
document.getElementById('abstract0').style.marginLeft =  lwa + 'px' ;
document.getElementById('abstract0').style.top =  hla + 'px' ;
document.getElementById('slideshowimage').style.bottom = hb + 'px';
document.getElementById('slideshowimage').innerHTML = '<img id="image" src="' + images[currentimage] + '" onclick="changeimage(1);"/>';
waitimage();
}

function waitimage(){
if(document.getElementById('image').complete){
positioningimage();
return;
}
document.getElementById('loadingimage').style.zIndex = 2;
setTimeout('waitimage()',10);
}

function positioningimage(){
w=document.getElementsByTagName('body')[0].clientWidth;
// s=document.getElementById('image').width;
 s = ppictw[currentimage]; 
l = (w-s)*0.5 -100;
lwc = l +25;
//document.getElementById('image').style.marginLeft = l + 'px';
//kba = document.getElementById('slideshowimage').style.height - document.getElementById('image').height;
kba = 0;
//w=document.getElementById('image').width;
//s=parseInt(document.getElementById('slideshow').style.width);
//document.getElementById('slideshowimage').style.marginLeft =  l + 'px' ;
//document.getElementById('slideshowcontrols').style.marginLeft =  lwc + 'px' ;

document.getElementById('loadingimage').style.zIndex = -1;
}
function showcontrols(){
document.getElementById('slideshowcontrols').style.zIndex = 2;
}

function fclose() 
{ 
document.getElementById('backgr').style.zIndex = -1;
document.getElementById('loadingimage').style.display = "none";;
document.getElementById('slideshowimage').style.display = "none";
document.getElementById('slideshowcontrols').style.display = "none";
document.getElementById('slidetext').style.display = "none";
document.getElementById('contacttext').style.display = "none"; 
document.getElementById('newstext').style.display = "none"; 
document.getElementById('abstract0').style.display = "none"; 
document.getElementById('abstract1').style.display = "none"; 
document.getElementById('abstract2').style.display = "none"; 
}
function fshow() 
{ 
document.getElementById('loadingimage').style.display = "block";
document.getElementById('slideshowimage').style.display = "block";
document.getElementById('slideshowcontrols').style.display = "block";
document.getElementById('slidetext').style.display = "block";
document.getElementById('slideshowimage').style.zIndex = 2; 
document.getElementById('loadingimage').style.zIndex = 2; 
document.getElementById('slideshowcontrols').style.zIndex = 2; 
document.getElementById('slidetext').style.zIndex = 2; 
document.getElementById('contacttext').style.display = "none"; 
document.getElementById('newstext').style.display = "none"; 
}
function fshowtext() 
{ 
document.getElementById('slidetext').innerHTML = '<p>'+ttext[kpro]+' </p>';
}
function fshowtextimage(num) 
{ 
kpro = num;
kpro = kpro - 1;
document.getElementById('slidetext').style.zIndex = 2; 
document.getElementById('slidetext').style.display = "block"; 
document.getElementById('slidetext').innerHTML = '<p> '+ttext[kpro]+' </p>';
}
function fshowabstract(num) 
{ 
kpro = num;
kpro = kpro - 1;
habstr = anumbrow[kpro] *20 +40;
document.getElementById('abstract0').style.height =  habstr + 'px' ;
document.getElementById('abstract0').style.zIndex = 2; 
document.getElementById('abstract1').style.zIndex = 2; 
document.getElementById('abstract2').style.zIndex = 2; 
document.getElementById('abstract0').style.display = "block"; 
document.getElementById('abstract1').style.display = "block"; 
document.getElementById('abstract2').style.display = "block"; 
document.getElementById('abstract1').innerHTML = '<p> '+atext[kpro]+' </p>';
document.getElementById('abstract2').innerHTML = '<p> '+a1text[kpro]+' </p>';

}
function fshowProjectText(num)
{
habstr = 630;
s = 850;
document.getElementById('abstract0').style.height =  habstr + 'px' ;
document.getElementById('abstract0').style.width =  s + 'px' ;
document.getElementById('abstract0').style.zIndex = 2; 
document.getElementById('abstract0').style.display = "block"; 
}
function fshowcnews(num) 
{ 
if (num == '1')
{
document.getElementById('contacttext').style.zIndex = 2; 
document.getElementById('contacttext').style.display = "block"; 
document.getElementById('contacttext').innerHTML = '<p> '+ttextc+' </p>';
}
if (num == '0')
{
document.getElementById('newstext').style.zIndex = 2; 
document.getElementById('newstext').style.display = "block"; 
document.getElementById('newstext').innerHTML = '<p> '+ttextn+' </p>';
}
if (num == '-1')
{
document.getElementById('contacttext').style.zIndex = 2; 
document.getElementById('contacttext').style.display = "block"; 
document.getElementById('contacttext').innerHTML = '<p> '+ttextb+' </p>';
}
}

