document.write("<scr" + "ipt src='http://services.scanscout.com/optout.php?action_id=6&rd=http://cdn.tremormedia.com/ca/us/optout/optedout.js&rd2=http://cdn.tremormedia.com/ca/us/optout/active.js&rd3=http://cdn.tremormedia.com/ca/us/optout/notactive.js'></scr" + "ipt>");

function optout() {
	/*var iframe = document.createElement('iframe');
	iframe.style.width = '1px';
	iframe.style.height = '1px';
	iframe.style.display = 'none';
	iframe.style.visibility = 'hidden';
	iframe.src = 'http://adserver.adtech.de/setoptoutcookie/?page=http://glb.adtechus.com/setoptoutcookie/?page=http://adserverwc.adtechus.com/setoptoutcookie/?page=http://adserverec.adtechus.com/setoptoutcookie/?page=http://ad.us-ec.adtechus.com/setoptoutcookie/?page=http://www.adtechus.com/cookieoptout-success/';
	document.body.appendChild(iframe);*/

	var iframe2 = document.createElement('iframe');
	iframe2.style.width = '1px';
	iframe2.style.height = '1px';
	iframe2.style.display = 'none';
	iframe2.style.visibility = 'hidden';
	iframe2.src = 'http://dc.tremormedia.com/optout.html';
	document.body.appendChild(iframe2);

	var divRef = document.getElementById("optOut");
	if(divRef){
		divRef.parentNode.removeChild(divRef);
	}
	divRef = document.createElement("DIV");
	divRef.id = "optOut";
	
	/*var imgRef = document.createElement("IMG");
	imgRef.height = 1;
	imgRef.width = 1;
	imgRef.border = 0;
	imgRef.src = "http://app.scanscout.com/ssframework/dt/userOpt.png?a=out";
	var objRef = document.createElement("EMBED");
	objRef.height = 1;
	objRef.width = 1;
	objRef.border = 0;
	objRef.src = "http://media.scanscout.com/ads/PrivacyMode.swf?userTracking=optOut";
	document.body.appendChild(divRef);
	divRef.appendChild(imgRef);
	divRef.appendChild(objRef);*/
	
	var ssI = document.createElement("IMG");
	ssI.height = 1;
	ssI.width = 1;
	ssI.border = 0;
	ssI.src = "http://services.scanscout.com/optout.php?action_id=3&rd=http%3A//services.scanscout.com/optout.php%3Faction_id=4%26token=ASDF%26rd=http%253A//cdn.tremormedia.com/adtech/1x1.gif%253F";
	divRef.appendChild(ssI);
	
	var tmI = document.createElement("IMG");
	tmI.height = 1;
	tmI.width = 1;
	tmI.border = 0;
	tmI.src = "http://dc.tremormedia.com/optout.gif?action_id=3&rd=http%3A//dc.tremormedia.com/optout.gif%3Faction_id%3D4%26token%3DASDF%26rd%3Dhttp%253A//cdn.tremormedia.com/adtech/1x1.gif%253F";
	divRef.appendChild(tmI);
	
	if (document.location.href.indexOf("de.tremorvideo.com") > 0)
		alert("Sie haben den Opt-Out Button betätigt und somit den Tremor Video Cookie für personalisierte Werbung erfolgreich gelöscht");
	else
		alert("You have now opted out of Tremor Video advertising cookies");
	
	
	setTimeout("delayedOptout();", 1000);
	
    if (document.getElementById("opt_out_message")) {
    	if (document.location.href.indexOf("de.tremorvideo.com") > 0)
    		document.getElementById("opt_out_message").innerHTML = '<h1 style="background-color:#00abbd; color:#FFF; display:block; font-size:1.25em; text-transform:uppercase; padding:10px 5px 10px 5px; text-align:center; width:208px;margin-top:15px; margin-bottom:0;border:none;">OPT OUT STATUS</h1><p style="background-color:#e5f6f8; width:199px;padding:10px;margin-top:0;margin-bottom:15px;">Sie haben den Opt-Out Button betätigt und somit den Tremor Video Cookie für personalisierte Werbung erfolgreich gelöscht.</p>';
	    else
    		document.getElementById("opt_out_message").innerHTML = '<h1 style="background-color:#00abbd; color:#FFF; display:block; font-size:1.25em; text-transform:uppercase; padding:10px 5px 10px 5px; text-align:center; width:208px;margin-top:15px; margin-bottom:0;border:none;">OPT OUT STATUS</h1><p style="background-color:#e5f6f8; width:199px;padding:10px;margin-top:0;margin-bottom:15px;">You have opted out of the interest-based advertising cookie from Tremor Video.</p>';
	} else if (document.getElementById("opt_out")) {
    	document.getElementById("opt_out").children[0].value = "YOU ARE NOW OPTED OUT";
    }
	return false;
}
function delayedOptout() {
	var divRef = document.getElementById("optOut");
	if (divRef) {
		var ssI = document.createElement("IMG");
		ssI.height = 1;
		ssI.width = 1;
		ssI.border = 0;
		ssI.src = "http://services.scanscout.com/optout.php?action_id=3&rd=http%3A//services.scanscout.com/optout.php%3Faction_id=4%26token=ASDF%26rd=http%253A//cdn.tremormedia.com/adtech/1x1.gif%253F";
		divRef.appendChild(ssI);
	}
}

