function openImage(shckp)
{
	shcknw = window.open('', '','width=610,height=610,resizable=yes,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,location=no');
  
	shcknw.document.open();
	shcknw.document.write("<html>");
	shcknw.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>");
	shcknw.document.write("<head>");
	shcknw.document.write("<title>HiFi Concept LIVING<\/title>");
	shcknw.document.write("<\/head>");
	shcknw.document.write("<body marginwidth=10>");
	shcknw.document.write("<table width=100% align=center><tr><td><img src="+shckp+" alt='' /></td><td width=10>&nbsp;</td></tr></table>");
	shcknw.document.write("<\/body><\/html>");
	shcknw.document.close();
}

function openImageSmall(shckp)
{
	shcknw = window.open('', '','width=386,height=386,resizable=yes,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,location=no');
  
	shcknw.document.open();
	shcknw.document.write("<html>");
	shcknw.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>");
	shcknw.document.write("<head>");
	shcknw.document.write("<title>HiFi Concept LIVING<\/title>");
	shcknw.document.write("<\/head>");
	shcknw.document.write("<body marginwidth=10>");
	shcknw.document.write("<table width=100% align=center><tr><td><img src="+shckp+" alt='' /></td><td width=10>&nbsp;</td></tr></table>");
	shcknw.document.write("<\/body><\/html>");
	shcknw.document.close();
}

function openImageLandscape(shckp)
{
	shcknw = window.open('', '','width=606,height=306,resizable=yes,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,location=no');
  
	shcknw.document.open();
	shcknw.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>");
	shcknw.document.write("<html>");
	shcknw.document.write("<head>");
	shcknw.document.write("<title>HiFi Concept LIVING<\/title>");
	shcknw.document.write("<\/head>");
	shcknw.document.write("<body marginwidth=10>");
	shcknw.document.write("<table width=100% align=center><tr><td><img src="+shckp+" alt='' /></td><td width=10>&nbsp;</td></tr></table>");
	shcknw.document.write("<\/body><\/html>");
	shcknw.document.close();
}

function openImageLandscapeSmall(shckp)
{
	shcknw = window.open('', '','width=306,height=206,resizable=yes,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,location=no');
  
	shcknw.document.open();
	shcknw.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>");
	shcknw.document.write("<html>");
	shcknw.document.write("<head>");
	shcknw.document.write("<title>HiFi Concept LIVING<\/title>");
	shcknw.document.write("<\/head>");
	shcknw.document.write("<body marginwidth=10>");
	shcknw.document.write("<table width=100% align=center><tr><td><img src="+shckp+" alt='' /></td><td width=10>&nbsp;</td></tr></table>");
	shcknw.document.write("<\/body><\/html>");
	shcknw.document.close();
}

function openImageLandscapeTiny(shckp)
{
	shcknw = window.open('', '','width=206,height=106,resizable=yes,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,location=no');
  
	shcknw.document.open();
	shcknw.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>");
	shcknw.document.write("<html>");
	shcknw.document.write("<head>");
	shcknw.document.write("<title>HiFi Concept LIVING<\/title>");
	shcknw.document.write("<\/head>");
	shcknw.document.write("<body marginwidth=10>");
	shcknw.document.write("<table width=100% align=center><tr><td><img src="+shckp+" alt='' /></td><td width=10>&nbsp;</td></tr></table>");
	shcknw.document.write("<\/body><\/html>");
	shcknw.document.close();
}

function openImageLandscapeHigh(shckp)
{
	shcknw = window.open('', '','width=606,height=406,resizable=yes,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,location=no');
  
	shcknw.document.open();
	shcknw.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>");
	shcknw.document.write("<html>");
	shcknw.document.write("<head>");
	shcknw.document.write("<title>HiFi Concept LIVING<\/title>");
	shcknw.document.write("<\/head>");
	shcknw.document.write("<body marginwidth=10>");
	shcknw.document.write("<table width=100% align=center><tr><td><img src="+shckp+" alt='' /></td><td width=10>&nbsp;</td></tr></table>");
	shcknw.document.write("<\/body><\/html>");
	shcknw.document.close();
}

function openImageLandscapeLarge(shckp)
{
	shcknw = window.open('', '','width=606,height=506,resizable=yes,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,location=no');
  
	shcknw.document.open();
	shcknw.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>");
	shcknw.document.write("<html>");
	shcknw.document.write("<head>");
	shcknw.document.write("<title>HiFi Concept LIVING<\/title>");
	shcknw.document.write("<\/head>");
	shcknw.document.write("<body marginwidth=10>");
	shcknw.document.write("<table width=100% align=center><tr><td><img src="+shckp+" alt='' /></td><td width=10>&nbsp;</td></tr></table>");
	shcknw.document.write("<\/body><\/html>");
	shcknw.document.close();
}

function openImageLandscapeMid(shckp)
{
	shcknw = window.open('', '','width=350,height=250,resizable=yes,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,location=no');
  
	shcknw.document.open();
    shcknw.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>");
    shcknw.document.write("<html>");
	shcknw.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>");
	shcknw.document.write("<head>");
	shcknw.document.write("<title>HiFi Concept LIVING<\/title>");
	shcknw.document.write("<\/head>");
	shcknw.document.write("<body marginwidth=10>");
	shcknw.document.write("<table width=100% align=center><tr><td><img src="+shckp+" alt='' /></td><td width=10>&nbsp;</td></tr></table>");
	shcknw.document.write("<\/body><\/html>");
	shcknw.document.close();
}

function openNewsPopup(){
	window.open("html/news.html", "","width=780,height=650,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,location=no");
}

function openGelegenheitenPopup(){
	window.open("gelegenheiten.html", "","width=660,height=670,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,location=no");
}

function openSpectralPopup(){
	window.open("spectralgeschichte.html", "","width=460,height=670,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,location=no");
}

function openImpressumPopup(){
	window.open("html/impressum.html", "", "width=515,height=700,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,location=no");
}

function openxmasPopup(){
	window.open("xmas.html", "","width=805,height=670,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,location=no");
}

function opensalePopup(){
	window.open("sale.html", "","width=675,height=670,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,location=no");
}
function openPanorama() 
{
    window.open("panorama.html", "", "width=680,height=600,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,location=no");
}

function openValentinstagPopup(){
	window.open("valentinstag.html", "","width=460,height=750,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,location=no");
}

window.addEventListener?window.addEventListener("load",so_init,false):window.attachEvent("onload",so_init);

var d=document, bilder = new Array(), zInterval = null, aktuell=0, pause=false; bilderAnzahl=6; bilderPfad="../imgs/imgs/news/"; geschwindigkeit=3000;

function so_init() {
	if(!d.getElementById || !d.createElement)return;	
	

	bild = d.getElementById("slideshow").getElementsByTagName("img");
	bilder[0] = bild[0];
	bilder[0].style.display = "block";
	bilder[0].xOpacity = .99;

	bilder[1] = new Image();
	bilder[1].src = bilderPfad + "002.jpg";
	bilder[1].xOpacity = 0;
	d.getElementById("slideshow").appendChild(bilder[1]);
	
	setTimeout(so_xfade,geschwindigkeit);
	neuesBild();
}

function so_xfade() {
	cOpacity = bilder[aktuell].xOpacity;
	nIndex = bilder[aktuell+1]?aktuell+1:0;
	nOpacity = bilder[nIndex].xOpacity;
	
	cOpacity-=.05; 
	nOpacity+=.05;
	
	bilder[nIndex].style.display = "block";
	bilder[aktuell].xOpacity = cOpacity;
	bilder[nIndex].xOpacity = nOpacity;
	
	setOpacity(bilder[aktuell]); 
	setOpacity(bilder[nIndex]);
	
	if(cOpacity<=0) {
		bilder[aktuell].style.display = "none";
		aktuell = nIndex;
		setTimeout(so_xfade,geschwindigkeit);
		neuesBild();
	} else {
		setTimeout(so_xfade,50);
	}
	
	function setOpacity(obj) {
		if(obj.xOpacity>.99) {
			obj.xOpacity = .99;
			return;
		}
		obj.style.opacity = obj.xOpacity;
		obj.style.MozOpacity = obj.xOpacity;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")";
	}	
}

function neuesBild() {
	// immer ein Bild vorausladen
	if ( (aktuell < (bilderAnzahl-2)) && (bilder.length < bilderAnzahl) ) {
		bilder[aktuell+2] = new Image();
		bilder[aktuell+2].src =  bilderPfad + "0" + ((aktuell+3)<10 ? "0" + (aktuell+3) : (aktuell+3)) + ".jpg"
		bilder[aktuell+2].xOpacity = 0;
		d.getElementById("slideshow").appendChild(bilder[aktuell+2]);
	}
}
