/* BodyDoc */

setSrc = "NV";

function showThisAdv(src) {

/*ctrl*///alert("showing this...");

	var anzH,anzW;

	if(top.advWinInit===true) {
		setSrc = "NV";
		anzWWW = "NV";
		top.setStop();
		for (i=0; i < imgs.length; i++) {
			imgSrc = imgs[i].src
			if (imgSrc.indexOf(src) > -1) {
				anzWWW = wwws[i];
				anzW = imgs[i].width +top.plus_width;
				anzH = imgs[i].height +top.plus_height;
				break;
			}
		}
		if(anzWWW == "") anzWWW = "NV";

		top.advBox.style.width = anzW;
		top.advBox.style.height = anzH;
		top.advPageUrl = anzWWW;
	   	top.advImage.src = src;


	} else {
		setSrc = src;
		top.initAdvWin();
		window.setTimeout("showThisAdv(setSrc)",100);
	}

}


var showAdvStep=0;

function showAdv() {
	
	if(top.advBox) top.advBox.className = "advBoxShow";
	if(top.txtBox) top.txtBox.className = "contentTextSmall";

	if(top.advWinInit===true) {

/*ctrl*///	alert("call loadAdv");
		loadAdv();
		showAdvStep = 0;

	} else if(showAdvStep<5) {

/*ctrl*///	alert("showAdv \nwin not ready");
		top.initAdvWin();
		showAdvStep++;
		setTimeout("showAdv()", 270);

	} else alert("showAdv(): Couldn't execute showAdv");


}




var anzSrc = null;
var fTime = null;
var anzW = null;
var anzH = null;
var anzWWW = "";
var currAdv = 0;


function loadAdv() {

	var fTime = 23;



/*ctrl*///	alert("LOADING");



	if (top.AdvStopped) {
		fTime = top.advWaitTime;

/*ctrl*///	alert("WAITING TO RELEASE ADV");


	} else {
		top.resetStop();
		if (top.advStopImgSrc.indexOf("img/anzeigen") == -1 ) {


/*ctrl*///	alert("FOUND NO ADV IN FLD");
/*ctrl*///	alert("imgs:\n" + imgs.length);
		
			fTime = top.advGoTime;
			anzSrc = imgs[currAdv].src;

/*ctrl*///	alert("anzSrc:\n" + anzSrc);

/*!important*/		anzW = imgs[currAdv].width +top.plus_width;
/*!important*/		anzH = imgs[currAdv].height +top.plus_height;
			anzWWW = wwws[currAdv];
			if (currAdv < imgs.length - 1) currAdv ++;
			else currAdv = 0;

		} else	{


/*ctrl*///	alert("FOUND ADV IN FLD " + top.advStopImgSrc);

			fTime = top.advStopTime;
			anzSrc = top.advStopImgSrc;
			for (i=0; i < imgs.length; i++) {
				if (anzSrc.indexOf(imgs[i].src) > -1 || imgs[i].src.indexOf(anzSrc) > -1) {
/*!important*/				anzW = imgs[i].width +top.plus_width;
/*!important*/				anzH = imgs[i].height +top.plus_height;
					anzWWW = wwws[i];
					break;
				}
			}

		}

		if(anzWWW == "") anzWWW = "NV";

/*WEBCode*/	top.actAdvUrl	= anzWWW+"?webId=actAdv";/* + SearchWebId(anzSrc);*/

/*ctrl*///	alert("top.actAdvUrl " + top.actAdvUrl);

		top.advBox.style.width = anzW;
		top.advBox.style.height = anzH;
		top.advPageUrl = anzWWW;

		top.advImage.src = anzSrc;
		top.advStopImgSrc = "NV";

	}

	if(imgs.length>1) window.setTimeout('loadAdv()', fTime);

}

function SearchWebId(anzSrc) {
	var webId = "none";

	for(var l=0; l < anzeigen_tab.length; l++) {

		if (anzeigen_tab[l][3].search(anzSrc > -1)) {
			webId = anzeigen_tab[l][5];
			break;
		}


	} // Anzeigesuche
	

	return webId;
	
}
