

CbIvw = function() {
	this.newRef = null;
	this.newSrc = ''; 
	this.rholive = null;
}

CbIvw.prototype.reload = function(url) {
	if(url != undefined && url != null){
		this.newRef = url
		this.newUrl = url;
	}else if(document.referrer && document.referrer != this.newRef){
		this.newRef = document.referrer;
	}else{
		this.newRef = this.newUrl ? this.newUrl : document.URL;
	}
	
	if(document.getElementById('ivwPixel') != null){
		document.getElementById('ivwPixel').src = IVW + '?r=' + escape(this.newRef) + '&d=' + (Math.random() * 100000);
	}	

	if(url == undefined || url == null){
		this.newUrl = window.location.pathname;
	}
	if(typeof urchinTracker == "function") {
		urchinTracker(this.newUrl);
	}
		
	if(document.getElementById('rholive1') != null) {
		this.rholive = document.getElementById('rholive1');
		this.newSrc = this.rholive.src.replace(/url=[^;]+/, 'url=' + encodeURIComponent(this.newUrl));
		this.newSrc = this.rholive.src.replace(/r=[^;]+/, 'r=' + encodeURIComponent(this.newRef));
		this.newSrc = this.rholive.src.replace(/random=[^;]+/, 'random=' + Math.random());
		this.rholive.src = this.newSrc;
	}

}

CbContentItem = function(title, text){
	this.title = title == undefined ? '' : title;
	this.text = text == undefined ? '' : text;
}

CbContentItem.prototype.getTitle = function(){
	return this.title;
}

CbContentItem.prototype.getText = function(){
	return this.text;
}

function cbLytebox(oLink, title, text, objectType){
	//ivw pixel reloaden
	try {
		contentItem = new CbContentItem(title, text);
		myLytebox = new LyteBox(objectType);
		myLytebox.start(oLink, false, false, contentItem);
		counter = new CbIvw();
		counter.reload(oLink.src);
	}catch(e){}
	return false;
}

function ir_popup_articlelink(url)
{
	var addparams = '';
	for (var i = 1; 2 * i < arguments.length; i++)
	{
		addparams += '&' + arguments[2 * i - 1] + '=' + arguments[2 * i];
	}

	window.open('http://www.computerbild.de/popups/popup_beitragslink_2131.html?url=' + escape(url) + addparams, 'cobi_beitragslink', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=515,height=250');

}

function ir_popup_printversion(url)

{
	window.open(url, '', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=480');
}

function ir_popup_send2friend(url)
{
	var addparams = '';
	for (var i = 1; 2 * i < arguments.length; i++)
	{
		addparams += '&' + arguments[2 * i - 1] + '=' + arguments[2 * i];
	}

	window.open('http://www.computerbild.de/popups/popup_beitragempfehlen_2132.html?linkurl=' + escape(url) + addparams, 'cobi_beitragempfehlen', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=470,height=480');

}

function ir_popup_verstossmelden(reviewid)
{
	var addparams = '';
	for (var i = 1; 2 * i < arguments.length; i++)
	{
		addparams += '&' + arguments[2 * i - 1] + '=' + arguments[2 * i];
	}

	window.open('http://www.computerbild.de/popups/popup_verstossmelden_1152148.html?reviewid=' + reviewid + addparams, 'cobi_verstossmelden', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=470,height=400');

}

function ir_popup_email2author(url)
{
	var addparams = '';
	for (var i = 1; 2 * i < arguments.length; i++)
	{
		addparams += '&' + arguments[2 * i - 1] + '=' + arguments[2 * i];
	}

	window.open('http://www.computerbild.de/popups/popup_mailanautor_2133.html?url=' + escape(url) + addparams, 'cobi_beitragempfehlen', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=470,height=520');

}

function ir_popup_umfrage(url, option, options)

{
	var heigth = 280 + (options * 42);
	window.open(url + '?option=' + option, '', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=480,height=' + heigth);
}

function ir_popup_video(url)

{
	height = 630;
	window.open(url, '', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=840,height=' + height);
}

function ir_popup_fotostrecke(url, height)

{
	height = parseInt(height) + 180;
	window.open(url, '', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=800,height=' + height);
}

function ir_popup_picture(url, height)

{
	height = parseInt(height) + 180;
	var addparams = '';
	for (var i = 1; 2 * i + 1 < arguments.length; i++)
	{
		addparams += '&' + arguments[2 * i] + '=' + arguments[2 * i + 1];
	}

	window.open('http://www.computerbild.de/popups/popup_bilder_2134.html?url=' + escape(url) + addparams, '', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=800,height=' + height);

}

function ir_popup_downloadpicture(url, picture, height)

{
	height = parseInt(height) + 200;
	window.open(url + '?pic=' + picture, '', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=800,height=' + height);
}

function ir_popup_articlepicture(url, picture, height)

{
	height = parseInt(height) + 200;
	window.open(url + '?pic=' + picture, '', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=800,height=' + height);
}

function ir_popup_cpdbpicture(cpdb_id)
{
	var addparams = '';
	for (var i = 1; 2 * i + 1 < arguments.length; i++)
	{
		addparams += '&' + arguments[2 * i - 1] + '=' + arguments[2 * i];
	}

	window.open('http://www.computerbild.de/popups/popup_bilder_2134.html?cpdb_id=' + cpdb_id + addparams, '', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=785,height=730,left=10,top=10');

}

function ir_popup_bezahlinhalt(url)
{
	window.open(url, '', 'toolbar=no,locationbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=470,height=450,left=10,top=10');
}

function ir_create_flash_with_mailtexts(video_url, link_url, link_title)
{

	return new SWFObject('http://www.computerbild.de/flash/CoBiPlayer.swf?DSLVideo=' + escape(video_url) + '&popupPlayer=true&pauseStatus=0&sendURL=http%3A%2F%2Fwww.computerbild.de%2Fflashmail_2403.html&linkURL=' + escape(link_url) + '&linkTitle=' + link_title + '&stf_headline=Video%20an%20einen%20Freund%20senden&stf_email=E-Mail-Adresse%20Ihres%20Freundes&stf_name=Bitte%20geben%20Sie%20Ihren%20Namen%20ein&stf_message=Ihre%20Nachricht&stf_sending=Bitte%20warten&stf_error=Es%20ist%20ein%20Fehler%20aufgetreten&stf_thanks=Ihre%20Nachricht%20wurde%20versendet', 'bigteaser', '400', '335', '8', '#ffffff');

}

function ir_create_flash_with_mailtexts_video(video_url, link_url, link_title)
{

	return new SWFObject('http://www.computerbild.de/flash/CoBiPlayer.swf?DSLVideo=' + escape(video_url) + '&popupPlayer=true&pauseStatus=0&sendURL=http%3A%2F%2Fwww.computerbild.de%2Fflashmail_2403.html&linkURL=' + escape(link_url) + '&linkTitle=' + link_title + '&stf_headline=Video%20an%20einen%20Freund%20senden&stf_email=E-Mail-Adresse%20Ihres%20Freundes&stf_name=Bitte%20geben%20Sie%20Ihren%20Namen%20ein&stf_message=Ihre%20Nachricht&stf_sending=Bitte%20warten&stf_error=Es%20ist%20ein%20Fehler%20aufgetreten&stf_thanks=Ihre%20Nachricht%20wurde%20versendet', 'bigteaser', '432', '274', '8', '#ffffff');

}

function ir_create_flash_with_mailtexts_video_popup(video_url, link_url, link_title)
{

	return new SWFObject('http://www.computerbild.de/flash/CoBiPlayer.swf?DSLVideo=' + escape(video_url) + '&popupPlayer=true&pauseStatus=0&sendURL=http%3A%2F%2Fwww.computerbild.de%2Fflashmail_2403.html&linkURL=' + escape(link_url) + '&linkTitle=' + link_title + '&stf_headline=Video%20an%20einen%20Freund%20senden&stf_email=E-Mail-Adresse%20Ihres%20Freundes&stf_name=Bitte%20geben%20Sie%20Ihren%20Namen%20ein&stf_message=Ihre%20Nachricht&stf_sending=Bitte%20warten&stf_error=Es%20ist%20ein%20Fehler%20aufgetreten&stf_thanks=Ihre%20Nachricht%20wurde%20versendet', 'bigteaser', '480', '301', '8', '#ffffff');

}

function ir_create_flash_with_mailtexts_teaser(video_url, link_url, link_title)
{

	return new SWFObject('http://www.computerbild.de/flash/CoBiPlayer.swf?DSLVideo=' + escape(video_url) + '&popupPlayer=true&pauseStatus=0&sendURL=http%3A%2F%2Fwww.computerbild.de%2Fflashmail_2403.html&linkURL=' + escape(link_url) + '&linkTitle=' + link_title + '&stf_headline=Video%20an%20einen%20Freund%20senden&stf_email=E-Mail-Adresse%20Ihres%20Freundes&stf_name=Bitte%20geben%20Sie%20Ihren%20Namen%20ein&stf_message=Ihre%20Nachricht&stf_sending=Bitte%20warten&stf_error=Es%20ist%20ein%20Fehler%20aufgetreten&stf_thanks=Ihre%20Nachricht%20wurde%20versendet', 'bigteaser', '300', '245', '8', '#ffffff');

}

function ir_create_flash_video_mini_inline(video_url, video_img)
{
	return new SWFObject('http://www.computerbild.de/flash/flvplayer.swf?file=' + escape(video_url) + '&image=' + escape(video_img) + '&usefullscreen=false&bufferlength=4&showfsbutton=false&volume=60&callback=urchin','mpl','240','155','7');
}
function ir_create_flash_video_randspalte(video_url, video_img)
{
	return new SWFObject('http://www.computerbild.de/flash/flvplayer.swf?file=' + escape(video_url) + '&image=' + escape(video_img) + '&usefullscreen=false&bufferlength=4&showfsbutton=false&volume=60&callback=urchin','mpl','298','187','7');
}

var ir_glossar_text = '';

function ir_glossar_text_position(elem, glossar_bid)
{
	if (glossar_infos != undefined && glossar_infos[glossar_bid] != undefined)
	{
		var text = '<h2 class="font_20 font_normal black">' + glossar_infos[glossar_bid][5] + '</h2>';
		if (glossar_infos[glossar_bid][0] != '')
		{
			text += '<span class="bold">Synonyme:</span> ' + glossar_infos[glossar_bid][0];
		}
		if (glossar_infos[glossar_bid][1] != '' || glossar_infos[glossar_bid][2] != '')
		{
			text += '<br /><span class="bold">Sprich:</span> ' + glossar_infos[glossar_bid][1];
			if (glossar_infos[glossar_bid][2] != '')
			{
				text += ((glossar_infos[glossar_bid][1] != '') ? ' | ' : '') + '<a href="' + glossar_infos[glossar_bid][2] + '" class="link_color">Vorlesen lassen</a>';
			}
		}
		text += '<p style="width:260px; overflow:hidden;">' + glossar_infos[glossar_bid][3] + '</p>' + glossar_infos[glossar_bid][4];

		ir_glossar_text = text;
		elem.onmousemove = ir_glossar_text_evt;
	}
}

function ir_glossar_text_evt(evt)
{
	evt = (evt) ? evt : ((window.event) ? window.event : '');
	var text = '';
	if (evt.clientY <= 220)
	{
		text = '<div><div class="tooltip_footer_2"></div><div class="tooltip_inner_2" style="text-align:left; width:295px; overflow:hidden;"><div style="margin-left:15px;"> ' + ir_glossar_text + ' </div></div></div>';
		return overlib(text, MOUSEOFF, STICKY, CAPTION, RIGHT, SNAPX, 10, SNAPY, 10, FULLHTML);
	}
	else
	{
		text = '<div><div class="tooltip_inner_1" style="text-align:left;"><div style="margin-left:15px; width:270px; overflow:hidden;"> ' + ir_glossar_text + ' </div></div><div class="tooltip_footer_1"></div></div>';
		return overlib(text, MOUSEOFF, STICKY, CAPTION, RIGHT, ABOVE, SNAPX, 10, SNAPY, 10, FULLHTML);
	}
}

var ir_knoedel_text = '';

function ir_knoedel_text_position(elem, imgurl)
{
	ir_knoedel_text = '<img src="' + imgurl + '" class="db" alt="" />';
	elem.onmousemove = ir_knoedel_text_evt;
}

function ir_knoedel_text_evt(evt)
{
	evt = (evt) ? evt : ((window.event) ? window.event : '');
	var elem = (evt.target) ? evt.target : evt.srcElement;
	var text = '';
	if (evt.clientY <= 220)
	{
//		text = '<div><div class="tooltip_footer_2"></div><div class="tooltip_inner_2"><div class="tooltip_img">' + ir_knoedel_text + '</div></div></div>';
		text = '<div><table border="0" cellpadding="0" cellspacing="0"><tr><td class="table_tooltip_02_l"></td><td class="table_tooltip_02_r"></td></tr><tr><td class="table_tooltip_02_lo">' + ir_knoedel_text + '</td><td class="table_tooltip_02_ro"></td></tr></table></div>';
		return overlib(text, MOUSEOFF, RIGHT, SNAPX, 10, SNAPY, 10, FULLHTML);
	}
	else
	{
//		text = '<div><div class="tooltip_inner_1"><div class="tooltip_img">' + ir_knoedel_text + '</div></div><div class="tooltip_footer_1"></div></div>';
		text = '<div><table border="0" cellpadding="0" cellspacing="0"><tr><td class="table_tooltip_01_lo">' + ir_knoedel_text + '</td><td class="table_tooltip_01_ro"></td></tr><tr><td class="table_tooltip_01_l"></td><td class="table_tooltip_01_r"></td></tr></table></div>';
		return overlib(text, MOUSEOFF, RIGHT, ABOVE, SNAPX, 10, SNAPY, 10, FULLHTML);
	}
}

var ir_hilfe_text = '';

var global_hilfebutton_texte = {

	'knoedel' : '',
	'artikel_ca_oben' : 'Wenn Sie mehr wissen wollen, finden Sie in diesem Bereich weitere interessante Beiträge, die von der cleveren Suche für Sie zusammengestellt wurden.',
	'artikel_ca_unten' : 'Die vorgestellten Produkte sind nur einen Klick entfernt: Hier finden Sie alle detaillierten Informationen und den COMPUTER BILD-Preisvergleich.',
	'download_ca' : 'Hier gelangen Sie direkt in die Unterrubrik oder Hauptkategorie der angezeigten Software. Praktisch: So lassen sich möglicherweise Programm-Alternativen ausfindig machen.',
	'glossar' : 'Mit einem Klick auf die Buchstaben, finden Sie schnell die gesuchten Fachbegriffe. Viele Einträge enthalten neben der Kurzerklärung auch weiterführende Informationen.',
	'video_links' : 'Das Video startet nach einer kurzen Vorladezeit automatisch. Um die Wiedergabe zu unterbrechen, auf die Pausetaste klicken. Das Video landet auch ganz einfach auf Ihrer Festplatte: Mit der rechten Maustaste auf „Video im WMV-Format” klicken, „Ziel speichern unter ...” wählen und einen Speicherort auswählen.',
	'video_rechts' : 'Hier finden Sie die neuesten Videos. Zum Starten genügt ein Klick auf das Vorschaubild oder die Überschrift.',
	'artikel_inline_produkte' : '',
	'download_teaser_3reiter' : ''

};
var currpage_hilfebutton_texte = new Array();

function ir_hilfe_text_position(elem, text)
{
	ir_hilfe_text = '<p style="width:260px; overflow:hidden;" class="l_h_16">' + text + '</p>';
	elem.onmousemove = ir_hilfe_text_evt;
}


function ir_hilfe_text_evt(evt)
{
	evt = (evt) ? evt : ((window.event) ? window.event : '');
	var elem = (evt.target) ? evt.target : evt.srcElement;
	var text = '';
	if (evt.clientY <= 220)
	{
		text = '<div><div class="tooltip_footer_2"></div><div class="tooltip_inner_2" style="text-align:left;"><div style="margin-left:15px;"> ' + ir_hilfe_text + ' </div></div></div>';
		return overlib(text, MOUSEOFF, STICKY, CAPTION, RIGHT, SNAPX, 10, SNAPY, 10, FULLHTML);
	}
	else
	{
		text = '<div><div class="tooltip_inner_1" style="text-align:left;"><div style="margin-left:15px;"> ' + ir_hilfe_text + ' </div></div><div class="tooltip_footer_1"></div></div>';
		return overlib(text, MOUSEOFF, STICKY, CAPTION, RIGHT, ABOVE, SNAPX, 10, SNAPY, 10, FULLHTML);
	}
}

function ir_change_wortwolke(bid, id, bg_color) {
	var i, farbe, count=2;
	for (i = 1; i <= count; i++) {
		if (i== id) {
			$('link_w_' + bid +'_' + i).addClassName('active');
			$('wortwolke_' + bid +'_' + i).style.display = 'block';
		}
		else {
			$('link_w_' + bid +'_' + i).removeClassName('active');
			$('wortwolke_' + bid +'_' + i).style.display = 'none';
		}
	}
}

function ir_change_tipp(bid, id, bg_color) {
	var i, count=3;
	for (i = 1; i <= count; i++) {
		if (i== id) {
			$('tipp_' + bid +'_' + i).style.display = 'block';
			$('tipp_w_' + bid +'_' + i).addClassName('active');
		}
		else {
			$('tipp_' + bid +'_' + i).style.display = 'none';
			$('tipp_w_' + bid +'_' + i).removeClassName('active');
		}
	}
}

function ir_change_downloads(bid, id, bg_color)
{
	var i, count=3;
	for (i = 1; i <= count; i++) {
		if (i== id) {
			$('downloads_' + bid +'_' + i).style.display = 'block';
			$('downloads_w_' + bid +'_' + i).addClassName('active');
	    }
	    else {
			$('downloads_' + bid +'_' + i).style.display = 'none';
			$('downloads_w_' + bid +'_' + i).removeClassName('active');
	    }
	}
	
	//ivw-pixel-reload bei tabwechsel in 3-reiterdownload-teaser
	var ivwPixel = document.getElementById('ivwPixel');
	if (ivwPixel) 
	{
		ivwPixel.src = IVW+'?r='+escape(document.referrer)+'&d='+(Math.random()*100000);
	}
	
	
}

function simpleToggle(o) {
    p = ($(o)).ancestors();
	p[0].childElements().each(function(n) {
		n.removeClassName('active');
	});
	($(o)).addClassName('active');
}

/* JS TEASER 1  START */

function showSlides(fteaser, total, type) {
	if (typeof total == "undefined") {
    	total = 4;
	}
	if (typeof type == "undefined") {
    	type = 1;
	}
	var itmp;
	eval('itmp = i_'+fteaser);
	itmp++;
	if (itmp > total) {
		itmp = 1;
	}
		showSlide('slide_'+fteaser+'_'+itmp, 'pager_'+fteaser+'_'+itmp, 0, fteaser, type, total);
		eval('i_'+fteaser+' = '+itmp);
}

function showSlide(slide, pager, stop, tid, type, total) {
	if (typeof total == "undefined") {
    	total = eval('total_'+tid);
	}
	var slides = document.getElementById('teaser_'+tid).getElementsBySelector('div.slide');
	switch(type) {
    case 1:
      var pagers = document.getElementById('pager_'+tid).getElementsByTagName('div');
      break;
    case 2:
       var pagers = document.getElementById('pager_'+tid).getElementsByTagName('a');

       break;
    default:
	}
	if (stop == 1) {
		eval('showSlides.cancelExecution(p_'+tid+')');
		eval('clearTimeout(p_'+tid+')');
		eval('p_'+tid+' = setTimeout (function(){showSlides.executePeriodically(6000,tid, total, type)},6000)');
		for (var i=0; i<slides.length; i++) {
			if (slides[i].id.substr(0,5) == 'slide' ) {
				if (slides[i].id == slide) {
					new Effect.Appear( slide, {duration: 0.0} );
          $(pager).addClassName('active');
				}
				else {
					new Effect.Fade( slides[i].id, {duration: 0.0} );
          $(pagers[i]).removeClassName('active');
				}		
			}
		}	
	}
	else {
		for (var i=0; i<slides.length; i++) {
			if (slides[i].id.substr(0,5) == 'slide' ) {
				if (slides[i].id == slide) {
					new Effect.Appear( slide, {duration: 0.3} );
          $(pager).addClassName('active');
				}
				else {
					new Effect.Fade( slides[i].id, {duration: 0.3} );
          $(pagers[i]).removeClassName('active');
				}		
			}
		}	
	
	}
}
/* JS TEASER 1  END */
/*  Timers */
Function.prototype.executePeriodically = function (){
	var s = this;
	if (typeof arguments[0].callee != 'undefined'){
		var arquments = arguments[0];
	} else {
		var arquments = arguments;
	}
	var delay = arquments[0];
	this.__INTERVAL__ = null;
	var args = [];
	for (var i=1; i<arquments.length; i++){ args.push(arquments[i]); }
	s.apply(this,args);
	if (this.__INTERVAL__)
		clearTimeout(this.__INTERVAL__);

	this.__INTERVAL__ = setTimeout (function (){
		s.executePeriodically(arquments);
	},delay);
	eval('p_'+ arquments[1] + ' = this.__INTERVAL__');
	return s;
}

Function.prototype.cancelExecution = function (){
	if (typeof arguments[0].callee != 'undefined'){
		var arquments = arguments[0];
	} else {
		var arquments = arguments;
	}
	clearTimeout(arquments[0]);
}
/* TIMERS END */

/* INIT JS TEASERS */
var js_teasers = new Array();
Event.observe(window, 'load', function() {
		js_teasers = $$('div.fteaser');
		for (var i=0; i<js_teasers.length; i++) {
      var tid = js_teasers[i].id.replace('teaser_','');
      var slides = document.getElementById(js_teasers[i].id).getElementsBySelector('div.slide');
      eval('showSlides.executePeriodically(6000,' + tid + ', total_'+tid+', type_'+tid+')');
		}
});
/* INIT END */


/*

------------ Google Adsense ---------------
-----------------start---------------------

*/

var google_adnum = 0;
var google_skip  = 0;
function google_ad_request_done(google_ads) {
	var s = '';
	var i;
	if (google_ads.length == 0) {
		return;
	}
	if (google_ads[0].type == "flash") {
		s += '<a href="' + google_info.feedback_url + '" style="color:000000">Ads by Google</a><br>' +
		'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
		' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"' +
		' WIDTH="' + google_ad.image_width +
		'" HEIGHT="' + google_ad.image_height + '">' +
		'<PARAM NAME="movie" VALUE="' + google_ad.image_url + '">' +
		'<PARAM NAME="quality" VALUE="high">' +
		'<PARAM NAME="AllowScriptAccess" VALUE="never">' +
		'<EMBED src="' + google_ad.image_url +
		'" WIDTH="' + google_ad.image_width +
		'" HEIGHT="' + google_ad.image_height +
		'" TYPE="application/x-shockwave-flash"' +
		' AllowScriptAccess="never" ' +
		' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
	} else if (google_ads[0].type == "image") {
		s += '<a href=\"' + google_info.feedback_url + '\" style="color:000000">Ads by Google</a><br>' +
		'<a href="' + google_ads[0].url +
		'" target="_top" title="go to ' + google_ads[0].visible_url +
		'"><img border="0" src="' + google_ads[0].image_url +
		'"width="' + google_ads[0].image_width +
		'"height="' + google_ads[0].image_height + '"></a>';
	} else {
		if (google_ads.length == 1) {
			
			s += head.replace(/%FEEDBACKURL%/g, google_info.feedback_url);
			
			s += '<div style="font-size: small;">';

			text = template.replace(/%URL%/g, google_ads[0].url);
			text = text.replace(/%VISURL%/g, google_ads[0].visible_url);
			text = text.replace(/%LINE1%/g, google_ads[0].line1);
			text = text.replace(/%LINE2%/g, google_ads[0].line2);
			text = text.replace(/%LINE3%/g, google_ads[0].line3);
			
			s += text;
			
			s += '</div>';
 
			s += foot;
			
			if (google_ads[0].bidtype == "CPC") {
				google_adnum = google_adnum + google_ads.length;
			}
			
		} else if (google_ads.length > 1) {

			s += head.replace(/%FEEDBACKURL%/g, google_info.feedback_url);
			
			for(i = 0; i < google_ads.length; ++i) {	
			
				text = template.replace(/%URL%/g, google_ads[i].url);
				text = text.replace(/%VISURL%/g, google_ads[i].visible_url);
				text = text.replace(/%LINE1%/g, google_ads[i].line1);
				text = text.replace(/%LINE2%/g, google_ads[i].line2);
				text = text.replace(/%LINE3%/g, google_ads[i].line3);
				
				if(typeof switchBGcolor != "undefined"){
					if(switchBGcolor) {
						if(i % 2) {
							color = '#F0F1F3';
						}
						else {
							color = 'white';
						}
						
						text = text.replace(/%COLOR%/g, color);
					}
				}
				
				
				
				
				
				if((i + 1) < google_ads.length) {
					text += divider;
					text = text.replace(/%BORDER%/g, 'border-width: 0px 0px 1px 0px;');
				}
				else {
					text = text.replace(/%BORDER%/g, 'border-width: 0px 0px 0px 0px;');
				}
				
				s+= text;
			} 
			s += foot;
			
			if (google_ads[0].bidtype == "CPC") {
				google_adnum = google_adnum + google_ads.length;
			}
			
		}
  }
  document.write(s);
  return;
}



function gg_adsense(teaserClass){
teaserClassName = (!teaserClass) ? ('teaser_cs') : teaserClass;

google_skip = google_adnum;

addHeader = 'Google-Anzeigen';


template = '	<div class="singleBlock">' + 
					'<p class="linkHeader">' + 
						'<a href="%URL%" onmouseout="window.status=\'\';return true;" onmouseover="window.status=\'go to %VISURL%\';return true;" style="text-decoration:underline;" target="_blank">%LINE1%</a>' + 
					'</p>' + 
					'<span class="line2">%LINE2% </span>' + 
					'<span class="line3">%LINE3%</span>' +
					'<p>' + 
						'<a href="%URL%" onmouseout="window.status=\'\';return true;" onmouseover="window.status=\'go to %VISURL%\';return true;" style="text-decoration:none;" target="_blank">%VISURL%</a>' +
					'</p>' + 
				'</div>';

head = '	<div class="' +teaserClassName+ ' adsense">' +
				'<div class="header">' +
					'<div class="headLine clearfix">' +
						'<span class="headLineTitle">' +
							'<a class="googleFeedback" href=\"%FEEDBACKURL%" target="_blank">' +addHeader+ '</a>' +
						'</span>' +
					'</div>' +
				'</div>' +
				'<div class="content">' + 
					'<div class="textBlock">';

foot = '			</div>' + 
				'</div>' +
			'</div>';

divider = '<hr />';
}

function gg_skyscraper() {
	gg_adsense(' ');
}

function gg_article_bottom() {
	/* BACKUP  */
	gg_adsense();
}
function gg_article_top() {
	/* BACKUP  */
	gg_adsense();
}
function gg_right_column() {
	/* BACKUP  */
	gg_adsense('teaser_rr');
}
function gg_index_large(){
	/* BACKUP  */
	gg_adsense();
}

/*

------------ Google Adsense ---------------
------------------end----------------------

*/

/*

------------ Google Adsense for Search ---------------
-----------------------start--------------------------

*/

function google_afs_request_done(google_ads) {
	
	if (google_ads.length < 1 ) {
	// Normaler Adsense Block mit circa drei Anzeigen?
              return;
	}
	
	
	if(typeof google_suche_typ != "undefined" && google_suche_typ == "dl") {
		
		google_suche_ergebnis = '<div style=\"border: 1px solid #D9DDDE; margin-top: 9px; margin-bottom: 9px; border-bottom: none; width:785px; height: auto; font-family: Verdana, Arial;\">' +
								'<div style=\"width: 785px; height: 21px; background-color:#D9DDDE; color: #000; font-size: 10px; font-weight:bold;\">' +
								'<div style=\"padding-left:8px; padding-top:3px;\"><a target=\"_blank\" style=\"color:#000; text-decoration: none;\" href=\"http://services.google.com/feedback/online_hws_feedback\">Google-Anzeigen</a></div>' +
								'</div>';
		
		kw += " ";
		Ergebnis = kw.match(/([^ ]*) /g);
		for(i = 0; i < anzahl; ++i) {
	//		if (google_ads[i].type == 'text/wide') {
				if (google_ads[i] && google_ads[i].line1 && google_ads[i].line2) {
					line1 = google_ads[i].line1;
					line2 = google_ads[i].line2;
					if (google_ads[i].line3)
						line3 = google_ads[i].line3;
					else
						line3 = '';
					if(i % 2) {
								var color = '#FFF';
							}
							else {
								var color = '#F0F1F3';
					}
					if(typeof google_suche_size != "undefined" && google_suche_size == "hoch") {
						var div_height = '54';
						var div_padding_top = '5';
					} else {
						var div_height = '45';
						var div_padding_top = '1';
					}
					
					google_suche_ergebnis +=	'<div style=\"width:785px; height:' + div_height + 'px; background-color:' + color + '; border-bottom: 1px solid #D9DDDE;\">' +
												'<div style=\"padding-left: 8px; padding-top: ' + div_padding_top + 'px; line-height:14px;\">' +
												'<a href=\"' + google_ads[i].url + '\" onmouseover=\"window.status=\'gehe zu ' + google_ads[i].visible_url + '\'\" onmouseout=\"window.status=\'\'\" target=\"_blank\" style=\"color:#03649B; font-weight: bold; text-decoration:none; line-height:14px; font-size: 11px;\">' + line1 + '</a><br />' +
												'<span style=\"text-decoration:none; font-size: 11px; line-height:14px;\">'+ line2 + '</span> <span style=\"text-decoration:none; line-height:14px; font-size: 11px\">' + line3 + '</span><br />' +
												'<a style=\"color:#03649B; font-weight:normal; text-decoration:none; line-height:14px; font-size: 11px\" href=\"' + google_ads[i].url + '\" target=\"_blank\">' + google_ads[i].visible_url + '</a>' +
												'</div></div>';
				}
	//		}
		}
		google_suche_ergebnis += '</div>';
		return;
	} else {
	google_suche_ergebnis = '<span class="grey"><a class="googleFeedback" target="_blank" href="http://services.google.com/feedback/online_hws_feedback">Google-Anzeigen</a></span><br /><div class="content_box clearfix bg_none border_t_1 padding_t_5 margin_t_2 margin_b_5">';
	kw += " ";
	Ergebnis = kw.match(/([^ ]*) /g);
	for(i = 0; i < anzahl; ++i) {
//		if (google_ads[i].type == 'text/wide') {
			if (google_ads[i] && google_ads[i].line1 && google_ads[i].line2) {
				line1 = google_ads[i].line1;
				line2 = google_ads[i].line2;
				if (google_ads[i].line3)
					line3 = google_ads[i].line3;
				else
					line3 = '';
				if (Ergebnis)
					for (var j = 0; j < Ergebnis.length; ++j) {
						Ergebnis[j] = Ergebnis[j].replace(' ','');
						myregexp = new RegExp(Ergebnis[j],'ig');
						line1 = line1.replace(myregexp,'<b>'+Ergebnis[j]+'</b>');
						myregexp = new RegExp(Ergebnis[j],'ig');
						line2 = line2.replace(myregexp,'<b>'+Ergebnis[j]+'</b>');
						myregexp = new RegExp(Ergebnis[j],'ig');
						line3 = line3.replace(myregexp,'<b>'+Ergebnis[j]+'</b>');
					}
				google_suche_ergebnis += '<div class="content_box clearfix bg_none border_b_1 margin_b_5">' +
					'<h2><a href="' + google_ads[i].url + '" onmouseover="window.status=\'gehe zu ' +
					google_ads[i].visible_url + '\'" onmouseout="window.status=\'\'" target="_blank" class="link_color margin_b_10">'+ line1 + '</a></h2>' +
					'<p class="l_h_16">'+ line2 + '&nbsp;' + line3 + '</p>' +
					'<div class="float_l margin_b_5"><a href="' + google_ads[i].url + '" target="_blank" class="link_color">' + google_ads[i].visible_url + '</a></div>' +
					'<br class="clearall" />' +
					'</div>';
			}
//		}
        }
	google_suche_ergebnis += '</div>';
	return;
}
}
var google_afs_client = 'pub-4347119884249993';
var google_afs_adsafe = 'medium';
var googleAdNewWindow = 1;
var google_afs_hl = 'de';

/*

------------ Google Adsense for Search ---------------
-----------------------end----------------------------

*/


function CbImageGallery(galleryId) {
	this.selectedIndex = 0;
	this.oldIndex = 0;
	this.previousIndex = 0;
	this.nextIndex = 0;
	this.nextThumbIndex = 0;
	this.previousThumbIndex = 0;
	this.nextThumb = null;
	this.prevThumb = null;
	this.images = new Array();
	this.lytebox = false;
	this.objectType = '';
	this.counter = 0;
	this.galleryId = galleryId;
	this.adReload = 1000;
	
		
	if(document.getElementById(('imageMain' + galleryId))) {
		this.imageMain = document.getElementById('imageMain' + galleryId);
	} else {
		this.imageMain = false;
	}
	
	if(document.getElementById('imageText' + galleryId)) {
		this.imageText = document.getElementById('imageText' + galleryId);
	} else {
		this.imageText = false;
	}
	
	if(document.getElementById('imageThumb' + galleryId)) {
		this.imageThumb = document.getElementById('imageThumb' + galleryId);
	} else {
		this.imageThumb = false;
	}
	
	if(document.getElementById('imageTitle' + galleryId)) {
		this.imageTitle = document.getElementById('imageTitle' + galleryId);
	} else {
		this.imageTitle = false;
	}
	
	this.loaderDiv = document.getElementById('loaderDiv' + galleryId);
	this.mainDiv = document.getElementById('mainDiv' + galleryId);
	
	this.imageCounterTop = document.getElementById('imageCounterTop' + galleryId);
	this.imageCounterBottom = document.getElementById('imageCounterBottom' + galleryId);
	
	this.imageMainLink = document.getElementById('imageMainLink' + galleryId);
	this.popupLinkText = document.getElementById('popupLinkText' + galleryId);
	this.popupLinkImage = document.getElementById('popupLinkImage' + galleryId);
	
	if(document.getElementById(('thumbnailNext' + galleryId))) {
		this.thumbnailNext = document.getElementById('thumbnailNext' + galleryId);
	} else {
		this.thumbnailNext = false;
	}

	if(document.getElementById(('thumbnailPrevious' + galleryId))) {
		this.thumbnailPrevious = document.getElementById('thumbnailPrevious' + galleryId);
	} else {
		this.thumbnailPrevious = false;
	}
	
	if(document.getElementById('prevLink' + galleryId)) {
		this.prevLink = document.getElementById('prevLink' + galleryId);
	} else {
		this.prevLink = false;
	}

	if(document.getElementById('prevThumbLink' + galleryId)) {
		this.prevThumbLink = document.getElementById('prevThumbLink' + galleryId);
	} else {
		this.prevThumbLink = false;
	}

	if(document.getElementById('nextLink' + galleryId)) {
		this.nextLink = document.getElementById('nextLink' + galleryId);
	} else {
		this.nextLink = false;
	}

	if(document.getElementById('nextThumbLink' + galleryId)) {
		this.nextThumbLink = document.getElementById('nextThumbLink' + galleryId);
	} else {
		this.nextThumbLink = false;
	}

	this.imageDescription = document.getElementById('imageDescription' + galleryId + this.selectedIndex);
}

CbImageGallery.prototype.setObjectType = function(sObjType) {
	this.objectType = sObjType;
};

CbImageGallery.prototype.changeContents = function() {
	this.counter ++;
	this.newImage = new Image();
	this.newImage.src = this.images[this.selectedIndex][1];
	
	this.mainDiv.style.display = 'none';
	this.loaderDiv.style.display = '';
	
	this.imageMain.src = this.images[this.selectedIndex][1];
	if(this.images[this.selectedIndex][6]) {
		this.imageMain.alt = this.htmlentitydecode(this.images[this.selectedIndex][6]);
		this.imageMain.title = this.htmlentitydecode(this.images[this.selectedIndex][6]);
	} else {
		this.imageMain.alt = '';
		this.imageMain.title = '';
	}
	
	this.imageMain.removeAttribute('height');
	this.imageMain.removeAttribute('width');

	if(this.imageMain.width > 360){
		this.imageMain.width = 360;
	}
	
	this.loaderDiv.style.display = 'none';
	this.mainDiv.style.display = '';
	
	if(this.selectedIndex == 0) {
		this.previousIndex = this.images.length - 1;
	} else {
		this.previousIndex = this.selectedIndex - 1;
	}
	
	this.previousThumbIndex = this.selectedIndex - 2;
	if(this.previousThumbIndex < 0 ) {
		this.previousThumbIndex = this.images.length + this.previousThumbIndex;
	}
	
	if(this.selectedIndex == (this.images.length - 1)) {
		this.nextIndex = 0;
	} else {
		this.nextIndex = this.selectedIndex + 1;
	}
	
	this.nextThumbIndex = this.selectedIndex + 2;
	if(this.nextThumbIndex >= this.images.length) {
		this.nextThumbIndex = this.nextThumbIndex - this.images.length;
	}
	
	if(this.thumbnailNext != false) {
		this.thumbnailNext.removeAttribute('height');
		this.thumbnailNext.src = this.images[this.nextIndex][0];
		this.thumbnailNext.width = 75;
	
		if(this.images[this.nextIndex][6]) {
			this.thumbnailNext.alt = this.htmlentitydecode(this.images[this.nextIndex][6]);
			this.thumbnailNext.title = this.htmlentitydecode(this.images[this.nextIndex][6]);
		} else {
			this.thumbnailNext.alt = '';
			this.thumbnailNext.title = '';
		}
	}

	if(this.thumbnailPrevious != false) {
		this.thumbnailPrevious.removeAttribute('height');
		this.thumbnailPrevious.src = this.images[this.previousIndex][0];
		this.thumbnailPrevious.width = 75;
		
		if(this.images[this.previousIndex][6]) {
			this.thumbnailPrevious.alt = this.htmlentitydecode(this.images[this.previousIndex][6]);
			this.thumbnailPrevious.title = this.htmlentitydecode(this.images[this.previousIndex][6]);
		} else {
			this.thumbnailPrevious.alt = '';
			this.thumbnailPrevious.title = '';
		}
	}


	if(this.counter > this.adReload) {
		if(this.prevLink != false) {
			this.prevLink.onclick = '';
		}
		if(this.prevThumbLink != false) {
			this.prevThumbLink.onclick = '';
		}
		if(this.nextLink != false) {
			this.nextLink.onclick = '';
		}
		if(this.nextThumbLink != false) {
			this.nextThumbLink.onclick = '';
		}
	}

	if(this.prevLink != false) {
		this.prevLink.href = window.location.pathname + '?bild=' + (this.previousIndex + 1);
	}
	if(this.prevThumbLink != false) {
		this.prevThumbLink.href = window.location.pathname + '?bild=' + (this.previousIndex + 1);
	}
	if(this.nextLink != false) {
		this.nextLink.href = window.location.pathname + '?bild=' + (this.nextIndex + 1);
	}
	if(this.nextThumbLink != false) {
		this.nextThumbLink.href = window.location.pathname + '?bild=' + (this.nextIndex + 1);
	}

	this.imageDescription = document.getElementById('imageDescription' + this.galleryId + this.oldIndex);
	if (this.imageDescription!=null && this.imageDescription!=undefined) {
		this.imageDescription.style.display = 'none';
	}
	
	this.imageDescription = document.getElementById('imageDescription' + this.galleryId + this.selectedIndex);
	if (this.imageDescription!=null && this.imageDescription!=undefined) {
		this.imageDescription.style.display = '';
	}
	
	this.imageCounterTop.innerHTML = 'Bild ' + (this.selectedIndex + 1) + ' von ' + this.images.length;
	this.imageCounterBottom.innerHTML = 'Bild ' + (this.selectedIndex + 1) + ' von ' + this.images.length;
	
	this.imageMainLink.href = this.images[this.selectedIndex][2];
	this.imageMainLink.title = this.htmlentitydecode(this.images[this.selectedIndex][3]);
	

	this.popupLinkText.href = this.images[this.selectedIndex][2];
	if(this.images[this.selectedIndex][6]) {
		this.popupLinkText.title = this.htmlentitydecode(this.images[this.selectedIndex][6]);
	} else {
		this.popupLinkText.title = '';
	}
	
	if(this.popupLinkImage != undefined){
		this.popupLinkImage.href = this.images[this.selectedIndex][2];
		if(this.images[this.selectedIndex][6]) {
			this.popupLinkImage.title = this.htmlentitydecode(this.images[this.selectedIndex][6]);
		} else {
			this.popupLinkImage.title = '';
		}
	}
	this.reloadIvwPixel();
	this.preloadImages();
};

CbImageGallery.prototype.nextImage = function() {
	this.oldIndex = this.selectedIndex;
	if(this.nextThumb != false) {
		this.nextThumb = this.preloadNextThumb;
	}
	if(this.prevThumb != false) {
		this.prevThumb = this.preloadSelectedThumb;	
	}

	if(this.selectedIndex < (this.images.length -1)) { 
		this.selectedIndex++;
	} else {
		this.selectedIndex = 0;
	}
	this.changeContents();
};

CbImageGallery.prototype.previousImage = function() {
	this.oldIndex = this.selectedIndex;
	if(this.nextThumb != false) {
		this.nextThumb = this.preloadSelectedThumb;
	}
	if(this.prevThumb != false) {
		this.prevThumb = this.preloadPrevThumb;
	}

	if(this.selectedIndex == 0) { 
		this.selectedIndex = this.images.length -1;
	} else {
		this.selectedIndex--;
	}
	this.changeContents();
};

CbImageGallery.prototype.preloadImages = function() {
	this.preloadNextImage = new Image();
	this.preloadNextImage.src = this.images[this.nextIndex][1];
	this.preloadNextImage.alt = this.images[this.nextIndex][6];
	this.preloadNextImage.title = this.images[this.nextIndex][6];
	
	this.preloadPrevImage = new Image();
	this.preloadPrevImage.src = this.images[this.previousIndex][1];
	this.preloadPrevImage.alt = this.images[this.previousIndex][6];
	this.preloadPrevImage.title = this.images[this.previousIndex][6];
	
	this.preloadSelectedThumb = new Image();
	this.preloadSelectedThumb.src = this.images[this.selectedIndex][0];
	
	this.preloadNextThumb = new Image();
	this.preloadNextThumb.src = this.images[this.nextThumbIndex][0];
	
	this.preloadPrevThumb = new Image();
	this.preloadPrevThumb.src = this.images[this.previousThumbIndex][0];
};

CbImageGallery.prototype.reloadIvwPixel = function() {
	if(this.counter == 0) {
		if(document.referrer) {
			this.newRef = document.referrer;
		} else {
			this.newRef = document.URL;
		}
	} else {
		this.newRef = this.newUrl;
	}
	
	var ivwArray = IVW.split('-');
	var ivwCodeString = '';
	
	for(i = 0; i < ivwArray.length -1; i++) {
		if(i != 0) {
			ivwCodeString += '-';
		}
		ivwCodeString += ivwArray[i];
	}
	if(document.getElementById('ivwPixel') != null) {
		document.getElementById('ivwPixel').src = ivwCodeString + '-i?r=' + escape(this.newRef) + '&d=' + (Math.random() * 100000);
	}
	
	if(window.location.pathname.indexOf('?') == -1) {
		this.newUrl = window.location.pathname + '?bild=' + (this.selectedIndex + 1);
	} else {
		if(window.location.pathname.indexOf('bild=') == -1) {
			this.newUrl = window.location.pathname + '&bild=' + (this.selectedIndex + 1);
		} else {
			this.newUrl = window.location.pathname.replace(/bild=\d+/, 'bild=' + (this.selectedIndex + 1));
		}
	}
	
	if(typeof urchinTracker == "function") {
		urchinTracker(this.newUrl);
	}
		
	if(document.getElementById('rholive1') != null) {
		this.rholive = document.getElementById('rholive1');
		this.newSrc = this.rholive.src.replace(/url=[^;]+/, 'url=' + encodeURIComponent(this.newUrl));
		this.newSrc = this.rholive.src.replace(/r=[^;]+/, 'r=' + encodeURIComponent(this.newRef));
		this.newSrc = this.rholive.src.replace(/random=[^;]+/, 'random=' + Math.random());
		this.rholive.src = this.newSrc;
	}
};

CbImageGallery.prototype.getTitle = function() {
	return this.images[this.selectedIndex][3];
};

CbImageGallery.prototype.getText = function() {
	return this.images[this.selectedIndex][4];
};

CbImageGallery.prototype.getHref = function() {
	return this.images[this.selectedIndex][2];
};

CbImageGallery.prototype.displayOverlay = function(oLink) {
	this.reloadIvwPixel();
	
	myLytebox = new LyteBox(this.objectType);
	myLytebox.start(oLink, false, false, this);
	
};

CbImageGallery.prototype.htmlentitydecode = function(text){
  var d=document.createElement("textarea");
  d.innerHTML=text.replace(/</g,"&lt;").replace(/>/g,"&gt;");
  return d.value;
};

function CbTextGallery(galleryId) {
	this.galleryId = galleryId;
	this.selectedIndex = 0;
	this.previousIndex = 0;
	this.nextIndex = 0;
	this.oldIndex = 0;
	this.elements = new Array();
	this.elementDescription = '';
	this.elementCounterBottom = document.getElementById('elementCounterBottom' + galleryId);
	
	
	if(document.getElementById('prevLink' + galleryId)) {
		this.prevLink = document.getElementById('prevLink' + galleryId);
	} else {
		this.prevLink = false;
	}

	if(document.getElementById('nextLink' + galleryId)) {
		this.nextLink = document.getElementById('nextLink' + galleryId);
	} else {
		this.nextLink = false;
	}

	this.textDescription = document.getElementById('textDescription' + galleryId + this.selectedIndex);
}

CbTextGallery.prototype.setObjectType = function(sObjType) {
	this.objectType = sObjType;
};

CbTextGallery.prototype.setElementDescription = function(sElementDescription) {
	this.elementDescription = sElementDescription;
};

CbTextGallery.prototype.changeContents = function() {
	this.counter ++;
	
	if(this.selectedIndex == 0) {
		this.previousIndex = this.elements.length - 1;
	} else {
		this.previousIndex = this.selectedIndex - 1;
	}
	
	if(this.selectedIndex == (this.elements.length - 1)) {
		this.nextIndex = 0;
	} else {
		this.nextIndex = this.selectedIndex + 1;
	}

	this.textDescription = document.getElementById('textDescription' + this.galleryId + this.oldIndex);
	if (this.textDescription!=null && this.textDescription!=undefined) {
		this.textDescription.style.display = 'none';
	}
	
	this.textDescription = document.getElementById('textDescription' + this.galleryId + this.selectedIndex);
	if (this.textDescription!=null && this.textDescription!=undefined) {
		this.textDescription.style.display = '';
	}

	this.elementCounterBottom.innerHTML = this.elementDescription + ' ' + (this.selectedIndex + 1) + ' von ' + this.elements.length;
	
	this.reloadIvwPixel();

};

CbTextGallery.prototype.nextElement = function() {
	this.oldIndex = this.selectedIndex;

	if(this.selectedIndex < (this.elements.length -1)) { 
		this.selectedIndex++;
	} else {
		this.selectedIndex = 0;
	}
	this.changeContents();
};

CbTextGallery.prototype.previousElement = function() {
	this.oldIndex = this.selectedIndex;

	if(this.selectedIndex == 0) { 
		this.selectedIndex = this.elements.length -1;
	} else {
		this.selectedIndex--;
	}
	this.changeContents();
};

CbTextGallery.prototype.reloadIvwPixel = function() {
	if(this.counter == 0) {
		if(document.referrer) {
			this.newRef = document.referrer;
		} else {
			this.newRef = document.URL;
		}
	} else {
		this.newRef = this.newUrl;
	}
	
	var ivwArray = IVW.split('-');
	var ivwCodeString = '';
	
	for(i = 0; i < ivwArray.length -1; i++) {
		if(i != 0) {
			ivwCodeString += '-';
		}
		ivwCodeString += ivwArray[i];
	}
	if(document.getElementById('ivwPixel') != null) {
		document.getElementById('ivwPixel').src = ivwCodeString + '-i?r=' + escape(this.newRef) + '&d=' + (Math.random() * 100000);
	}
	
	if(window.location.pathname.indexOf('?') == -1) {
		this.newUrl = window.location.pathname + '?bild=' + (this.selectedIndex + 1);
	} else {
		if(window.location.pathname.indexOf('bild=') == -1) {
			this.newUrl = window.location.pathname + '&bild=' + (this.selectedIndex + 1);
		} else {
			this.newUrl = window.location.pathname.replace(/bild=\d+/, 'bild=' + (this.selectedIndex + 1));
		}
	}
	
	if(typeof urchinTracker == "function") {
		urchinTracker(this.newUrl);
	}
		
	if(document.getElementById('rholive1') != null) {
		this.rholive = document.getElementById('rholive1');
		this.newSrc = this.rholive.src.replace(/url=[^;]+/, 'url=' + encodeURIComponent(this.newUrl));
		this.newSrc = this.rholive.src.replace(/r=[^;]+/, 'r=' + encodeURIComponent(this.newRef));
		this.newSrc = this.rholive.src.replace(/random=[^;]+/, 'random=' + Math.random());
		this.rholive.src = this.newSrc;
	}
};



function toggle_filter(elementId, myDuration) {
	if (elementId && !inProgress) {
		inProgress = true;
		if (myDuration == undefined)
			myDuration = 0.5;
		if ($(elementId).style.display == 'none')  {
			Effect.BlindDown(elementId, {duration: myDuration, afterFinish:function(){
				inProgress = false;
				},
				beforeStart:function() {
					$(elementId+'_link').removeClassName('closed');				
				}
			});
		}
		else {
			Effect.BlindUp(elementId, {duration: myDuration, afterFinish:function(){
				$(elementId+'_link').addClassName('closed');
				inProgress = false;
				}
			});

		}
	}
	return false;
}


function performSearch(field, text, scope){
	if(field.value == '' || field.value == text){
	    var searchWords;
		if(scope == 'downloadca'){
			searchWords = new Array(
				'Kaspersky', 'Avira', 'Antivirus','Mp3','Dvd','spiele'
			);
		}else{
			searchWords = new Array(
				'Datensicherheit','Datenrettung','Laptops','Notebooks','DSL Tarife','DSL','Drucker','Druckerpatronen','Domain','Computer'
			);
		}
		var rnd =	parseInt( Math.random() * ( searchWords.length));
		field.value = searchWords[rnd];
	}
	return true;
}

function toggle_box_community(id) {
		if ($(id).className == 'close') {
			$(id+'_content').addClassName('active');
			$(id).removeClassName('close');
		} else {
			$(id+'_content').removeClassName('active');
			$(id).addClassName('close');
		}
}

function community_report_post(id){
	$('forum_post_report_view').show();
	document.forms['forum_post_report'].elements['forum_report_text'].value = '';
	document.forms['forum_post_report'].elements['postid'].value = id;
	window.location.href = '#reportForumPost';
}

function ir_change_tab(basisName, id, maxId) {
	var i;
	for (i = 0; i <= maxId; i++) {
		if (i == id) {
			$(basisName + '_' + i).style.display = 'block';
			$(basisName + '_w_' + i).addClassName('current');
		} else {
			$(basisName + '_' + i).style.display = 'none';
			$(basisName + '_w_' + i).removeClassName('current');
		}
	}
}

function CbCopyright(link, targetElementId){
	this.targetElement = document.getElementById(targetElementId); 
	//&copy; = 169   &nbsp; = 160
	this.seperator = String.fromCharCode(169) + String.fromCharCode(160);
	this.overlay = null;
	this.overlayMain = null;
	this.copyMain = null;
	this.link = link;	
	this.init();
}	

CbCopyright.prototype = {
	init: function()
	{
		var curInstance = this;
		this.link.onclick = function(){
			curInstance.toggle();
		}
	},
	show: function()
	{
		this.render();
		this.targetElement.style.display = 'block';
	},
	hide: function()
	{
		this.targetElement.style.display = 'none';
	},
	toggle: function()
	{
		if(this.targetElement.style.display == 'none'){
			this.show();
		}else{
			this.hide();
		}
	},
	_createElement: function(type, attributes, appendTo){
		var e = document.createElement(type);
		
		for(var key in attributes){
			var attrib = document.createAttribute(key);
			attrib.nodeValue = attributes[key];
			e.setAttributeNode(attrib);
		}
		
		if(appendTo !== undefined && appendTo !== null){
			appendTo.appendChild(e);
		}
		return e;
	},
	_createStructure: function(){
		
		if(this.overlayMain != null){
			this.targetElement.removeChild(this.overlayMain);
			this.targetElement.removeChild(this.copyMain);
		}
		this.overlayMain = this._createElement('DIV', {id: 'overlayMain'}, this.targetElement);
		this.copyMain = this._createElement('DIV', {id: 'copyMain'}, this.targetElement);
		var copyrightList = this._createElement('DIV', {'class': 'copyrightList'}, this.copyMain);
		var title = this._createElement('H1', {'class': 'title'}, copyrightList);
		var textNode = document.createTextNode('Bildnachweise');
		title.appendChild(textNode);
		this.overlay = this._createElement('DIV', {'class': 'content'}, copyrightList);
		var closeButton = this._createElement('DIV', {'class': 'buttonBlock clearfix'}, copyrightList);
		var aclose = this._createElement('A', {'class': 'close', title: 'Fenster schließen', href:'javascript:void(0);'}, closeButton);
		var instance = this;
		aclose.onclick = function(e){
			instance.hide();
			if(e && e.stopPropagation){
			   e.stopPropagation();
			}else{
			  if(!e){
			    e = window.event;
			  }
			   e.cancelBubble = true;
		   }
		}
	},
	render: function()
	{
		
		this._createStructure();
	
		var images = document.getElementsByTagName('img');
		
		var cplen = this.seperator.length;
		var found = 0;
		var iLen = images.length;
		var knownSources = {};
		for(var i = 0; i < iLen; i++){
			if(images[i].width < 16 || images[i].height < 16){
				continue;
			}
			var alt = '';
			alt = images[i].alt;
			if(alt == '' || alt == undefined){
				continue;
			}
			var pos = alt.lastIndexOf(this.seperator);
			if(pos < 0){
				continue;
			}
			
			if(knownSources[images[i].src] != undefined && knownSources[images[i].src] === true){
				continue;
			}
			
			var copyrightText = alt.substr(pos + cplen);
      if(copyrightText.replace(/^\s+/,"") == ''){
			  continue;
			}

			found++;
			knownSources[images[i].src] = true;

			var div = this._createElement('DIV', {'class': 'box clearfix'});
			var picBlock = this._createElement('DIV', {'class': 'pictureBlock'}, div);
      
      imageNode = new Image();
      imageNode.title = images[i].title;
      imageNode.alt = images[i].alt;
      imageNode.src = images[i].src;
      if(imageNode.width > 146) {
        imageNode.width = 146;
      }else if(imageNode.height > 146){
        imageNode.height = 146;
      }
      
			this._createElement('a', {rel: 'nofollow', href: 'javascript:void(0);'}, picBlock).appendChild(imageNode);
			var txtBlock = this._createElement('DIV', {'class': 'textBlock'}, div);
			var p = this._createElement('P', {'class': 'txt'}, txtBlock);
			p.appendChild(document.createTextNode(copyrightText));
			this.overlay.appendChild(div);

		}
		if(found == 0){
      var textBlock = this._createElement('DIV', {'class': 'textBlock'});
		  var p = this._createElement('P', {'class': 'txt'}, textBlock);
		  p.appendChild(document.createTextNode('Für diese Seite sind keine Bildnachweise oder Copyright-Zeilen abrufbar.'));
		  this.overlay.appendChild(textBlock);
		}
	}

}
