// Systemfunktionen, bitte niemals ändern!
function Verfueg(opt, title, nGroesse, nBreite)
{
    var nGr = 130 + ( nGroesse * 25 ) ;
    msgWindow=window.open ("artverf1.dll?"+opt,title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH="+nBreite+",HEIGHT=" + nGr);
}

function VerfuegE(opt, title, nGroesse, nBreite)
{
    var nGr = 130 + ( nGroesse * 25 ) ;
    msgWindow=window.open ("artverf2.dll?"+opt,title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH="+nBreite+",HEIGHT=" + nGr);
}

function Material(opt, title)
{
   msgWindow=window.open ("artinfo2.dll?"+opt,title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=570,HEIGHT=650");
}

function MaterialE(opt, title)
{
   msgWindow=window.open ("artinfoi.dll?"+opt,title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=570,HEIGHT=650");
}

function SchreibMerk(cUrl1,obj) {
  parent.frames["main2"].location = cUrl1 + obj.value ;
}

function MerkListe(nAend)
{
      var ID = GetCookie("Merkliste");
	  ID = parseInt(nAend);
	  SetCookie("Merkliste", ID);
	  return ID;
}

function WarenKorb(nAend)
{
      var ID = GetCookie("Warenkorb");
	  var ID = parseInt(nAend);
	  SetCookie("Warenkorb", ID);
	  return ID;
}

function ArtBasket(lAktiv)
{
  SetCookie("Warenkorb", lAktiv);
}

function Leiste() {
      var WK = GetCookie("Warenkorb");
      var ML = GetCookie("Merkliste");
  	      if ((WK>0) || (ML>0)) {
	         LoadMerk("artinfoq.dll","top");
          } else {
		     LoadMerk("top_prod.html","top");
		  }
}

function LoadMerk(cUrl1,cFrame1) {

//for(var i=0; i < parent.frames.length; i++)
// alert(parent.frames[i].name);

parent.frames[1].location = cUrl1 ;

}

function LeisteEngl(cUrl1,cFrame1) {
      var WK = GetCookie("Warenkorb");
      var ML = GetCookie("Merkliste");
  	      if ((WK>0) || (ML>0)) {
	         LoadMerk("leiste3.htm","top");
          } else {
		     LoadMerk("top_prod.html","top");
		  }
}

function EinFrame( cUrl1,cFrame1 )
{
  	parent.frames[cFrame1].location = cUrl1 ;
}

function ZweiFrames( cUrl1,cFrame1,cUrl2,cFrame2 )
{
  	parent.frames[cFrame1].location = cUrl1 ;
  	parent.frames[cFrame2].location = cUrl2 ;
}

function DreiFrames( cUrl1,cFrame1,cUrl2,cFrame2,cUrl3,cFrame3 )
{
  	parent.frames[cFrame1].location = cUrl1 ;
  	parent.frames[cFrame2].location = cUrl2 ;
  	parent.frames[cFrame3].location = cUrl3 ;
}

function VierFrames( cUrl1,cFrame1,cUrl2,cFrame2,cUrl3,cFrame3,cUrl4,cFrame4 )
{
  	parent.frames[cFrame1].location = cUrl1 ;
  	parent.frames[cFrame2].location = cUrl2 ;
  	parent.frames[cFrame3].location = cUrl3 ;
  	parent.frames[cFrame4].location = cUrl4 ;
}

function ShowFrames()
{
for(var i=0; i < parent.frames.length; i++)
 alert(parent.frames[i].name);
}

function LoadMerk2(cUrl1,cFrame1) {

parent.frames[cFrame1].location = cUrl1 ;

}

function FormID(obj) {

   //obj.IDNR.value = CookieID();
   var ID = CookieID();
   var SES = obj.SESSION.value;
   alert(SES);
   obj.SESSION.value = ID;
}

function CookieID()
{
      var ID = GetCookie("IDNR");
	  if (!ID) {
	     ID = 0;
	  }
	  return ID;
}

function SessionID() {
    var ID = GetCookie("IDNR");
    alert( "ID aus Cookie: " + ID );
    if (ID) {
        document.SESSION.SESSIONID.value = ID;
    } else {
        document.SESSION.SESSIONID.value = 0;
    }
    alert("Feldwert: " + document.SESSION.SESSIONID.value);

}

function ProduktInfo(opt, title)
{
    if (opt != "TT") {
        msgWindow=window.open ("artinfon.dll",title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,WIDTH=300,HEIGHT=350");
    } else {
        msgWindow=window.open ("artinfon.dll?"+opt,title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,WIDTH=300,HEIGHT=350");
    }
}

function ProductInfo(opt, title)
{
    if (opt != "TT") {
        msgWindow=window.open ("artinfoo.dll",title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,WIDTH=350,HEIGHT=350");
    } else {
        msgWindow=window.open ("artinfoo.dll?"+opt,title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,WIDTH=350,HEIGHT=350");
    }
}

function Hinweis(opt, title)
{
  if (!document.cookie)
      msgWindow=window.open ("artinfon.dll",title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,WIDTH=300,HEIGHT=350");
}

function Hind(opt, title)
{
  if (!document.cookie)
      msgWindow=window.open ("artinfoo.dll",title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,WIDTH=350,HEIGHT=330");
}

function Bestell(opt, title)
{
    var visits = GetCookie("OrderVisits");

    if(isNaN(visits) == true) {
    	visits = 0;
    }

    if (visits < 1) {

//        	msgWindow=window.open ("artinfop.dll?detail.php?&mod_nr="+opt,title,"toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,copyhistory=0,WIDTH=850,HEIGHT=450");
//        	msgWindow=window.open ("artinfop.dll?"+opt,title,"dependent=yes,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=850,HEIGHT=450");

        	msgWindow=window.open ("artinfop.dll?BAGB_"+opt,title,"dependent=yes,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,WIDTH=850,HEIGHT=450");

    } else {

//    	  msgWindow=window.open ("http://www.globetrotter.de/de/shop/detail.php?&mod_nr="+opt,title,"toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,copyhistory=0,WIDTH=850,HEIGHT=450");
//    	  msgWindow=window.open ("http://www.globetrotter.de/partner/partner.php?ident=183838884a1897e9&page=%2Fde%2Fshop%2Fdetail.php%3F%26mod_nr%3D"+opt,title,"dependent=yes,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=850,HEIGHT=450");
//    	  msgWindow=window.open ("http://www.globetrotter.de/de/shop/detail.php?mod_nr="+opt,title,"toolbar=yes,location=yes,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,dependent=yes,WIDTH=850,HEIGHT=450");

        	msgWindow=window.open ("artinfop.dll?"+opt,title,"dependent=yes,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,WIDTH=850,HEIGHT=450");

    }

}

function Bestell2(artnr,colnr,artbez,col,price,PRB,title)
{
   msgWindow=window.open ("artinfop.dll?"+artnr+"&"+colnr+"&"+artbez+"&"+col+"&"+price+"&"+PRB,title,"dependent=yes,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=850,HEIGHT=450");
}

function SonderBestell(artnr,colnr,artbez,col,price,title)
{
    var visits = GetCookie("OrderVisits");

    if(isNaN(visits) == true) {
    	visits = 0;
    }

    if (visits < 1) {

      	msgWindow=window.open ("artinfop.dll?SBAGB_"+artnr+"&"+colnr+"&"+artbez+"&"+col+"&"+price,title,"dependent=yes,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=850,HEIGHT=450");

    } else {

//        msgWindow=window.open (encodeURI("http://www.globetrotter.de/de/shop/sonderbestellung_tatonka.php?artnr="+artnr+"-"+colnr+"&artbez="+artbez+"&color="+col+"&preis="+price),title,"dependent=yes,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,dependent=yes,WIDTH=850,HEIGHT=450");

      	msgWindow=window.open ("artinfop.dll?SB_"+artnr+"&"+colnr+"&"+artbez+"&"+col+"&"+price,title,"dependent=yes,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=850,HEIGHT=450");
    }
}


function TatGlobe(opt, title)
{
    var visits = GetCookie("OrderVisits");

    if(isNaN(visits) == true) {
    	visits = 0;
    }

    if (visits < 1) {

        	msgWindow=window.open ("artinfop.dll",title,"dependent=yes,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=850,HEIGHT=450");

    } else {

//    	  msgWindow=window.open ("http://www.globetrotter.de/de/shop/buy_now.php?hersteller=Tatonka&",title,"toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,copyhistory=0,WIDTH=850,HEIGHT=450");
    	  msgWindow=window.open ("http://www.globetrotter.de/partner/partner.php?ident=183838884a1897e9&page=%2Fde%2Fshop%2Fbuy_now.php%3Fhersteller%3DTatonka",title,"dependent=yes,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=850,HEIGHT=450");
    }

}

function HaePic(opt, title)
{
   	msgWindow=window.open ("detail.dll?"+opt,title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=650,HEIGHT=750");
}

function HaePic_E(opt, title)
{
   	msgWindow=window.open ("detail2.dll?"+opt,title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=300,HEIGHT=400");
}

function WkInfo(opt, title)
{
   	msgWindow=window.open ( opt,title,"dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,WIDTH=200,HEIGHT=110");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function Distributor(url)
{
window.open( url,"Distributor" )
}

function printIo(opt,title){
NEW = window.open(opt,title,"dependent=yes,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,WIDTH=850,HEIGHT=450");
NEW.focus();
window.setTimeout("NEW.print()",5000);
}

function DelSession()
{
    msgWindow=window.open ("artinfov.dll","","dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,WIDTH=100,HEIGHT=100");
    msgWindow.close();
}

function LagInfo()
{
    msgWindow=window.open("laginfo.htm","","resizable=1,copyhistory=0,dependent=no,location=0,directories=0,status=0,menubar=0,scrollbars=1,toolbar=0,width=1024,height=768")
    msgWindow.focus();
}

// Systemdateien mit Cookie-Support, bitte niemals ändern!

var cookieWert;
function holeCookie(Keksname)
{
alleCookies=document.cookie;
cookieArr=alleCookies.split(";");
for(var i=0;i<cookieArr.length;i++)
	{
	if(cookieArr[i].split("=")[0] == Keksname)
		{
		cookieWert=cookieArr[i].split("=");
		cookieWert=unescape(cookieWert[1]);
		return true;
		}
	}
	return false;
}

function GetCookie(name) {
    var suche = name + "=";
    var alen = suche.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == suche)
        return getVal (j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
    }
    return null;
}

function getVal (offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
        endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}

function SetCookie(name, value, exp){
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
    var jetzt = new Date();
	var exp = (argc > 2) ? argv[2] : null;
    var Auszeit = new Date(jetzt.getTime() + exp);
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
    document.cookie = name + "=" + value + ";expires="+Auszeit.toGMTString()+";";

//	document.cookie = name + "=" + value +
//		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
//		((path == null) ? "" : ("; path=" + path)) +
//		((domain == null) ? "" : ("; domain=" + domain)) +
//		((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) {
     var exp = new Date();
     exp.setTime (exp.getTime() - 1);
     var cval = GetCookie (name);
     document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
   }

function GetCookieVal(){

    var Wert = "";
       if(document.cookie)
       {
        Wertstart = document.cookie.indexOf("=") + 1;
        Wertende = document.cookie.indexOf(";");
        if(Wertende == -1) Wertende = document.cookie.length;
        Wert = document.cookie.substring(Wertstart,Wertende);
       }
       return Wert;
}

function SetCookieVal(name, wert, verfall)
  {
    var jetzt = new Date();
    var Auszeit = new Date(jetzt.getTime() + verfall);
    document.cookie = name + "=" + wert + ";expires="+Auszeit.toGMTString()+";";
  }

function CookieCount()
  {
   var Verfallszeit = 1000*60*60*24*14; // 1000 ms * 60 * 60 * 24 * 14 = 14 Tage
   var Anzahl = GetCookieVal();         // Diese Funktionen wurden aus dem SelfHtml übernommen und abgewandelt
   var Zaehler = 0;
   if(Anzahl != "") Zaehler = parseInt(Anzahl);
   if(document.cookie)
   {
    Zaehler = Zaehler + 1;
   }
   else
   {
    Zaehler = 1;
   }
   SetCookieVal("VisitCount",Zaehler,Verfallszeit);
 }

function AGBCookie()
    {
    var visits = GetCookie("OrderVisits");
    var expdate = new Date();

    if(isNaN(visits) == true) {
    	visits = 0;
    }

    if (!visits) {
      visits = 1;
    } else {
      visits = parseInt(visits) + 1;
    }
    SetCookieVal("OrderVisits", visits);

    //alert( visits + " Aufruf" )
    }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MarNo_DE()
{
            document.getElementById("Beschreibung").src="http://www.tatonka.com/de/img/buttons/reiter_beschreibung.jpg";
            document.getElementById("Details").src="http://www.tatonka.com/de/img/buttons/reiter_details.jpg";
            document.getElementById("Tech-Daten").src="http://www.tatonka.com/de/img/buttons/reiter_tech-daten.jpg";
            document.getElementById("Materialien").src="http://www.tatonka.com/de/img/buttons/reiter_materialien.jpg";
}

function MarNo_EN()
{
            document.getElementById("Beschreibung").src="http://www.tatonka.com/en/img/buttons/reiter_beschreibung.jpg";
            document.getElementById("Details").src="http://www.tatonka.com/en/img/buttons/reiter_details.jpg";
            document.getElementById("Tech-Daten").src="http://www.tatonka.com/en/img/buttons/reiter_tech-daten.jpg";
            document.getElementById("Materialien").src="http://www.tatonka.com/en/img/buttons/reiter_materialien.jpg";
}

function MarNo_KidsDE()
{
            document.getElementById("Beschreibung").src="http://www.tatonka.com/de/img/buttons/reiter02_beschreibung.jpg";
            document.getElementById("Details").src="http://www.tatonka.com/de/img/buttons/reiter02_details.jpg";
            document.getElementById("Tech-Daten").src="http://www.tatonka.com/de/img/buttons/reiter02_tech-daten.jpg";
            document.getElementById("Materialien").src="http://www.tatonka.com/de/img/buttons/reiter02_materialien.jpg";
}

function MarNo_KidsEN()
{
            document.getElementById("Beschreibung").src="http://www.tatonka.com/en/img/buttons/reiter02_beschreibung.jpg";
            document.getElementById("Details").src="http://www.tatonka.com/en/img/buttons/reiter02_details.jpg";
            document.getElementById("Tech-Daten").src="http://www.tatonka.com/en/img/buttons/reiter02_tech-daten.jpg";
            document.getElementById("Materialien").src="http://www.tatonka.com/en/img/buttons/reiter02_materialien.jpg";
}

function MarNo_TTDE()
{
            document.getElementById("Beschreibung").src="http://www.tasmaniantiger.tatonka.com/img/de/buttons/reiter_beschreibung.jpg";
            document.getElementById("Details").src="http://www.tasmaniantiger.tatonka.com/img/de/buttons/reiter_details.jpg";
            document.getElementById("Tech-Daten").src="http://www.tasmaniantiger.tatonka.com/img/de/buttons/reiter_tech-daten.jpg";
            document.getElementById("Materialien").src="http://www.tasmaniantiger.tatonka.com/img/de/buttons/reiter_materialien.jpg";
}

function MarNo_TTEN()
{
            document.getElementById("Beschreibung").src="http://www.tasmaniantiger.tatonka.com/img/en/buttons/reiter_beschreibung.jpg";
            document.getElementById("Details").src="http://www.tasmaniantiger.tatonka.com/img/en/buttons/reiter_details.jpg";
            document.getElementById("Tech-Daten").src="http://www.tasmaniantiger.tatonka.com/img/en/buttons/reiter_tech-daten.jpg";
            document.getElementById("Materialien").src="http://www.tasmaniantiger.tatonka.com/img/en/buttons/reiter_materialien.jpg";
}

function MarNo_Teva()
{
            document.getElementById("Beschreibung").src="http://www.teva.tatonka.com/img/Produkte/reiter_beschreibung.gif";
            document.getElementById("Details").src="http://www.teva.tatonka.com/img/Produkte/reiter_details.gif";
            document.getElementById("Tech-Daten").src="http://www.teva.tatonka.com/img/Produkte/reiter_tech-daten.gif";
            document.getElementById("Materialien").src="http://www.teva.tatonka.com/img/Produkte/reiter_materialien.gif";
}

function ReiterOut_DE(rnr)
{
      MarNo_DE();
      MarAkt();
}

function ReiterOut_EN(rnr)
{
      MarNo_EN();
      MarAkt();
}

function ReiterOut_KidsDE(rnr)
{
      MarNo_KidsDE();
      MarAkt();
}

function ReiterOut_KidsEN(rnr)
{
      MarNo_KidsEN();
      MarAkt();
}

function ReiterOut_TTDE(rnr)
{
      MarNo_TTDE();
      MarAkt();
}
function ReiterOut_TTEN(rnr)
{
      MarNo_TTEN();
      MarAkt();
}

function ReiterOut_Teva(rnr)
{
      MarNo_Teva();
      MarAkt();
}
