<!--
if (document.layers)  {ns = 1; ie = 0; ns6=0;} 
if (document.all) {ns = 0; ie = 1; ns6=0;}
if (document.getElementById&&!document.all) {ns6=1; ns=0; ie=0;}


function popuxp(url,id) {
window.open(url,id,"height=550,width=800,top=0,left=75,toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes");}

function popsmall(url,id) {
window.open(url,id,"height=400,width=450,top=100,left=300,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}

function printpop(url,id) {
window.open(url,id,"height=550,width=800,top=10,left=20,toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes");}

function thInfo() {
var thx=document.th.thxx.value;
	if(thx) {document.th.infobox.value=eval('info'+thx);}
	else {document.th.infobox.value='';}
}

function thGo(url) {
var thx=document.th.thxx.value;
location.href=url+'+&thxx='+thx;
}


function quest_link(link) {var confirm=del_quest(1); if (confirm) {location.href=link;} }
function pym_link(link) {var confirm=del_quest(2); if (confirm) {location.href=link;} }

function del_quest(z) {
	if (z==1) {
	if(lg=="de") {var err="sie wollen diese bestellung wirklich stornieren?\n";}
	else {var err="you really want to cancel this order?\n";}
	}

	if (z==2) {
	if(lg=="de") {var err="wurde alles bezahlt?\n";}
	else {var err="everything was paid?\n";}
	}
return confirm(err);
}

function delk_quest(file) {
if(lg=="de") {var err="löschen?\n";} else {var err="delete?\n";}
return confirm(file+" "+err);
}


function popic(agent,pic) {var url=""; var purl="http://backoffice.apswiss.ch/";
if(pic=="picbox") {var pic=document.form.picbox.value;}
txt ='<html><head></head><body bgcolor=000000 marginheight=5 topmargin=5 leftmargin=5 marginwidth=5><center>';
if(pic!="") {txt +='<img src="'+purl+agent+'/'+pic+'"><br>';}

msg=open(url,"","height=375,width=475,top=120,left=320,scrollbars=yes,resizable=yes");
msg.document.write(txt); msg.document.close(); msg.focus();
}

function closeF() {
if(window==top) {self.close();}
else {parent.window.self.close();}
}

function agbcheck() {
err="please confirm, that you accept the general conditions\n";
if(lg =="de") {err="bitte bestätigen Sie, dass Sie die AGBs akzeptieren\n";}
if(lg =="nl") {err="gelieve te bevestigen dat u de termen en voorwaarden te accepteren\n";}
if(lg =="sk") {err="potvrdte suhlas so vseobecnymi podmienkami\n";}

if(document.uppform.agb.checked==false) {
alert(err); return false;}
else {return true;}
}

function fill_div(to,content) {
if (ie) {document.all[to].innerHTML=content;}
if (ns6) {document.getElementById(to).innerHTML=content;}
}


function currency(currval,df) {
currval=""+currval; currval=inOut(' ','',currval);
if(currval<0) {currval="00.00";}

var valid = "0123456789,."; var ok = "yes"; var tx;
	for (var i=0; i<currval.length; i++) {
	tx = "" + currval.substring(i, i+1);
	if (valid.indexOf(tx) == "-1") {ok = "no";}
	}


var error="Price Field accepts only Numbers/Amount\n";
if(lg =="de") {var error="im Preisfeld nur Ziffern/Betrag erlaubt\n";}
if(lg =="nl") {var error="inbegrepen in de prijs veld alleen Cijfers/Bedrag\n";}
if(lg =="sk") {var error="cenove pole akceptuje len cisla/mnozstvo\n";}

if (ok == "no") {document.form[df].value="00.00";
if(df !="") {document.form[df].focus(); document.form[df].select();}
alert(error); return ok;}

else {
str=""+currval; str=inOut(',','.',str);
pos= str.indexOf("."); 
if (pos<0) {str=str+".00";} else {str=str.substring(0,pos+3);}
dec=str.substring(pos,str.length); if(dec.length==2) {str +="0";}
pos= str.indexOf("."); if(pos==0) {str="0"+str;}
	if(df !="") {document.form[df].value=str;}
return str;
}}

var fx;
function ziffern(currval,dfz,max,noch) {
currval=""+currval; currval=inOut(' ','',currval);
if(currval<0) {currval="0";}

var valid = "0123456789"; var ok = "yes"; var tx;
	for (var i=0; i<currval.length; i++) {
	tx = "" + currval.substring(i, i+1);
	if (valid.indexOf(tx) == "-1") {ok = "no";}
	}


if((dfz.length>32)&&(ok == "yes")) {
var dfb=""; var dfpreis=""; var newcurrent=""; var shopsum="";   //box - dfb=d.shid
dfb=dfz.substring(3, dfz.length); 



err1="this Position has a Order-Limit\nof maximum "+max+" per Order\n";
err2="this Position only "+noch+" available\n";
err3="only numbers allowed\n";


if(lg =="de") {
err1="Diese Position hat ein Bestell-Limit\nvon maximal "+max+" pro Order\n";
err2="diese Position nur noch "+noch+" verfügbar\n";
err3="nur Ziffern erlaubt\n";
}

if(lg =="nl") {
err1="Deze positie is een limiet\nvan maximaal "+max+" per bestelling\n";
err2="deze positie slechts "+noch+" beschikbaar\n";
err3="alleen toegestaan nummers\n";
}

if(lg =="sk") {
err1="tato polozka ma limit na maximalny\npocet listkov na objednavku "+max+"\n";
err2="tuto polozku si je mozne este objednat "+noch+" je dostupna\n";
err3="uvadzajte len cisla\n";
}



    if(max) {max=max*1; 
	if(currval>max) {var error=err1+"\n";
	currval=max; alert(error); 
		if(!fx) {document.form[dfz].value=max;} else {return max;}
	}}


    if(noch) {noch=noch*1;
	if(currval>noch) {var error=err2+"\n";
	currval=noch; alert(error); 
		if(!fx) {document.form[dfz].value=noch;}  else {return noch;}
	 }}

	var preis="preis"+dfb; var current="current"+dfb;
	if(!fx) { 
	if(dfb) {dfpreis=document.form[preis].value; dfcurrent=document.form[current].value; 
	newcurrent=currval*dfpreis;
      	shopsum=document.form.shoptarif.value; shopsum=shopsum*1; 
	shopsum=shopsum-dfcurrent+newcurrent; currency(shopsum,'shoptarif');
	document.form[current].value=newcurrent; }
	}
}


if (ok == "no") {var error=err3; alert(error); 
	if(!fx) {document.form[dfz].value="0"; document.form[dfz].focus(); document.form[dfz].select();}
	if(!fx) {return ok;} else {cxs=0;  return cxs;}
	}

if ((ok == "yes")&&(fx)) {return currval;}

}



function inOut(out,add,thestr) {
thestr = ""+thestr; 
while (thestr.indexOf(out)>-1) {pos= thestr.indexOf(out);
thestr = "" + (thestr.substring(0, pos) + add + thestr.substring((pos + out.length), thestr.length));}
return thestr;
}



if(screen.availWidth > 800) {imw=850; imh=550;}
else {imw=790; imh=450;}

function popIt(url) {if(url !="") {
today=new Date();
rand=today.getTime();
picker="a"+rand;
pick1=picker.charAt((picker.length - 2));
pick2=picker.charAt((picker.length - 4));
pick3=picker.charAt((picker.length - 6));
var pick = "APm"+pick1+pick2+pick3;

window.open(url,pick,"height="+imh+",width="+imw+",top=5,left=10,toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes");} }

var g = 1;
var m = "menu";

function xmenu(mn){   
verbergen(eval('"' + m + g +'"'));
zeigen(eval('"' + m + mn +'"'));
    g = mn; 
}

function zeigen(name) {
if (ns) {document.layers[name].visibility = "show";}
if (ie) {document.all[name].style.visibility = "visible"}
if (ns6) {document.getElementById(name).style.visibility = "visible"}
}

function verbergen(name) {
if (ns) {document.layers[name].visibility = "hide"	}
if (ie) {document.all[name].style.visibility = "hidden"}
if (ns6) {document.getElementById(name).style.visibility = "hidden"}
}



function dismes(fd,lg) {
var mess="wait";
if(lg =="de") {var mess="warten";} 
if(lg =="nl") {var mess="wachten";} 
if(lg =="sk") {var mess="cakat";}
content='<input type=button name="but'+fd+'" class=Button50d value="'+mess+'" disabled><br>';
var to="button"+fd; fill_div(to,content);
}


// document.write("<LINK REL='stylesheet' HREF='font_ie.css' TYPE='text/css'>");
   document.write("<LINK REL='stylesheet' HREF='font.css' TYPE='text/css'>");
// -->


