/**
 * CXO_AdFunctions
 * 
 * Diese Datei stellt JavaScript Funktion
 * fuer die Werbesteuerung bereit.
 * 
 * @author apirsig
 * @since  060302
 * @changelog  060724 + Zusaetzlichen Abstand beim aufschieben des Xonio Content-Ads
 *                    + auf der Xonio Homepage (api)
 *             060302 + cxo_adfunctions.js in Werbesteuerung implementiert (api)
 *                    + Shuffle AdFunktion fuer Xonio eingebaut (api)
 */

code = '';
now = new Date();
nIndex = now.getTime();

function bannerReplace(containerId,dummyId) {
	
	var container = top.document.getElementById(containerId);
	var dummy = top.document.getElementById(dummyId);
	
	if (container && dummy) {
	try {
	top.document.getElementById(containerId).style.width = '';
	top.document.getElementById(containerId).style.height = '';
	top.document.getElementById(containerId).style.position = 'absolute';
	top.document.getElementById(containerId).style.left = '-2000px';
	top.document.getElementById(containerId).style.display = 'block';
	top.document.getElementById(containerId).style.visibility = 'visible';
	
	var ht = top.document.getElementById(containerId).offsetHeight;
	var wt = top.document.getElementById(containerId).offsetWidth;
	// var ot = top.document.getElementById(dummyId).style.width + 'px';
	
	top.document.getElementById(dummyId).style.width = wt + 'px';
	top.document.getElementById(dummyId).style.height = ht + 'px';

	top.document.getElementById(containerId).style.top =  getAnchorPosition(dummyId).y + 'px';
	top.document.getElementById(containerId).style.left = getAnchorPosition(dummyId).x + 'px';
	}
	catch(e) {
		
	}
	}
}

function bannerReplace2(containerId,dummyId) {
	
	
	
	if ($gid(dummyId) &&  $gid(containerId)) {
		try {
		var ht = document.getElementById(containerId).offsetHeight;
		var wt = document.getElementById(containerId).offsetWidth;
		var ot = document.getElementById(dummyId).style.width;
		
		$gid(dummyId).style.width = wt + 'px';
		$gid(dummyId).style.height = ht + 'px';
		
		if ($gid(dummyId).style.position.toLowerCase != 'absolute' && $gid(dummyId).style.position.toLowerCase != 'fixed' )  {
			$gid(containerId).style.position = 'relative';
			$gid(containerId).style.top = '0px';
			$gid(containerId).style.left = '0px';
		} else {
			
			// $gid(containerId).style.position = 'absolute';
			$gid(containerId).style.top = getAnchorPosition(dummyId).y + 'px';
			$gid(containerId).style.left = getAnchorPosition(dummyId).x + 'px';
		}
		
		$gid(dummyId).appendChild($gid(containerId));
		}
		catch(e) {
			setTimeout('eval("bannerReplace2(containerId,dummyId);");',100);
		}
	
	} else if ($gid(dummyId) && !$gid(containerId)) {
		// pausecomp(1000);
		// eval("bannerReplace2(containerId,dummyId);")
	}

}


