/* ######### Zeig den Layer für die Shopfunktionen an ################ */

/******************************************
* Popup Box- By Jim Silver @ jimsilver47@yahoo.com
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/

var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

//drag drop function for NS 4////
/////////////////////////////////

var dragswitch=0
var nsx
var nsy
var nstemp

// #### Merker für Position der Anzeige-Fenster  ####
var posX = 0, posY = 0;

// #### Merker für Browser-Größe  ####
var myWidth;
var myHeight;

if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}


function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for ie4+ and NS6////
/////////////////////////////////


function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
return false
}
}

function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

function hidebox(){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}

function zeige_shopfunktionen(url){
	positionSetzenZentriert();
	document.getElementById("faq").style.left=posX+"px";
	document.getElementById("faq").style.top=posY+"px";
	document.getElementById("faq").style.display="inline";
	window.frames["iframe_faq"].location = url;
}

function zeige_tooltip_uebernommen(){
	document.getElementById("tooltip-uebernommen").style.left=posX+"px";
	document.getElementById("tooltip-uebernommen").style.top=posY+"px";
	document.getElementById("tooltip-uebernommen").style.visibility="visible";

	// nach bestimmter Zeit wieder ausblenden
	window.setTimeout( "document.getElementById('tooltip-uebernommen').style.visibility='hidden';" ,1500);
}


// #######  Maus-Position wird hier bestimmt (für Anzeige von 'tooltip-uebernommen' ) #########

document.onclick = positionSetzenMaus;

function positionSetzenMaus(e) {

  if(!e) e = window.event;

	posX = e.clientX;
	posY = e.clientY;

    var b = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ?
    window.document.documentElement : window.document.body || null;

    if (b)
    {
        posX += b.scrollLeft;
        posY +=  b.scrollTop;
    }


  // catch possible negative values in NS4
  if (posX < 0){posX = 0}
  if (posY < 0){posY = 0}

  posX += 20;
  posY -= 30;

  if ( posX+150 > myWidth ) {
	posX = myWidth - 165;
  }

}

// #######  bestimmt, die zentrierte Position für das Shop-Funktionen Anzeige-Fenster  ######

function positionSetzenZentriert() {
  posX = (myWidth - 800) / 2;
  posY = (myHeight - 600) / 2;
}

// Ausgabe der Hilfe-Seiten als versteckter Div-Container

	document.write("<div id='showimage' style='z-index:999;position:absolute;width:800px;visibility:hidden;'>");
		document.write("<div id='box-shopfunktionen'>");
			document.write("<div id='dragbar' style='position:relative;width:700px;height:15px;left:40px;cursor:move;' onMousedown='initializedrag(event)'>");
			document.write("<ilayer width='100%' onSelectStart='return false'><layer width='100%' onMouseover='dragswitch=1;if (ns4) drag_dropns(showimage)' onMouseout='dragswitch=0'>");
			document.write("</layer></ilayer>");
			document.write("</div>");
			document.write("<h1>&Uuml;bersicht der SuMa-Shopfunktionen</h1>");
			document.write("<div class='shopfunktionen-bild'>");
				document.write("<img src='picts/shopfunktionen/shopfunktionen.gif' width='619' height='459' alt='' border='0' />");
			document.write("</div>");
			document.write("<div id='fenster-schliessen'>");
				document.write("<a title='Fenster schliessen' href='javascript:void(0)' onClick='hidebox();return false'><img src='picts/buttons/schliessen.gif' width='20px' height='21px' border=0> Fenster schliessen</a>");
			document.write("</div>");
		document.write("</div>");
	document.write("</div>");

// Ausgabe der Tooltip-Info, wenn die Konfiguration geändert wurde

	document.write("<div class='dunkelgrau' id='tooltip-uebernommen' style='z-index:999;position:absolute;width:150px;left:0px;top:0px;visibility:hidden;'>");
		document.write("<table cellpadding='0' cellspacing='0' border='0'>");
			document.write("<tr>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='0' height='0' alt='' border='0' /></td>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='0' height='0' alt='' border='0' /></td>");
				document.write("<td colspan='2'></td>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='0' height='0' alt='' border='0' /></td>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='0' height='0' alt='' border='0' /></td>");
			document.write("</tr>");
			document.write("<tr>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='3' height='4' alt='' border='0' /></td>");
				document.write("<td><img src='picts/spruchblase/ecke_oben_links.gif' width='6' height='6' alt='' border='0' /></td>");
				document.write("<td colspan='2' background='picts/spruchblase/linie_horizontal.gif''><img src='picts/spruchblase/trans.gif' width='1' height='1' alt='' border='0' /></td>");
				document.write("<td><img src='picts/spruchblase/ecke_oben_rechts.gif' width='6' height='6' alt='' border='0' /></td>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='0' height='0' alt='' border='0' /></td>");
			document.write("</tr>");
			document.write("<tr>");
				document.write("<td></td>");
				document.write("<td background='picts/spruchblase/linie_vertikal_links.gif'>");
				document.write("<img src='picts/spruchblase/trans.gif' width='0' height='0' alt='' border='0' />");
				document.write("</td>");
					document.write("<td valign='middle' bgcolor='#FFFFFF'>");
					document.write("&nbsp;<img src='picts/buttons/konfig_ani.gif' width='17' height='17' alt='' border='0' />&nbsp;&nbsp;");
					document.write("</td>");
					document.write("<td valign='middle' bgcolor='#FFFFFF'>");
					document.write(" ... in Konfiguration<br />");
					document.write("&uuml;bernommen !");
				document.write("</td>");
				document.write("<td background='picts/spruchblase/linie_vertikal.gif'>");
				document.write("<img src='picts/spruchblase/trans.gif' width='0' height='0' alt='' border='0' />");
				document.write("</td>");
				document.write("<td></td>");
			document.write("</tr>");
			document.write("<tr>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='3' height='4' alt='' border='0' /></td>");
				document.write("<td><img src='picts/spruchblase/ecke_unten_links.gif' width='6' height='6' alt='' border='0' /></td>");
				document.write("<td colspan='2' background='picts/spruchblase/linie_horizontal_unten.gif'><img src='picts/spruchblase/trans.gif' width='0' height='0' alt='' border='0' /></td>");
				document.write("<td><img src='picts/spruchblase/ecke_unten_rechts.gif' width='6' height='6' alt='' border='0' /></td>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='1' height='1' alt='' border='0' /></td>");
			document.write("</tr>");
			document.write("<tr>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='3' height='4' alt='' border='0' /></td>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='3' height='4' alt='' border='0' /></td>");
				document.write("<td colspan='2'></td>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='3' height='4' alt='' border='0' /></td>");
				document.write("<td><img src='picts/spruchblase/trans.gif' width='1' height='1' alt='' border='0' /></td>");
			document.write("</tr>");
		document.write("</table>");
	document.write("</div>");

