function dhtml_class()
{
	//initialisieren der variablen


	this.elem="";
	this.imgpfad='fileadmin/img/buttons/';
	this.doc='document.images.';
	this.maxBottom="";
	this.parentId="";
	this.id="";
    this.maxTop="";
    this.maxBottom="";
    this.maxUp="";
    this.maxBottom="";
    this.timer="";
    this.speed=5;
    this.ypos=0;
    this.tc=0
    this.count=-1;
    this.tickertimer=false;
    this.oldtop=false;
    this.tickerdiv = 1;
    this.cnt=0;
    this.curr = "";
}	
	

	
	//browser initialisieren
dhtml_class.prototype.init = function()
{
var 
     d, dom, ie, ienu, ie4, ie5, ie5x, ie6, ie5mac, ie5xwin, moz, moznu, mac, win, old, lin, op, opnu, op4, op5, op6, op7, konq, saf, saf_num; 

//variable initialization 
     d = document;n = navigator;nav = n.appVersion;nan = n.appName;nua = n.userAgent; 
     win = ( nav.indexOf( 'Win' )!= -1 );mac = ( nav.indexOf( 'Mac' )!= -1 );lin = ( nav.indexOf( 'Linux' )!= -1 ); 

if (!d.layers ){ 
     dom = ( d.getElementById );
     old = ( nav.substring( 0, 1 ) < 4 ); 
     op = ( nua.indexOf( 'Opera' )!= -1 ); 
     moz = ( nua.indexOf( 'Gecko' )!= -1 ); 
     ie = ( d.all &&!op ); 
     konq = ( nua.indexOf( 'Konqueror' )!= -1 ); 
     saf = ( nua.indexOf( 'Safari' )!= -1 ); 

     if ( op ){ 
            op_pos = nua.indexOf( 'Opera' ); 
            opnu = nua.substr( ( op_pos + 6 ), 3 ); 
            op5 = ( opnu.substring( 0, 1 ) == 5 ); 
            op6 = ( opnu.substring( 0, 1 ) == 6 ); 
            op7 = ( opnu.substring( 0, 1 ) == 7 ); 
     } 

     else if ( saf ){ 
            saf_pos = nua.indexOf( 'Safari' ); 
            saf_nu = nua.substr( ( saf_pos + 7 ), 2 ); 
     } 
     else if ( moz ){ 
            rv_pos = nua.indexOf( 'rv' ); 
            moz_rv = nua.substr( ( rv_pos + 3 ), 3 );
            moz_rv_sub = nua.substr( ( rv_pos + 7 ), 1 ); 
            moz_rv_sub = moz_rv + moz_rv_sub; 
     } 
     else if ( ie ){ 
            ie_pos = nua.indexOf( 'MSIE' ); 
            ienu = nua.substr( ( ie_pos + 5 ), 3 ); 
            ie4 = (!dom ); 
            ie5 = ( ienu.substring( 0, 1 ) == 5 ); 
            ie6 = ( ienu.substring( 0, 1 ) == 6 ); 
     } 
     else{} 
}        
ie5x = ( d.all && dom ); ie5mac = ( mac && ie5 ); ie5xwin = ( win && ie5x ); 

    var bvers = Array("nn2");
    this.bvers=bvers;
    var browserName = navigator.appName; 
    var bversion = parseInt(navigator.appVersion); 

    var isIE = browserName.indexOf("Microsoft Internet Explorer" )==-1?false:true; 
    var isNN = browserName.indexOf("Netscape")==-1?false:true; 
    var isDomIE = document.all?true:false; 

    if ( isNN && bversion >= 3) this.bvers[0] = "Netscape 3"; 
    if ( isNN && bversion >= 4) this.bvers[0] = "Netscape 4"; 
    if ( isNN && bversion >= 5) this.bvers[0] = "Netscape 5"; 
    if ( isIE && bversion >= 3) this.bvers[0] = "IE 3"; 
    if ( isIE && bversion >= 4) this.bvers[0] = "IE 4"; 
    if ( isIE && bversion >= 5) this.bvers[0] = "IE 5"; 
    if ( isDomIE && bversion >= 3) this.bvers[0] = "IE 3"; 
    if ( isDomIE && bversion >= 4) this.bvers[0] = "IE 4"; 
    if ( isDomIE && bversion >= 5) this.bvers[0] = "IE 5";

    if (op) this.bvers[0] = "Opera"; 
    if (op5) this.bvers[0] = "Opera 5"; 
    if (op6) this.bvers[0] = "Opera 6"; 
    if (op7) this.bvers[0] = "Opera 7"; 
    if (saf) this.bvers[0] = "Safari"; 
    if (moz) this.bvers[0] = "Mozilla"; 
    if (ie4) this.bvers[0] = "IE 4"; 
    if (ie5) this.bvers[0] = "IE 5"; 
    if (ie6) this.bvers[0] = "IE 6"; 
    if (win) this.bvers[1] = "Windows"; 
    if (mac) this.bvers[1] = "Macintosh"; 
    if (lin) this.bvers[1] = "Linux";
    
    this.saf=saf;
}

dhtml_class.prototype.get_browser_obj = function(welcher)
{
if (document.all){return document.all[welcher].style
}else if (document.getElementById){
return document.getElementById(welcher).style
}
}


	
// Menue
//button off
dhtml_class.prototype.rollover = function(welches)
{
	eval(this.doc+welches+'.src=\''+this.imgpfad+welches+'_on.gif\'');
}

//button on
dhtml_class.prototype.rollout = function(welches)
{
	eval(this.doc+welches+'.src=\''+this.imgpfad+welches+'_off.gif\'');
	
}

dhtml_class.prototype.inactiv = function(was)
{
return true;
   
}




// Pics
//button off
dhtml_class.prototype.rolloverPics = function(welches)
{
	eval(this.doc+welches+'.src=\''+this.imgpfad+'/pics/'+welches+'_on.gif\'');
}

//button on
dhtml_class.prototype.rolloutPics = function(welches)
{
	eval(this.doc+welches+'.src=\''+this.imgpfad+'/pics/'+welches+'_off.jpg\'');
}
	
// Map Sprachauswahl
//button off
dhtml_class.prototype.rolloverMap = function(welches)
{
	eval(this.doc+'langmap.src=\''+this.imgpfad+'langmap_'+welches+'.gif\'');
}
	
	
//macht layer sichtbar
dhtml_class.prototype.show = function(welcher)
{	
	this.get_browser_obj(welcher).visibility="visible";
}
//macht layer unsichtbar
dhtml_class.prototype.hide = function(welcher)
{	
	this.get_browser_obj(welcher).visibility="hidden";
}
//oeffnet fenster
dhtml_class.prototype.openwin2 = function(gURL)
{
	//gURL=>Pfad des HTML-Dokumentes
	
	winName="wind";//Name des Fensters
	xsize = 320;	//Breite des Fensters
	ysize = 255;  //Hoehe des Fensters
	xpos = (screen.width/2)-(xsize/2);
	ypos = (screen.height/2)-(ysize/2);
	features = "width=" + xsize + ",height=" + ysize + ",location=no,menubar=no,personalbar=no,resizable=no,screenX=" + xpos + ",screenY=" + ypos + ",left=" + xpos + ",top=" + ypos + ",locationbar=no,scrollbars=no,directories=no,statusbar=no,toolbar=no";
	
	window.open(gURL,winName,features); //oeffnet das Fenster
}
/*********
*/
//oeffnet fenster
dhtml_class.prototype.openwin = function(gURL,breite,hoehe)
{
	//gURL=>Pfad des HTML-Dokumentes
	
	winName="wind";//Name des Fensters
	xsize = breite;	//Breite des Fensters
	ysize = hoehe;  //Hoehe des Fensters
	xpos = (screen.width/2)-(xsize/2);
	ypos = (screen.height/2)-(ysize/2);
	features = "width=" + xsize + ",height=" + ysize + ",location=no,menubar=no,personalbar=no,resizable=no,screenX=" + xpos + ",screenY=" + ypos + ",left=" + xpos + ",top=" + ypos + ",locationbar=no,scrollbars=yes,directories=no,statusbar=no,toolbar=no";
	
	window.open(gURL,winName,features); //oeffnet das Fenster
}



dhtml_class.prototype.scroller = function(parentId,id,offset)
{
    this.parentId=parentId;
	this.id=id;
	parenthoehe=document.getElementById(parentId).offsetHeight;
	childhoehe = document.getElementById(id).offsetHeight;
	if(parenthoehe>=childhoehe){
	    button.hide("up");
	    button.hide("down");
	}else{
	    button.show("up");
	    button.show("down");
	}
	
    this.maxUp =offset;
    this.maxBottom =0;
    
    
}

dhtml_class.prototype.scrollUp = function()
{
    if(document.all){
    inhaltY = document.getElementById(this.id).style.pixelTop;
    }else{
    inhaltY = parseInt(document.getElementById(this.id).style.top);
    }
    if(isNaN(inhaltY)){inhaltY="-20";}
    this.timer = setTimeout("button.scrollUp()", 20);
	if (Math.abs(inhaltY)<this.maxUp){
	this.ypos-=this.speed;
    }else {button.scrollStop();}
    if(document.all){
	document.getElementById(this.id).style.pixelTop = this.ypos;
	}else{
	document.getElementById(this.id).style.top = this.ypos;
	}
}

dhtml_class.prototype.scrollDown = function()
{

	if(document.all){
    inhaltY = document.getElementById(this.id).style.pixelTop;
    }else{
    inhaltY = parseInt(document.getElementById(this.id).style.top);
    }
    if(isNaN(inhaltY)){inhaltY="-20";}
    this.timer = setTimeout("button.scrollDown()", 20);
	if (Math.abs(inhaltY)>this.maxBottom){
	this.ypos+=this.speed;
    }else {button.scrollStop();}
    if(document.all){
	document.getElementById(this.id).style.pixelTop = this.ypos;
	}else{
	document.getElementById(this.id).style.top = this.ypos;
	}
	
	
}


dhtml_class.prototype.scrollStop = function()
{
    if (this.timer) clearTimeout(this.timer);
}



dhtml_class.prototype.floatclass = function(was)
{
    
    offsett=210;
    this.was=was;
    if(navigator.appName.indexOf("Netscape") == -1){
        startX = document.body.clientWidth-(offsett-16);
    }else{
    	if(this.bvers[1] == "Macintosh"){
    	    if((this.saf != true) && (this.bvers[0] == "Mozilla")){
        startX = self.innerWidth-208;
    }else{
    startX = self.innerWidth-193;
    }
	}else{
	startX = self.innerWidth-offsett;
	}
    }
    
    startY = 20;

    if(document.all){
        
            if(this.bvers[0] == "Opera 7"){off=13;}else{off=0;}
        document.getElementById("tablemain").style.pixelLeft=(document.body.clientWidth-750)+off
       
    }else{
        document.getElementById("tablemain").style.left=self.innerWidth-750
       
    }
    this.show(was);
	function makeit(id)
	{
		divObj=document.getElementById(id);
		divObj.arr=function(xpos,ypos){this.style.left=xpos;this.style.top=ypos;};
		divObj.xpos = startX;
		divObj.ypos = startY;
		return divObj;
	}
	window.moveit=function()
	{
	   if(navigator.appName.indexOf("Netscape") == -1){
		obj.ypos += (document.body.scrollTop + startY - obj.ypos)/8;
		obj.xpos = startX;
        }else{
        obj.ypos += (self.pageYOffset + startY - obj.ypos)/8;
		obj.xpos = startX;
		}
		obj.arr(obj.xpos, obj.ypos);
		setTimeout("moveit()", 10);
	}
	obj = makeit(this.was);
	moveit();

}

//oeffnet fenster
dhtml_class.prototype.openprint = function(gURL)
{
	//gURL=>Pfad des HTML-Dokumentes
	
	winName="wind";//Name des Fensters
	xsize = 660;	//Breite des Fensters
	ysize = 600;  //Hoehe des Fensters
	xpos = (screen.width/2)-(xsize/2);
	ypos = (screen.height/2)-(ysize/2);
	features = "width=" + xsize + ",height=" + ysize + ",location=no,menubar=no,personalbar=no,resizable=no,screenX=" + xpos + ",screenY=" + ypos + ",left=" + xpos + ",top=" + ypos + ",locationbar=no,scrollbars=yes,directories=no,statusbar=no,toolbar=yes";
	
	window.open(gURL,winName,features); //oeffnet das Fenster

}


dhtml_class.prototype.checkOption = function(was,lang){

    var newlink="";
    if((lang == "") || (lang =="undefined")){
        lang="D";
        newlink=">> AKKREDITIERUNGSFORMULAR FACHBESUCHER";
        }else if(lang == "D"){
        newlink=">> AKKREDITIERUNGSFORMULAR FACHBESUCHER";
    }else if(lang == "E"){
        newlink=">> ACCREDITATION FORM FOR TRADE VISITORS";
    }
    
	if (was.checked){
		this.create_layer("myform","<a href=\"javascript:openwin('https://www.breadandbutter-eurovision.com/bbecht/cms/cms.aspx?cms=wfuser_bbecht&SiteID=0&GroupID=13&Status=318EA4&Language=" + lang + "','BBB','toolbar=no,scrollbars=yes,resizable=yes,width=700,height=700,top=10,left=80')\">" + newlink + "</a>");
	}else{
	this.create_layer("myform",newlink);
}

}


dhtml_class.prototype.checkOption2 = function(was,lang){

    var newlink="";
    if((lang == "") || (lang =="undefined")){
        lang="D";
        newlink=">> PRESS ACCREDITATION";
        }else if(lang == "D"){
        newlink=">> PRESS ACCREDITATION";
    }else if(lang == "E"){
        newlink=">> PRESS ACCREDITATION";
    }
    
	if (was.checked){
		this.create_layer("myform","<a href=\"javascript:openwin('https://www.breadandbutter-eurovision.com/bbecht/cms/cms.aspx?cms=wfuser_bbecht&GroupID=13&Status=318EA591&Language=" + lang + "','BBB','toolbar=no,scrollbars=yes,resizable=yes,width=700,height=700,top=10,left=80')\">" + newlink + "</a>");
	}else{
	this.create_layer("myform",newlink);
}

}

dhtml_class.prototype.create_layer =function(welcher,content)
{
	
    if (document.all) 
	{
	document.all[welcher].innerHTML=content;
	}
	else {
	document.getElementById(welcher).innerHTML=content;
	}
}
dhtml_class.prototype.doresize = function(was)
{
    //xsize = 1024;	//Breite des Fensters
	//ysize = 768;  //Hoehe des Fensters
	//xpos = (screen.width/2)-(xsize/2);
	//ypos = (screen.height/2)-(ysize/2);
    was.resizeTo(1024, 768);
    //was.moveTo(xpos,ypos);
    window.location.href=was.location;
    
}

dhtml_class.prototype.bbbticker = function(){


newslist=Array();
newslist[0]=new Array("EUROVISION <a href='http://www.breadandbutter.com/summer2005/index.php?id=238'> >> dates 2006-2008</a>","")
newslist[1]=new Array("<a href='http://www.breadandbutter.com/summer2005/index.php?id=14'> >> see the latest BREAD & butter - Brandindex</a>","")
newslist[2]=new Array("Brandbible online <a href='http://www.breadandbutter.com/summer2005/index.php?id=254'> >> brandfeatures</a>","")
newslist[3]=new Array("Images from <a href='http://www.breadandbutter.com/summer2005/index.php?id=275'> >> B&b Barcelona</a>","")
newslist[4]=new Array("Images from <a href='http://www.breadandbutter.com/summer2005/index.php?id=292'> >> B&b Berlin</a>","")

    if(!document.getElementById){return;}
    if(this.tickertimer!==false){clearTimeout(this.tickertimer);}
    this.tickerdiv = 1-this.tickerdiv;
    obj1 = document.getElementById("tickfield"+this.tickerdiv);
    obj2 = document.getElementById("tickfield"+(1-this.tickerdiv));
    obj3 = document.getElementById("tickfield2");
    if (this.oldtop === false) { this.oldtop = obj1.style.top; }
    res = newslist[this.cnt][0];
    res = res.replace(/<a[^>]*>|<\/a>/g, '');
    max=res.length - 1;
    if (this.count < max)
    {
    this.count++;
    test = newslist[this.cnt][0];
    temp1 = test.replace(/<a[^>]*>|<\/a>/g, '');
    temp1 = temp1.split('');
    this.curr = this.curr+temp1[this.count];
    temp2 = newslist[this.cnt][1];
    obj2.style.top = -100;
    obj2.style.left = 5;
    obj3.style.left = 5;
    obj1.style.top = this.oldtop;
    //obj3.style.top = 10;
    obj1.style.left = 5;
    obj1.innerHTML = this.curr + "__";
    this.tickertimer = setTimeout("win.bbbticker()",75);
    obj3.innerHTML=""
    return;
}else{

    var found = null;
    var lang=this.returnlang();
    var txt = newslist[this.cnt][0];
    var ausdruck = /(.*)<a href=[\'\"](.*)[\'\"][^>]*>(.*)/;
    found = ausdruck.exec(txt);
     
    
    if(found != null){
        obj3.innerHTML=RegExp.$1 + "<a href=\"" + RegExp.$2+ "&L=" + lang + "\" style=\"font:normal 10px/12px Arial,Verdana, sans-serif;text-decoration:underline;\">" + RegExp.$3;;
        obj2.innerHTML=""
    }
   
    }
    this.count = -1; this.curr = "";
    if(this.cnt<newslist.length-1){this.cnt++;}else{this.cnt=0;}
    this.tickertimer = setTimeout("win.bbbticker()",3000);

}

dhtml_class.prototype.returnlang = function(){
    // Sprache ermitteln
    str=window.location.href;
	reg= /L=(.?)&?/;
	found= reg.exec(str);
	if(found){return found[1];}else{return 1;}
}

dhtml_class.prototype.returnid = function(){
    // Sprache ermitteln
    str=window.location.href;
	reg= /id=([0-9]{1,})/;
	found= reg.exec(str);
	if(found){return found[1];}else{return 1;}
}
dhtml_class.prototype.openpop = function(gURL,breite,hoehe,id){
    if(this.returnid() == id){
        this.openwin(gURL,breite,hoehe);
    }
    
}
dhtml_class.prototype.setHeight = function(){
   
	var neue_hoehe=parseInt(this.getWindowHeight()-137);
	if(this.getWindowWidth()<882){
		win_width=587;
	}else{
		win_width=682;
	}

	document.write("<div class=\"scroll\" style=\"height:" + neue_hoehe + "px;width:" + win_width + "px;overflow:auto;\"  >");

}
dhtml_class.prototype.setHeightStart = function(){
	var neue_hoehe=parseInt(this.getWindowHeight()-137);
	if(this.getWindowWidth()<882){
		win_width=587;
	}else{
		win_width=682;
	}
	document.write("<div class=\"scroll\" style=\"height:" + neue_hoehe + "px;width:" + win_width + "px;\"  >");
}
dhtml_class.prototype.getWindowHeight = function()
{
  if (parent.window.innerHeight) {
    return parent.window.innerHeight;
  } else if (parent.document.body && document.body.offsetHeight) {
    return parent.document.body.offsetHeight;
  } else {
    return 0;
  }
}
dhtml_class.prototype.getWindowWidth = function()
{
  if (parent.window.innerWidth) {
    return parent.window.innerWidth;
  } else if (parent.document.body && document.body.offsetWidth) {
    return parent.document.body.offsetWidth;
  } else {
    return 0;
  }
}

function ghidticker(){
	return false;
	}