//   ::sector27 GmbH, Dorsten - cb^2 
//   http://www.sector27.de 
//   PHP-, Perl-Programmierungen, Webapplikationen,  
//   HTML, XHTML, DHTML, CSS, JavaScript, Webdesign  
//   Alle Rechte vorbehalten  - (c)2008 by sector27

var ursprung_x = -15;
var ursprung_y = -21;

var dsbbox_bg = '/fileadmin/dsbinfo/bg_dsbinfo.gif';
var imgPath = '/fileadmin/dsbinfo/';

//var dsbbox_bg = 'bg_dsbinfo.gif';
//var imgPath = '';

var faehnchen = new Array('flagge_blanko.gif','flagge_rot.gif','flagge_blau.gif');

var flags = new Array();

for(j=0; j<dsb.length; j++){
	newFlag = addFlag(dsb[j][0], dsb[j][1], dsb[j][2], dsb[j][3], dsb[j][4], dsb[j][5]);
	flags[flags.length] = newFlag;
}



function addFlag(l,t,i,url,flagId,showAddress){
	if(!document.getElementById) return;   
	// erstelle Flaggenelement
	d=document.createElement("div");
	d.setAttribute("class","flagge");
	// fülle Element mit Inhalt
	addFlagContent(d,flagId);
	// integriere Element
	document.getElementById("dkarte").appendChild(d);	
	// layoute Element
	d.style.position = "absolute"; 
	d.style.width = "18px";
	d.style.height = "17px";
	d.style.margin = "0px";
	d.style.padding = "0px";
	d.style.zIndex = "1";	
	// positioniere Element
	d.style.left = (ursprung_x + l) +"px";
	d.style.top = (ursprung_y + t) +"px";
	
	if(showAddress == 1){
  	// definiere DSBInfobox
  	d.dsbInfo=document.createElement("div");
  	d.dsbInfo.setAttribute("class","dsbInfobox");
  	d.dsbInfo.style.position = "absolute";
  	d.dsbInfo.style.left = parseInt(d.style.left)+8 +"px";
  	d.dsbInfo.style.top = parseInt(d.style.top)+22 +"px";
  	d.dsbInfo.style.width = "171px";
  	d.dsbInfo.style.height = "115px";
  	d.dsbInfo.style.margin = "0px";
  	d.dsbInfo.style.padding = "0px";
  	d.dsbInfo.style.display = "none";
  	d.dsbInfo.style.zIndex = "1000";
  	d.dsbInfo.Content = dsb[j][2];
  	d.dsbInfo.Verweis = dsb[j][3];
  	// fülle Element mit Inhalt
  	addInfoboxContent(d.dsbInfo);	
  	// integriere Element
  	document.getElementById("dkarte").appendChild(d.dsbInfo);	
  	// binde Events an das Objekt
  	d.onmouseover=showDSB;
  	d.onmouseout=closeDSB;
	}
	return d;
}


function addFlagContent(p,id){
   i=document.createElement("img");
	 i.setAttribute("src", imgPath + faehnchen[id]);
   p.appendChild(i);
}


function addInfoboxContent(p){
   i=document.createElement("img");
	 i.setAttribute("src", dsbbox_bg);
   p.appendChild(i);
   
   c=document.createElement("div");
 	 c.style.position = "absolute";
	 c.style.left = "1px";
	 c.style.top = "23px";
	 c.style.margin = "5px";
	 c.style.padding = "0px";	
	 c.style.width = "160px";
	 c.style.height = "91px";
	 c.style.fontSize = "9px";
	 if(p.Content){
	   c.innerHTML = p.Content;
   }else{
     c.innerHTML = "Bei Fragen zum Thema Datenschutz wenden Sie sich bitte an die comTeam Zentrale unter <a href='mailto:zentrale@comteam.de'>zentrale@comteam.de</a> oder +49 211 4156-767.";
   }		
   p.appendChild(c);   
	
	 c.appendChild( document.createElement("br") );
	 c.appendChild( document.createElement("br") );
	 
	 if(p.Verweis){
  	 v=document.createElement("a");
  	 v.setAttribute("href", p.Verweis);
  	 v.setAttribute("title", "weiter zum Systemhaus");
  	 v.setAttribute("target", "_blank");
  	 v.innerHTML = "&raquo; weiter zum Systemhaus";	
  	 
	   c.appendChild(v);
	 }
}


function showDSB(){
  for(j=0; j < flags.length; j++){
    if(flags[j].dsbInfo){
      flags[j].dsbInfo.style.display = "none";
    } 
  }
	this.dsbInfo.style.display = "block";	
}

function closeDSB(){ 
  dsbBox = this;
  setTimeout("hideDSB(dsbBox)", 4000);
}

function hideDSB(obj){
  obj.dsbInfo.style.display = "none"; 
}
