function changeimage(bild,c)
{
  counter=c;
  document.getElementById('titel').value = tit[counter];
  document.bild.src = img[counter].src;
}
function getDelayTime(dlTime)
{
   var temp = parseInt(dlTime);
   if(temp != NaN)
   delayTime = temp * 500;
   else
   delayTime = 100;
}

function anim()
{
   if(counter == anzahl_bilder)
   {
       counter = 1; //sets the counter value to 0
	}
	else
	{
	   counter++;
	}
   document.bild.src = img[counter].src;
   document.getElementById('titel').value = tit[counter];
   if(counter == anzahl_bilder)
    counter = 0; //sets the counter value to 0
}

function slide()
{
   with(document.form1)
   {
   start = setInterval('anim()', delayTime);
   stShow.disabled = true;
   spShow.disabled = false;
   }
}

function stopSlide()
{
   clearInterval(start);
   document.form1.stShow.disabled = false;
   document.form1.spShow.disabled = true;
}

var NN3=false;

function on3(name) {
   document[name].src=eval(name+"on.src");
}
function off3(name) {
   document[name].src=eval(name+".src");
}
NN3=true;

function on(name) {
   if (NN3) on3(name);
}
function off(name) {
   if (NN3) off3(name);
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

function is_odd( $int )
{
  return( $int & 1 );
}




















function CreatePopUp()
{
///var altxt=document.bild.src;
//var altxt=tit[counter]
var img_url   = img_pop[counter].src;
var img_w     = sizew_pop[counter];
var img_h     = sizeh_pop[counter];
var img_title = tit[counter];

var altxt="url: "+img_url+" width: "+img_w+" height: "+img_h+" title: "+img_title;

PopupWindow(img_url,img_w,img_h,img_title,'','1')
//alert(altxt);
//return false;

}

function PopupWindow(imageName,imageWidth,imageHeight,alt,bgcolor,mode)
{
	alt="Kran Knoll | "+alt
	if (bgcolor=="") {
		bgcolor="#EDEDA0";
	}
	
	var a         = 1;
	var scrHeight = imageHeight;
	var scrHeight = (scrHeight*a) + 25;
	var scrWidth  = imageWidth;
	var posLeft   = 10;
	var posTop    = 10;
	var titlea    = "www.KRAN-KNOLL.de";
	newWindow     = window.open("","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><head><title>'+alt+'</title>');
	newWindow.document.write('<script language="JavaScript">function clwin(){ window.close()}</script></head>');
	newWindow.document.write('<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onBlur="self.close()" onClick="self.close()">');   
	newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" ');
	newWindow.document.write('align="center" height='+scrHeight+' ><tr><td>');
	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight); 
	newWindow.document.write(' alt='+alt+'>'); 
	newWindow.document.write('</td></tr><tr><td height="25"><p align="center"><a href="javascript:clwin();">');
	newWindow.document.write('<img border="0" src="http://www.kran-knoll.de/images/button_schliessen.gif" width="63" height="13">');
	newWindow.document.write('</a></td></tr></table></body></html>');
	newWindow.document.close();
	newWindow.focus();
}


function PopupWindowTxT(filName,alt,bgcolor,mode,pL,pT) {

	if (bgcolor=="") {
		bgcolor="#FFFFFF";
	}
	var adj=10;
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

    if(w<740){
      var lift=0.90;
    }
    if(w>=740 & w<835){
      var lift=0.91;
    }
    if(w>=835){
      var lift=0.93;
    }

	var scrWidth = w;
	var scrHeight = h;
	var posLeft=pL;
	var posTop=pT;

	newWindow = window.open("","newWindow","width='300',height='300',left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><head><title>'+alt+'</title>');
	newWindow.document.write('<script language="JavaScript">function clwin(){ window.close()}</script></head>');
	newWindow.document.write('<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' >');  
	newWindow.document.write('<table width="250" border="0" cellspacing="0" cellpadding="0" align="center" height="300" >');
	newWindow.document.write('<tr><td align="center">');
	newWindow.document.write(filName); 
	newWindow.document.write('</td></tr><tr><td><p align="center"><a href="javascript:clwin();">');
	newWindow.document.write('<img border="0" src="http://www.kran-knoll.de/images/button_schliessen.gif" width="63" height="13">');
	newWindow.document.write('</a></td></tr></table></body></html>');
	newWindow.document.close();
	newWindow.focus();
}

var wstat
var ns4up = (document.layers) ? 1 : 0
var ie4up = (document.all) ? 1 : 0
var xsize = screen.width
var ysize = screen.height
var breite=400
var hoehe=425
var xpos=(xsize-breite)/2
var ypos=(ysize-hoehe)/2
function opwin(fName) {
wstat=window.open(fName,"","scrollbars=no,status=no,toolbar=no,location=no,directories=no,resizable=no,menubar=no,width="+breite+",height="+hoehe+",screenX="+xpos+",screenY="+ypos+",top="+ypos+",left="+xpos)
}



function email_txt(name, domain, tld) 
{ 
var mail = name + "@" + domain + "." + tld; 
var link = "<a href='mailto:" + name + "@" + domain + "." + tld + "'>" + mail + "</a>"; 
document.write(link); 
} 
