/* DHTML-Bibliothek */

var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;
var ns=false, ie=false, op=false;
function DHTML_init()
{
 if (window.opera) {
     OP = 1;
 }
 if(document.getElementById) {
   DHTML = 1;
   DOM = 1;
 }
 if(document.all && !OP) {
   DHTML = 1;
   MS = 1;
 }
 if(document.layers && !OP) {
   DHTML = 1;
   NS = 1;
 }
 var browser=navigator.appName
 var check=navigator.userAgent
 var test=check.match("Opera")
 if (test=="Opera") browser="Opera";
 if (browser=="Netscape") ns=true;
 else if (browser=="Microsoft Internet Explorer") ie=true;
 else if (browser=="Opera") op=true;

}


function getElem(p1,p2,p3) {
 var Elem;
 if(DOM) {
   if(p1.toLowerCase()=="id") {
     if (typeof document.getElementById(p2) == "object")
     Elem = document.getElementById(p2);
     else Elem = void(0);
     return(Elem);
   }
   else if(p1.toLowerCase()=="name") {
     if (typeof document.getElementsByName(p2) == "object")
     Elem = document.getElementsByName(p2)[p3];
     else Elem = void(0);
     return(Elem);
   }
   else if(p1.toLowerCase()=="tagname") {
     if (typeof document.getElementsByTagName(p2) == "object" ||
        (OP && typeof document.getElementsByTagName(p2) == "function"))
     Elem = document.getElementsByTagName(p2)[p3];
     else Elem = void(0);
     return(Elem);
   }
   else return void(0);
 }
 else if(MS) {
   if(p1.toLowerCase()=="id") {
     if (typeof document.all[p2] == "object")
     Elem = document.all[p2];
     else Elem = void(0);
     return(Elem);
   }
   else if(p1.toLowerCase()=="tagname") {
     if (typeof document.all.tags(p2) == "object")
     Elem = document.all.tags(p2)[p3];
     else Elem = void(0);
     return(Elem);
   }
   else if(p1.toLowerCase()=="name") {
     if (typeof document[p2] == "object")
     Elem = document[p2];
     else Elem = void(0);
     return(Elem);
   }
   else return void(0);
 }
 else if(NS) {
   if(p1.toLowerCase()=="id" || p1.toLowerCase()=="name") {
   if (typeof document[p2] == "object")
     Elem = document[p2];
     else Elem = void(0);
     return(Elem);
   }
   else if(p1.toLowerCase()=="index") {
    if (typeof document.layers[p2] == "object")
     Elem = document.layers[p2];
    else Elem = void(0);
     return(Elem);
   }
   else return void(0);
 }
}

function getCont(p1,p2,p3) {
   var Cont;
   if(DOM && getElem(p1,p2,p3) && getElem(p1,p2,p3).firstChild) {
     if(getElem(p1,p2,p3).firstChild.nodeType == 3)
       Cont = getElem(p1,p2,p3).firstChild.nodeValue;
     else
       Cont = "";
     return(Cont);
   }
   else if(MS && getElem(p1,p2,p3)) {
     Cont = getElem(p1,p2,p3).innerText;
     return(Cont);
   }
   else return void(0);
}

function getAttr(p1,p2,p3,p4) {
   var Attr;
   if((DOM || MS) && getElem(p1,p2,p3)) {
     Attr = getElem(p1,p2,p3).getAttribute(p4);
     return(Attr);
   }
   else if (NS && getElem(p1,p2)) {
       if (typeof getElem(p1,p2)[p3] == "object")
        Attr=getElem(p1,p2)[p3][p4]
       else
        Attr=getElem(p1,p2)[p4]
         return Attr;
       }
   else return void(0);
}

function setCont(p1,p2,p3,p4) {
   if(DOM && getElem(p1,p2,p3) && getElem(p1,p2,p3).firstChild)
     getElem(p1,p2,p3).firstChild.nodeValue = p4;
   else if(MS && getElem(p1,p2,p3))
     getElem(p1,p2,p3).innerText = p4;
   else if(NS && getElem(p1,p2,p3)) {
     getElem(p1,p2,p3).document.open();
     getElem(p1,p2,p3).document.write(p4);
     getElem(p1,p2,p3).document.close();
   }
}
DHTML_init();

/* FRAMESET? */
function frameset()
{
 if(popup!="true" && (parent==self))
 {
  if(rootTarg) arg="?"+rootTarg;
  else arg="";
  top.document.location.href="http://www.boomshop.net"+arg;
 }
 if(!top.oben.document.frametest.testvar || !top.rechts.document.frametest.testvar || !top.unten.document.frametest.testvar || !top.links.document.frametest.testvar)
 {
  if(rootTarg) arg="?"+rootTarg;
  else arg="";
  top.document.location.href="http://www.boomshop.net"+arg;
 }
}
/* BILDER */
function preload(all)
{
 if(all=="all")
 {
  homeON=new Image();
  homeON.src="grafix/active/home.gif";
  
  backON=new Image();
  backON.src="grafix/active/back.gif";
  
  favoritON=new Image();
  favoritON.src="grafix/active/favorit.gif";
  
  suchenON=new Image();
  suchenON.src="grafix/active/suchen.gif";
  
  sendON=new Image();
  sendON.src="grafix/active/send.gif";
 }

 menuON=new Image();
 menuON.src="grafix/menuactive.gif";
 
 menuOFF=new Image();
 menuOFF.src="grafix/menupassive.gif";

 boomshopON=new Image();
 boomshopON.src="grafix/active/boomshop.gif";
 
 musikON=new Image();
 musikON.src="grafix/active/musik.gif";
 
 designON=new Image();
 designON.src="grafix/active/design.gif";
 
 flashON=new Image();
 flashON.src="grafix/active/flash.gif";
 
 netsoftON=new Image();
 netsoftON.src="grafix/active/netsoft.gif";
}
//preload("all");


p=true;


/* TIMER */
function zeit()
{
	if(p)
	{
		p=false;
		pt=":";
	}
	else
	{
		p=true;
		pt="-";
	}
	tage=new Array("So","Mo","Di","Mi","Do","Fr","Sa");
	monate=new Array("Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez.");
	datum=new Date();
	wotag=tage[datum.getDay()];
	tag=datum.getDate();
	mon=monate[datum.getMonth()];
	jhr=datum.getFullYear()-2000;
	min=datum.getMinutes();
	std=datum.getHours();
	sec=datum.getSeconds();
	if(sec<10) sec="0"+sec;
	if(std<10) std="0"+std;
	if(min<10) min="0"+min;
	if(jhr<10)jhr="0"+jhr;
	if(NS)
	{
	 alt1="<DIV>";
	 alt2="</DIV>";
	}
	else
	{
	 alt1="";
	 alt2="";
	}
	setCont("id","timer",null,alt1+wotag+", "+tag+". "+mon+" '"+jhr+" "+std+":"+min+pt+sec+alt2);
	window.setTimeout("zeit()",500);
}

zeit();

/* MAILER */

function mail(index)
{
 server="schlachthaus-wob.de"
 location.href="mailto:"+index+"@"+server;
}


/* POPUP */

function popup(adr,nam,wid,hei,sty)
{
 if(nam=="popup") targ=adr;
 else targ="popup.php?target="+adr+"&popup=true&name="+nam;
 wid+=20;
 hei+=20;
 if(sty=="pure") param="width="+wid+",height="+hei+",scrollbars=no,resizable=no,menubar=no,status=no,dependent=no,directories=no,location=no,toolbar=no";
 if(sty=="scroll") param="width="+wid+",height="+hei+",scrollbars=yes,resizable=no,menubar=no,status=no,dependent=no,directories=no,location=no,toolbar=no";
 win=window.open(targ,'Popup',param);
 win.moveTo((screen.width/2)-(wid/2),(screen.height/2)-(hei/2));
 win.focus();
}

/* PICVIEWER */

function picture(id)
{
	win=window.open("picview.php?id="+id,"Pictureview","width=20,height=20,toolbar=0,location=0,menubar=0,scrollbars=0,status=0,resizable=0");
}