document.write('<div id="dhtmltooltip"></div>');
document.write('<img id="dhtmlpointer" src="img/no.gif">');

function search_lieferartnr () {
	showveil();
	document.location.href =searchurl+document.getElementById("src").value;	
	}

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thetitel,thedesc,thepos){
	var ih="";
	if (ns6||ie){
	if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
	offsetfromcursorY=-50;
	if (typeof thepos!="undefined") offsetfromcursorX=thepos;
		ih="<table name='otab' id='otab'  WIDTH='"+thewidth+"' BORDER='0' CELLSPACING='0' CELLPADDING='0'><tr><td>";
		ih=ih+="<table WIDTH='"+thewidth+"' BORDER='0' CELLSPACING='0' CELLPADDING='0'>";
		ih=ih+"<tr><td><img SRC='"+externerBildURL+"img/tab/links.png'></td><td class='tabtitel' width='"+thewidth+"' align=''>"+thetitel+"</td><td><img SRC='"+externerBildURL+"img/tab/rechts.png'></td></tr></table>";
		ih=ih+"<table class='tabtiteltable' WIDTH='"+thewidth+"' BORDER='0' CELLSPACING='0' CELLPADDING='3'><tr><td>";
		ih=ih+"<table id='tvbi'  border='0' cellpadding='0' cellspacing='0' class='maintable' width='100%' style='BACKGROUND-IMAGE: url("+ImagePath+"/"+thetext+"); border-collapse: collapse' bordercolor='#111111'>";
		ih=ih+"<tr><td width='99%' align=center nowrap><IMG id='vbi' src='"+externerBildURL+"img/no.gif' width='400' height='400'></td></tr></table>";
		ih=ih+"</td></tr></table><table WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='0'><tr><td><img SRC='"+externerBildURL+"img/tab/links_unten.png'></td><td style='BACKGROUND-IMAGE: url("+externerBildURL+"img/tab/mitte_unten.png); BACKGROUND-REPEAT: repeat-x' class='tabtitel' width='100%'></td><td><img SRC='"+externerBildURL+"img/tab/rechts_unten.png'></td></tr></table></td></tr></table>";
		tipobj.innerHTML=ih
		sperre=false
		document.getElementById("tvbi").style.backgroundPosition ="center center";
		document.getElementById("tvbi").style.backgroundRepeat ="no-repeat";
		enabletip=true
		return false
	}
}


function ddrivetooltip(thetitel,thetext, thewidth){
	var ih="";
	if (ns6||ie){
	if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
	tipobj.style.width="300px"
	tipobj.innerHTML=vskih
	offsetfromcursorY=-150
	enabletip=true
	return false
	}
}


function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}


function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''

}
}

document.onmousemove=positiontip
function Fensterweite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function Fensterhoehe () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else {
    return 0;
  }
}

function Toggle(item) {
   document.getElementById('t0').style.display="none";
   document.getElementById('t1').style.display="none";
   document.getElementById('t2').style.display="none";
   document.getElementById('t4').style.display="none";
   document.getElementById(item).style.display="block";
}
function ProToggle(item) {
   document.getElementById('t0').style.display="none";
   document.getElementById('t1').style.display="none";
   document.getElementById(item).style.display="block";
}
function ArtToggle(item) {
   if (document.getElementById('bem'+item).style.display=="none")
	{
	document.getElementById('bem'+item).style.display="block";
	//document.getElementById('pic1_'+item).style.display="none";
	
	}
	else
	{
	document.getElementById('bem'+item).style.display="none";
	//document.getElementById('pic1_'+item).style.display="block";
	
	}
	
}
function FreeToggle(item) {
   if (document.getElementById(item).style.display=="none")
	{
	document.getElementById(item).style.display="block";
	}
	else
	{
	document.getElementById(item).style.display="none";
	
	}
	
}
function Finalstep (sid) {
	if(document.getElementById("yn").value==0){
		alert("Sie erklären sich mit den Allgemeinen Geschäftsbedingungen (AGB) nicht einverstanden.\nBitte ändern Sie Ihre Eingaben um den Bestellvorgang fortzusetzen.");
	}else{
	location.href="co.asp?sid="+sid+"&action=finishcart"
	}
}
function showgpic(bild) {
bilda = new Image();
bilda.src = document.getElementById(bild).src;
breite_a = bilda.width;
hoehe_a = bilda.height;
bilda.src = document.getElementById(bild).src;
breite_a = bilda.width;
hoehe_a = bilda.height;

document.getElementById(bild).width = breite_a;	
document.getElementById(bild).height = hoehe_a;	
}

function showpic(bild) {
bilda = new Image();
bilda.src = document.getElementById(bild).src;
breite_a = bilda.width;
hoehe_a = bilda.height;
bilda.src = document.getElementById(bild).src;
breite_a = bilda.width;
hoehe_a = bilda.height;

document.getElementById(bild).width = breite_a/2;	
document.getElementById(bild).height = hoehe_a/2;	
}
function showzpic(bild,auto) {
	bilda = new Image();
	bilda.src = document.getElementById(bild).src;
	breite_a = bilda.width;
	hoehe_a = bilda.height;
	if(auto==0){
		factor=bilda.height/80;
		if (hoehe_a>rh){
			rh=hoehe_a
			document.getElementById("heightimg").height = rh+50;
		}
		document.getElementById(bild).width = breite_a/factor;	
		document.getElementById(bild).height = hoehe_a/factor;
		}	
	else {
	
		document.getElementById(bild).width = breite_a*1.5;	
		document.getElementById(bild).height = hoehe_a*1.5;
		breite_a=breite_a*1.5+50;
		hoehe_a=hoehe_a*1.5+50;
		document.getElementById('imgID'+auto).value = "'width="+breite_a+"px,height="+hoehe_a+"px,left=150px,top=100px,center=1,resize=1,scrolling=0'";
	}
}
function showveil(){
	//if (browser_type == "Microsoft Internet Explorer" && (browser_version >= 4)) {
	//	Veilwindow=dhtmlmodal.open('Bild', 'div', 'modalalertdiv', '', 'width=350px,height=150px,center=1,resize=0,scrolling=0');
	//} 

	}
function readurlstring(){
	var myURL=window.location.href;
	var qLoc=0;
	var ls="";
	for (var i=1; i < myURL.length; i++) 
	    {
	    if (myURL.charAt(i)=='?')qLoc=i;
		}
		
	return myURL.substring(qLoc+1,myURL.length);
}
function makevisible(cur,which){
	strength=(which==0)? 1 : 0.7
	if (cur.style.MozOpacity)
	cur.style.MozOpacity=strength
	else if (cur.filters)
	cur.filters.alpha.opacity=strength*100
	}
	
function sendfav (formnr) {
	if(au!=""){
		url=document.getElementById("favurl"+formnr).value;
		document.getElementById("form"+formnr).action=url;
		document.getElementById("form"+formnr).submit();
	}else{				
		alert("Bitte melden Sie sich an, um\ndie Favoritenliste zu nutzen");
	}
}
function remfav (formnr) {
	if(au!=""){
		url=document.getElementById("favurl"+formnr).value;
		document.getElementById("form"+formnr).action=url;
		document.getElementById("form"+formnr).submit();
	}else{				
		alert("Bitte melden Sie sich an, um\ndie Favoritenliste zu nutzen");
	}
}
function showgalpic(bild,preis,bestand,bestandtext,code,sid,IsSize,bezeichnung,skonto_priss,osisimladen,code_anzeige,AlterVK) {

	var inhtml="";
	document.getElementById("galpic").src = bild;
	document.getElementById("galueber").innerHTML = "<STRONG>"+bezeichnung+"</STRONG><BR>Artikel&nbsp;Nr.:&nbsp;"+code_anzeige;
	document.getElementById("url1").value="index.asp?sid="+sid+"&action=add&item="+code+"&t=1";
	document.getElementById("burl").href="index.asp?"+ls+"&code="+code;

	
	
			
	inhtml=inhtml+"<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>";
	
	inhtml=inhtml+"<tr><td colspan='3' align='right' valign='middle'>";
	if(osisimladen == "") {	
		if (AlterVK >""){

			if (Bestandskontrolle=="True"){
	
				inhtml=inhtml+bestandtext+"<BR><IMG SRC='http://www.byteprojects.eu/shopimages/tp.gif' align=absmiddle><img border='0' src='"+externerBildURL+"img/"+bestand+".gif' align='absmiddle' alt='"+bestandtext+"'>";
			}else{
				inhtml=inhtml+"<IMG SRC='http://www.byteprojects.eu/shopimages/tp.gif' align=absmiddle>";
			}
		}
		else
		{
		
			if (Bestandskontrolle=="True"){
				inhtml=inhtml+bestandtext+"<img border='0' src='"+externerBildURL+"img/"+bestand+".gif' align='absmiddle' alt='"+bestandtext+"'>";
			}		
		}
		
		inhtml=inhtml+"<span class='preis'>"+preis+"</span>";
		if (AlterVK > ""){
			inhtml=inhtml+"<br>Unv. Preisempf.&nbsp;"+AlterVK+"";
		
		}
		inhtml=inhtml+"<BR><span class='mwst'>incl. ges. MwSt "
		
		inhtml=inhtml+"<BR>ggf. zzgl. <a HREF='index.asp?sid="+sid+"&action=versand'><U>Versandkosten</U></a></span>";
		if(skonto_priss != "") inhtml=inhtml+"<br><strong>Preis bei Vorkasse:<br>"+skonto_priss+"% Skonto)</span>";
		}
		inhtml=inhtml+"</td></tr>";
		inhtml=inhtml+"<tr><td colspan='3' align='right' valign='middle'>&nbsp;</td></tr>";
		inhtml=inhtml+"<tr><td align='left' valign='middle'>";
	
		//alert(ls);
	
		if(IsSize == "1")
		{
		inhtml=inhtml+"Größe </td><td width='99%' align='left' valign='middle'><input class='bestellbox' type='text' id='groesse1' name='groesse1' size='1'>";
		}
		else
		{
		inhtml=inhtml+"</td><td><input class='bestellbox' type='hidden' id='groesse1' name='groesse1' size='1' value='0'>";
		}
	
	
	inhtml=inhtml+"</td><td align='right' valign='middle'>";
	inhtml=inhtml+"<A HREF='"+"index.asp?"+ls+"&code="+code+"'>&nbsp;<img border='0' src='"+externerBildURL+"img/detail.gif' alt='Details von `"+bezeichnung+"` anzeigen'>&nbsp;";
	inhtml=inhtml+"</td></tr>"
	inhtml=inhtml+"<tr><td align='left' valign='middle'>";
	if(osisimladen == "") {
		inhtml=inhtml+"Anzahl&nbsp;</td><td width='99%' align='left' valign='middle'><input class='bestellbox' type='text' id='anzahl1' name='anzahl1' size='1' value='"+SetMindestmenge_mmprice+"'>";
		}
	else
		{
		inhtml=inhtml+"&nbsp;</td><td colspan='2' width='99%' align='left' valign='middle'><small>Dieser Artikel ist nur im Geschäft erhältlich</small>";
		}


	if(osisimladen == "") {
		inhtml=inhtml+"</td><td align='right' valign='middle'>";
		inhtml=inhtml+"<A HREF='javascript:form1.submit();'>&nbsp;<img border='0' src='"+externerBildURL+"img/add.gif' alt='In den Warenkorb legen'>&nbsp;";
		}
	inhtml=inhtml+"</td></tr></TABLE>";
	document.getElementById("galpreis").innerHTML=inhtml;
	
	//document.getElementById("galbutton").innerHTML=inhtml;
	document.getElementById('galtab2').style.display="none";
	document.getElementById('galtab1').style.display="block";
   }

function sendform (formnr) {

	
	
	var mm=document.getElementById("mm"+formnr).value;

	url=document.getElementById("url"+formnr).value;
	menge=document.getElementById("anzahl"+formnr);
	groesse=document.getElementById("groesse"+formnr); 
	zahl = parseInt(groesse.value,10);



	if (isNaN(zahl)) zahlString = ""
	else zahlString = new String(zahl);
	if (groesse.value.length != zahlString.length) {
		alert("Bitte geben Sie im Feld 'Größe' nur Ziffern ein!");
		groesse.value="";
		
		}
	else {
		if (groesse.value == "") {
			alert("Bitte geben Sie eine Größe ein!");
			groesse.focus();
			}else{
			zahl = parseInt(menge.value,10);
			if (isNaN(zahl)) {
				zahlString = ""
			}
			else {
				zahlString = new String(zahl);
			}
			if (menge.value.length != zahlString.length) {
				alert("Bitte geben Sie im Feld 'Anzahl' nur Ziffern ein!!");
				menge.value="";
				menge.value=mm;
				menge.focus();
				return;
				}
			else {
			    if (menge.value == "") {
					alert("Bitte geben Sie im Feld 'Anzahl' die Bestellmenge ein");
					menge.value=mm;
					menge.focus();
					return;
					}
			    else
					{

					if ((menge.value - mm)<0) {
					alert("Die Mindestestellmenge beträgt "+mm+" Stück");
					menge.value=mm;
					return;
					}

					//if (browser_type == "Microsoft Internet Explorer" && (browser_version >= 4)) {
						showveil();
					//} 
					url=url+"&gr="+groesse.value+"&count="+menge.value;
					document.getElementById("form"+formnr).action=url;//+"&gr"+groesse.value+"&count="+menge.value;
					
					
					if (browser_type == "Netscape" && (browser_version >= 4)) {
						window.location.href=url ;
					}
					else
					{
						document.getElementById("form"+formnr).submit();
					}


					}
				} 
			}
		}
	}

function neuAufbau () {

  if (Weite != Fensterweite() || Hoehe != Fensterhoehe())
		document.getElementById("vertikal").style.height=(Fensterhoehe()-150)+"px";
			
return true;
}
function Aufbau () {
			document.getElementById("vertikal").style.height=(Fensterhoehe()-180)+"px";
			if(artcode=!""){
				if (document.getElementById('mydiv')) document.getElementById('mydiv').style.height=document.getElementById('zzzz').offsetHeight-30+"px";
			}
}
var closeWindows = function() {	Windows.closeAll();}
function showWind(){
	var win=new Window({width:700, height:Fensterhoehe()-150, url: "inc/iWindow.asp?site=body_versand.asp",maximizable: false,minimizable: false,  className: "alphacube",title: "Versandkosten", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: false })
	win.showCenter(true)
}
function showWk(){
	var win=new Window({width:750, height:Fensterhoehe()-150, url: "inc/iWindow.asp?site=body_warenkorb.asp",maximizable: false,minimizable: false,  className: "alphacube",title: "Warenkorb", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: false })
	win.showCenter(true)
}
function showAGB(){
	var win=new Window({width:750, height:Fensterhoehe()-150, url: "inc/iWindow.asp?site=body_agb.asp",maximizable: false,minimizable: false,  className: "alphacube",title: "AGB", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: false })
	win.showCenter(true)
}
function showBTV(){
	var win=new Window({width:750, height:Fensterhoehe()-150, url: "inc/iWindow.asp?site=body_btv.asp",maximizable: false,minimizable: false,  className: "alphacube",title: "Batterieverordnung", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: false })
	win.showCenter(true)
}
function showImpressum(){
	var win=new Window({width:750, height:Fensterhoehe()-150, url: "inc/iWindow.asp?site=body_Impressum.asp",maximizable: false,minimizable: false,  className: "alphacube",title: "Impressum/Herausgeber", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: false })
	win.showCenter(true)
}
function showPrivatePolicy(){
	var win=new Window({width:750, height:Fensterhoehe()-150, url: "inc/iWindow.asp?site=body_PrivatePolicy.asp",maximizable: false,minimizable: false,  className: "alphacube",title: "Datenschutz", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: false })
	win.showCenter(true)
}
function showKontakt(){
		var win=new Window({width:750, height:Fensterhoehe()-150, url: "inc/iWindow.asp?site=body_Kontakt.asp",maximizable: false,minimizable: false,  className: "alphacube",title: "Kontakt", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: false })
		win.showCenter(true)
	}
function open_iWindow(sitename,iwidth,iheight,ititel){
	var win=new Window({width:iwidth, height:iheight, url: sitename,maximizable: false,minimizable: false,  className: "alphacube",title: ititel, showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: false })
	win.showCenter(true)
}
