//variable pour l'effacement du texte dans le moteur de recherche
var erased_annuaire = false;

function message_annu_status(message)
//affiche un texte dans la barre de statut du navigateur
{ window.status = message; }

function affiche_pub()
{
	var width = Math.round(document.body.clientWidth/2);
	document.getElementById("pub_ban").style.left = width;
	document.getElementById("pub_ban").style.visibility = "visible";
}

function clk(id)
{
	(new Image()).src="goto.php?id="+id;
	return true;
}
function Display_Div(identifiant)
{
	var le_div = document.getElementById(identifiant);
	le_div.style.visibility = "visible";
	le_div.style.height = "auto";
	le_div.style.fontSize = "11px";
	le_div.style.lineHeight = "1em";
}

function Switch_All_Div(identifiant)
{
	var les_ident = identifiant.split(";");

	var le_div = document.getElementById(les_ident[0]);
	if (le_div.style.visibility == "hidden")
	{
		for (var i=0; i < les_ident.length; i++)
		{
			Display_Div(les_ident[i]);
		}
	}
	else
	{
		for (var i=0; i < les_ident.length; i++)
		{
			Hide_Div(les_ident[i]);
		}
	}
}

function Hide_Div(identifiant)
{
	var le_div = document.getElementById(identifiant);
	le_div.style.visibility = "hidden";
	le_div.style.height = "0px";
	le_div.style.fontSize = "1px";
	le_div.style.lineHeight = "0px";
}

function Switch_Div(identifiant)
{
	//L'identifiant peut être en réalité plusieurs identifiants
	var les_ident = identifiant.split(";");

	var le_div = document.getElementById(les_ident[0]);
	if (le_div.style.visibility == "hidden")
	{
		Display_Div(les_ident[0]);
	}
	else
	{
		for (var i=0; i < les_ident.length; i++)
		{
			Hide_Div(les_ident[i]);
		}
	}

}

function addToFavorites(anchor)
{
if (window.external)
{
window.external.AddFavorite(anchor.getAttribute('href'), anchor.getAttribute('title'));
}
}

function makevisible(cur,which)
{
if(document.getElementById)
    {
    if (which==0)
        {
        if(document.all)
            cur.filters.alpha.opacity=100
        else
            cur.style.setProperty("-moz-opacity", 1, "");
        }
    else
        {
        if(document.all)
            cur.filters.alpha.opacity=40
        else
            cur.style.setProperty("-moz-opacity", .4, "");
        }
    }
}


//début script CD

var ktuScrollDiff = 0;

function hideInnerktu()
{	
	document.getElementById("cb30popmedia").style.width 			= "1px";
	document.getElementById("cb30popmedia").style.height 			= "1px";
	document.getElementById("cb30popmedia").style.visibility 		= 'hidden';
	document.getElementById("cb30popmedia").style.top				= '-50px'; 
	document.getElementById("cb30popmedia").style.left				= '-30px';
	
	document.getElementById("cb30popmedia_iframe").src				='about:blank';
	document.getElementById("cb30popmedia_iframe").style.width 		= "1px";
	document.getElementById("cb30popmedia_iframe").style.height 	= "1px";
	document.getElementById("cb30popmedia_iframe").style.visibility = 'hidden';
	
	document.getElementById("cb30popmedia_innerdiv").style.width 	= "1px";	
	document.getElementById("cb30popmedia_innerdiv").style.height 	= "1px";
	document.getElementById("cb30popmedia_innerdiv").style.top		= '-50px'; 
	document.getElementById("cb30popmedia_innerdiv").style.left		= '-30px';	
}		

function dimension_detect()
{
	var d={'viewW':0,'viewH':0,'docH':0,'docW':0,'left':0,'top':0};
	if (document.body.scrollHeight>document.body.offsetHeight){
		d.docW=document.body.scrollWidth;
		d.docH=document.body.scrollHeight;
	} else {
		d.docW=document.body.offsetWidth;
		d.docH=document.body.offsetHeight;
	}
	if (self.innerWidth){
		d.viewW=self.innerWidth;
		d.viewH=self.innerHeight;
		d.left=window.pageXOffset;
		d.top=window.pageYOffset;
	} else {
		var ie=(document.compatMode&&document.compatMode!='BackCompat')?document.documentElement:document.body;
		d.viewW=ie.clientWidth;
		d.viewH=ie.clientHeight;
		d.left=ie.scrollLeft;
		d.top=ie.scrollTop;
	}
	return d;
}


document.write('<div id="cb30popmedia"  style="visibility:hidden; z-index:auto">');
document.write('	<div id="cb30popmedia_innerdiv" style="overflow: hidden; z-index:auto; position: absolute; border:0; top: 0; left: 0;">');
document.write('		<table cellpadding="0" cellspacing="0" style="border: 0; margin: 0; padding: 0; font-size: 0; height: 24px;">');
document.write('			<tr>');
document.write('				<td height="24"><img src="http://www.securitetotale.com/cb30popmedia/all/fr/titre_01.gif" height="24" width="177"></td>');
document.write('				<td height="24" id="cb30popmedia_title" style="background: url(http://www.securitetotale.com/cb30popmedia/all/fr/titre_bg.gif) repeat-x;"></td>');
document.write('				<td height="24"><img src="http://www.securitetotale.com/cb30popmedia/all/fr/titre_02.gif" width="119" height="24" onClick="hideInnerktu()"></td>');
document.write('			</tr>');
document.write('		</table>');
document.write('		<div id="ktucontent" style="margin: 0; padding: 0; font-size: 0;"><iframe id="cb30popmedia_iframe" frameborder="0" scrolling="no" style="width:665px;height:400px" allowtransparency="true" src="about:blank"></iframe></div>');
document.write('	</div>');
document.write('</div>');


function show_cb30popmedia()
{

		// A chaque affichage :
		document.getElementById("cb30popmedia").style.visibility 			= 'visible';	
		document.getElementById("cb30popmedia").style.top					= '50px'; 	
		document.getElementById("cb30popmedia").style.left					= '30px';	
	
		document.getElementById("cb30popmedia_innerdiv").style.margin		= 'auto';
		document.getElementById("cb30popmedia_innerdiv").style.width 		= Params_popmedia['width'] + "px";	
		document.getElementById("cb30popmedia_innerdiv").style.height 		= Params_popmedia['height'] + "px";	
	
		document.getElementById("cb30popmedia_iframe").src 					= Params_popmedia['src'];	
		document.getElementById("cb30popmedia_iframe").style.width 			= Params_popmedia['width']+"px";	
		document.getElementById("cb30popmedia_iframe").style.height 		= Params_popmedia['height']+"px";	
		document.getElementById("cb30popmedia_iframe").style.visibility 	= 'visible';

		document.getElementById("cb30popmedia_title").style.width 			= (Params_popmedia['width']-296)+"px";
		
		carpediem_add_load_event(mvSticker());
		window.onresize=function(){	carpediem_add_load_event(mvSticker()); };
}


function mvSticker() 
{
	var d 		= dimension_detect();
	var newTop 	= (d.viewH-Params_popmedia['height'])/2 ;
	var newLeft = (d.viewW-Params_popmedia['width'])/2;
	
	if (self.innerWidth)
	{
		var mytop = window.pageYOffset+newTop;
	} else {
		var ie=(document.compatMode&&document.compatMode!='BackCompat')?document.documentElement:document.body;
		var mytop = ie.scrollTop+newTop;
	}
	document.getElementById("cb30popmedia_innerdiv").style.top  = mytop +'px';
	document.getElementById("cb30popmedia_innerdiv").style.left = newLeft +'px';
	setTimeout("mvSticker()", 10);
}

var carpediem_add_load_event=function(func){
	var oldonload = window.onload;
	if (typeof(window.onload)!='function') window.onload=func;
	else { window.onload=function(){ oldonload(); func(); }; }
}

var Params_popmedia             = new Array();
Params_popmedia["src"] = "http://www.securitetotale.com/index.php?module=guest_cbsys_dhtml&id=13749&tracker=nuitorride&langue=fr&tpl=2";
Params_popmedia["width"] = 665;
Params_popmedia["height"] = 508;

//fin script CD