function hilfe(seite) {
	parent.popiframe.location.href='/modul.cms.popup.php?doc='+seite;
	writeinlinepopup(800,'max');
}

function login(server) {
	parent.popiframe.location.replace(server+'modul.cms.login.php');
	writeinlinepopup(450,380);
}

function addBasket(server,shop,nr,ref) {
	if (ref=="basket") parent.popiframe.location.replace(server+'modul.shop.addBasket.php?domain='+shop+'&bestellnr='+nr+'&ref='+ref);
	else parent.popiframe.location.replace(server+'modul.shop.addBasket.php?domain='+shop+'&bestellnr='+nr+'&ref='+ref);
	writeinlinepopup(800,500);
}

function lagerbestand(hersteller, bestellnr) {
	parent.popiframe.location.href='/modul.shop.lagerbestand.php?hersteller='+hersteller+'&bestellnr='+bestellnr;
	writeinlinepopup(800,500);
}

function fragestellen(betreff) {
	parent.popiframe.location.href='/modul.cms.fragestellen.php?betreff='+betreff;
	writeinlinepopup(800,520);
}

function wunschpreis(betreff) {
	parent.popiframe.location.href='/modul.shop.wunschpreis.php?betreff='+betreff;
	writeinlinepopup(800,500);
}

function fax() {
	x=800;
	y=500;
	l=Math.round((screen.width-x)/2);
	t=Math.round((screen.height-y)/2);
	window.open ('../fax.php','faxfenster','menubar=yes,toolbar=yes,resizable=yes,scrollbars=yes,width='+x+',height='+y+',left='+l+',top='+(t-50));
}

var pbild = new Image();
var sbild = new Image();
var purl ="";
var groesse = "250";
var verzeichnis="../";

pbild.onload = function() {
	document.getElementById('produktbild').src=""+purl+"";
}

sbild.onload = function() {
	document.getElementById("produktbild").src=verzeichnis+"images/"+groesse+".php?shop=000000000&bild=bild_laden";
	// richtiges Bild laden
	pbild.src = ""+purl+"";
}


function prbild(url, text) {
	purl=url;
	sbild.src = verzeichnis+"images/"+groesse+".php?shop=go2a&bild=bild_laden";
	if (document.getElementById('bildtitel')) {
		document.getElementById('bildtitel').innerHTML=text;
	}
}

function przoom(hersteller,produkt,bild) {
	parent.popiframe.location.replace('/modul.shop.produktgallerie.php?hersteller='+hersteller+'&produkt='+produkt+'&bild='+bild);
	writeinlinepopup(800,570);
}

function awzoom(bild,ordner) {
	parent.popiframe.location.replace('/modul.cms.gallerie.php?bild='+bild+'&ordner='+ordner);
	writeinlinepopup(900,600);
}

function flvvideo(name) {
	parent.popiframe.location.replace('../template/media/flv/video.php?video='+name);
	writeinlinepopup(800,600);
}


function writeinlinepopup(breite,hoehe) {
	//	bestimmen der Anzeigefläche im Bildschirm
	var yPos;
	var myHeight;
	var myWidth;
	var ie;
	if (self.innerHeight) {	// all except Explorer
		yPos = self.pageYOffset;
		myHeight = self.innerHeight;
		myWidth = self.innerWidth;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict
		yPos = document.documentElement.scrollTop;
		myHeight = document.documentElement.clientHeight;
		myWidth = document.documentElement.clientWidth;
		ie=1;
	} else if (document.body) { // all other Explorers
		yPos = document.body.scrollTop;
		myHeight = document.body.clientHeight;
		myWidth = document.body.clientWidth;
		ie=1;
	}

	//	- Prüfen, ob gewünschte Höhe ins Fenster passt, wenn nein, Höhe korregieren
	//	- wenn maximale Höhe angezeigt werden soll, diese automatisch ermitteln
	if ((hoehe > myHeight) || (hoehe=="max")) hoehe = myHeight - 20;

	//	- Größe des Popups ändern
	parent.document.getElementById('pop').style.width= breite+ 'px';
	parent.document.getElementById('pop').style.margin='0px';
	parent.document.getElementById('inlinepopupiframe').style.width= breite + 'px';
	parent.document.getElementById('pop').style.height= hoehe + 'px';
	parent.document.getElementById('inlinepopupiframe').style.height= hoehe - 38 + 'px';

	//	Verschieben in y-Richtung
	yGo = (myHeight - hoehe) / 2;
	document.getElementById("pop").style.top = yPos+ yGo +"px";
	//	Verschieben in x - Richtung
	x = (myWidth - breite) / 2;
	document.getElementById("pop").style.left = x +"px";

	document.getElementById("off").style.height = document.body.scrollHeight + 150 + "px";
	document.getElementById('off').style.display='block';
	document.getElementById('pop').style.display='block';
}

/*		Inlinepopup ausblenden		*/
function deleteinlinepopup() {
	document.getElementById('off').style.display='none';
	document.getElementById('pop').style.display='none';
	parent.popiframe.location.replace('/modul.cms.popupnothing.php');
}



var shopcurver=false;
var shoprubbermaid=false;
var shopklaner=false;
var shopkaiser=false;
var shoplogos=false;
var starthover=false;
var meinshophover=false;
var helphover=false;
var menueon=0;
var waittime=false;


function hoverin(id) {
menueon=id;
	switch (id) {
		case 'shopcurver': clearTimeout(shopcurver); break;
		case 'shoprubbermaid': clearTimeout(shoprubbermaid); break;
		case 'shopklaner': clearTimeout(shopklaner); break;
		case 'shopkaiser': clearTimeout(shopkaiser); break;
		case 'shoplogos': clearTimeout(shoplogos); break;

		case 'starthover': clearTimeout(starthover); break;
		case 'meinshophover': clearTimeout(meinshophover); break;
		case 'helphover': clearTimeout(helphover); break;
	}
	document.getElementById(id).style.display ='block';
}
function hoverinwait(id) {
	if (menueon!=0) hoverin(id);
	else waittime=setTimeout('hoverin("'+id+'");',250);
}

function hoverout2(id) {
	document.getElementById(id).style.display ='none';
	if (menueon==id) menueon=0;
}
function hoverout(id) {
	clearTimeout(waittime);
	switch (id) {
		case 'shopcurver': shopcurver=setTimeout('hoverout2("'+id+'");',200); break;
		case 'shoprubbermaid': shoprubbermaid=setTimeout('hoverout2("'+id+'");',200); break;
		case 'shopklaner': shopklaner=setTimeout('hoverout2("'+id+'");',200); break;
		case 'shopkaiser': shopkaiser=setTimeout('hoverout2("'+id+'");',200); break;
		case 'shoplogos': shoplogos=setTimeout('hoverout2("'+id+'");',200); break;
		case 'starthover': starthover=setTimeout('hoverout2("'+id+'");',200); break;
		case 'meinshophover': meinshophover=setTimeout('hoverout2("'+id+'");',200); break;
		case 'helphover': helphover=setTimeout('hoverout2("'+id+'");',200); break;
	}
}

