// JavaScript Document
function Favorites()
{
    if ((navigator.appName == "Microsoft Internet Explorer") &&
          (parseInt(navigator.appVersion) >= 4))
    {
        var url="http://www.antikbuch24.de/"
        var title="Antikbuch24 - Ihre Plattform für antiquarische Bücher"
        window.external.AddFavorite(url,title)
    }
    else
    {
        var FavText = "Antikbuch24 - Ihre Plattform für antiquarische Bücher (http://www.antikbuch24.de)";
        if(navigator.appName == "Netscape")
        {
           FavText += " mit den Tasten STRG+D";
        }
        FavText += " zu den Favoriten hinzufügen";
        alert(FavText);
    }
}

function addEngine(name,ext,cat,type)
{
	if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) 
	{
  	window.sidebar.addSearchEngine(
   		"http://www.antikbuch24.de/tools/searchbox/antikbuch24.src",
      "http://www.antikbuch24.de/tools/searchbox/antikbuch24.png", name, cat );
  } else {
  	alert("Sie können nur mit einem Mozilla-Browser die Sucherweiterung nutzen.");
  }
}

function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
 	toolbar_str = toolbar ? 'yes' : 'no';
 	menubar_str = menubar ? 'yes' : 'no';
	statusbar_str = statusbar ? 'yes' : 'no';
	scrollbar_str = scrollbar ? 'yes' : 'no';
	resizable_str = resizable ? 'yes' : 'no';
	window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function newWin(name, url, width, height, args) {
   var newWin = new Object();
   newWin.args = args;
   newWin.url = url;
   newWin.name = name;
   newWin.width = width;
   newWin.height = height;
   if (document.layers) {// browser is NN
       newWin.left = window.screenX + ((window.outerWidth - newWin.width) / 2);
       newWin.top = window.screenY + ((window.outerHeight - newWin.height) / 2);
       var attr = 'screenX=' + newWin.left + ',screenY=' + newWin.top + ',resizable=yes,width=' + newWin.width + ',height=' + newWin.height + ',' + newWin.args;
      } else {// browser is MSIE
       newWin.left = (screen.width - newWin.width) / 2;
       newWin.top = (screen.height - newWin.height) / 2;
       var attr = 'left=' + newWin.left + ',top=' + newWin.top + ',resizable=yes,width=' + newWin.width + ',height=' + newWin.height + ',' + newWin.args;
      }
   newWin.win=window.open(newWin.url, newWin.name, attr);
   newWin.win.opener=self;
   newWin.win.focus();
}

var clickAllowed = true;

function bestellen(book_id, typ) {
	var f = document.forms['form_'+book_id];
  var anzahl = 1;
  if (clickAllowed) {
	  clickAllowed = false;
		if (typ=='bestellen')
			newWin('bestellen','in_den_korb.html','425','225','scrollbars=no');
		f.submit();
		setTimeout("clickAllowed=true;",5000);
	}
}

function senden(formname) {
	document.getElementById('send').value = "Daten werden gesendet";
	document.getElementById('send').disabled = true;
	document.forms[formname].submit();
}

function show() {
	ns4 = (document.layers)? true:false
	ie = (document.styleSheets&&document.all)? true:false
	ns6 = document.getElementById&&!document.all;
	opera= (document.all&& !document.styleSheets)? true:false;

	//alert("NS4: " + ns4 + "nIE: " + ie + "nNS6: " + ns6 + "nOpera: " + opera);

	//top_position = 100;
	
	if (ie)  {
		//document.all.popup.style.top=document.body.scrollTop+top_position;
		document.all.popup.style.visibility="visible";
	}
	if (ns6||opera) {
		//lastY = window.pageYOffset;
		//alert(lastY);
		//document.getElementById("popup").style.top=lastY;
		document.getElementById("popup").style.visibility = "visible";
	}
	if (ns4) {
		//document.popup.top=pageYOffset+top_position;
		document.popup.style.visibility = "visible";
	}
}

function hide() {
	if(document.getElementById)	document.getElementById("popup").style.visibility = "hidden";
}