﻿var dejafermer=false;
function IntervalleInterstitiel()
{
	refermerDiv('Publicite');
	dejafermer=true;
}

function IntervalleFin()
{
	fermerBox();
	//if(dejafermer==false)
	//{
		//refermerDiv('Publicite');
		//dejafermer=true;
	//}
}

function IntervalleDecalage()
{
	//TempIntervalle=TempIntervalle*1000
	dejafermer=false;
	ouvrir('Publicite');
	//document.getElementById('Publicite').style.visibility='visible';
	setTimeout('IntervalleFin()',TempIntervallejs);
}
function IntervalleOuvrir()
{
	//TempIntervalle=TempIntervalle*1000
	document.getElementById('PubInterstitiel').src="images/blank.gif";
	ouvrir('Publicite');
}

function doItflash(numdepartement,nomdepartement)
{
	
	document.formpageprinc.cp.value=numdepartement;
	document.formpageprinc.search.value=numdepartement+" - "+nomdepartement;
	document.formpageprinc.ChoixCommuneOK.value=1;
	//document.formpageprinc.search.style.color="blue";
	document.formpageprinc.search.className="activeInput";
	//alert(document.formpageprinc.search.className);
}

function fermerBox()
{
	$.fn.colorbox.close();
}

function ouvrirBox(LienInter,imgSrc,TypeInter,WidthInter,HeightInter,TargetInter)
{
	tailledivw=eval(WidthInter)+10;
	tailledivh=eval(HeightInter)+135;
	Affichage='<div style="position:relative;z-index:1;width:'+tailledivw+'px;height:'+tailledivh+'px;">';
	if(TypeInter=="swf")
	{
		if(LienInter!='')
		{
			Affichage+='<DIV style="padding:0px;margin :0px;margin-left: 0;margin-right:0;display:block; position:absolute;left:0px;top:0px;width:'+WidthInter+'px;height:'+HeightInter+'px;z-index:2" onmouseover="style.cursor=\'pointer\'" onclick="document.location.href=\''+LienInter+'\'">';
			Affichage+='<table style="padding:0px;margin :0px;margin-left: 0;margin-right:0;display:block; position:absolute;left:0px;top:0px;width:'+WidthInter+'px;height:'+HeightInter+'px;z-index:2;" cellpadding="0" cellspacing="0">';
			Affichage+='<tr>';
			Affichage+='<td onmouseover="style.cursor=\'pointer\'" onclick="document.location.href=\''+LienInter+'\'">&nbsp;</td>';
			Affichage+='</tr>';
			Affichage+='</table>';
			Affichage+='</DIV>';
			//Affichage+='<a href="'+LienInter+'" '+TargetInter+'>';
			
		}   
		
		Affichage+='<div style="z-index:1; display: block;"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="'+WidthInter+'" HEIGHT="'+HeightInter+'" style="z-index:1;">';
		Affichage+='<PARAM NAME="movie" VALUE="'+imgSrc+'">';
		Affichage+='<PARAM NAME="quality" VALUE="high">';
		Affichage+='<param name="wmode" value="Transparent">';
		Affichage+='<EMBED wmode="Transparent" src="'+imgSrc+'" quality=high bgcolor=#FFFFFF TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" WIDTH="'+WidthInter+'" HEIGHT="'+HeightInter+'"></EMBED>';
		Affichage+='</OBJECT></div>';
		if(LienInter!='')
		{
			
			//Affichage+='</a>';
		}  
	}
	else
	{
		if(LienInter!='')
		{
			Affichage+='<a href="'+LienInter+'" '+TargetInter+'>';
		}   
		
		Affichage+='<img src="'+imgSrc+'" border=""0"" />';
		
		if(LienInter!='')
		{
			Affichage+='</a>';
		}  
	}
	Affichage+='<div style="height:20px;" align="center"><a href="#" onclick="$.fn.colorbox.close()" style="color:white;font-weight:bold;">Accéder directement à Webimm</a></div></div>';
	//alert(Affichage);
	$.fn.colorbox({html:Affichage, open:true, preloading:true, width:tailledivw+"px", height:tailledivh+"px", scrolling:false, opacity:"0.60"});
	if(dejafermer==false)
	{
		dejafermer=true;
		setTimeout('IntervalleFin()',TempIntervallejs);
	}
}

