if(window.parent.length!=0) {window.top.location.replace(document.location.href);}

function cob() {for (i = 1; i <= 117; i++) {if ($('#pub_contextuelle'+i).val() != undefined) {interstitiel($('#pub_contextuelle'+i).val());i = 117;}}}

function interstitiel(url) {
$("#avant").insertBefore("#questions");
$("#apres").insertAfter("#questions");
var largeur_divs = $("#questions").width();

if( typeof( window.innerWidth ) == 'number' ) {myWidth = window.innerWidth;
myHeight = window.innerHeight;
var larg_dispo = (myWidth - largeur_divs);
larg_dispo = parseInt((larg_dispo - 2 - 18) / 2);}
else if( document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
var larg_dispo = (myWidth - largeur_divs);
larg_dispo = parseInt((larg_dispo - 2) / 2);}
else if(document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
var larg_dispo = (myWidth - largeur_divs);
larg_dispo = parseInt((larg_dispo - 2 - 2) / 2);}

var haut_dispo = parseInt(myHeight * 3);

if (larg_dispo < 0) {larg_dispo = 0;var css ='';}
else if (larg_dispo < 50) {larg_dispo = 50;var css ='<style type="text/css">body {width:1254px;}</style>';}
else {var css ='';}

if (larg_dispo > 50) {
if ($("body").css("background-repeat") =="repeat") {
if (url.indexOf("expert-comptable-en-ligne.fr")!=-1) {
txt_de_la_pub = "VOTRE expert comptable en ligne, cabinet d expertise comptable, comptabilité sur internet et CONSEILS... Devis Gratuit...";
css = css +  '<style type="text/css">body {background-image:url(http://www.expert-comptable-en-ligne.fr/comptabilite-en-ligne/i/fd-votre.png);background-repeat:no-repeat;background-color:white;background-position:top center;background-attachment: fixed;}</style>';}
else if (url.indexOf("expert-comptable-en-ligne.com")!=-1) {
txt_de_la_pub = "VOTRE expert comptable en ligne, cabinet d expertise comptable pour les BNC / Agent commerciaux... Devis Gratuit";
css = css +  '<style type="text/css">body {background-image:url(http://www.expert-comptable-en-ligne.com/comptabilite-en-ligne/i/fd-votre-bnc.png);background-repeat:no-repeat;background-color:white;background-position:top center;background-attachment: fixed;}</style>';}
else if (url.indexOf("comptable-en-ligne.fr")!=-1) {txt_de_la_pub = "MON Comptable en ligne, cabinet d expertise comptable, comptabilité sur internet et CONSEILS... Devis gratuit...";
if (Math.random() <= 0.5) {css = css +  '<style type="text/css">body {background-image:url(http://www.comptable-en-ligne.fr/comptabilite-en-ligne/i/fd-monbis.png);background-repeat:no-repeat;background-color:white;background-position:top center;background-attachment: fixed;}</style>';}
else {css = css +  '<style type="text/css">body {background-image:url(http://www.comptable-en-ligne.fr/comptabilite-en-ligne/i/fd-monbis.png);background-repeat:no-repeat;background-color:white;background-position:top center;background-attachment: fixed;}</style>';}}
else if (url.indexOf("compta247.fr")!=-1) {txt_de_la_pub = "Compta 247, logiciel de comptabilité en ligne 100% gratuit, 100% technologique...";
css = css +  '<style type="text/css">body {background-image:url(http://www.compta247.fr/g/fd-c247.jpg);background-repeat:no-repeat;background-color:white;background-position:top center;background-attachment: fixed;}</style>';}}


document.getElementById('avant').innerHTML = css +"<a href='"+url+"?in="+i+"' title='"+txt_de_la_pub+"'><img src='http://"+ location.host +"/img/blank.gif' width='"+ larg_dispo +"' height='"+ haut_dispo +"' alt='"+txt_de_la_pub+"'></a>";
document.getElementById('apres').innerHTML = "<a href='"+url+"?in="+i+"' title='"+txt_de_la_pub+"'><img src='http://"+ location.host +"/img/blank.gif' width='"+ larg_dispo +"' height='"+ haut_dispo +"' alt='"+txt_de_la_pub+"'></a>";


}}

function ringbas(id_affich){$("#bas").children().each(function(){if($(this).attr("id") == id_affich) {$(this).fadeIn();}else if ($(this).attr("id") != "") {$(this).css("display","none");}})}

function go(url) {window.location.href=url;}

function goto_url(url)
{

  if (document.getElementById("plusvite").value == "je suis presse")
  {
    alertTimerId = setTimeout('go(\''+ url + '\')',20000);
  }
  else
  {
	document.getElementById("plusvite").value = "redirection immediate";
	go(url);
  }
}
