// JavaScript Document
// Mis ŕ jour : 16 mars 2010

var type_defil='normal';
//var type_defil='decale';
//var type_defil='aleatoire';
var banniere=new CreerBan('Publicité - cliquez ici');
banniere.Add("images/pubs/sky_cote_ivoire.gif","http://www.ccip.fr/international-entreprise/LA-COTE-D'IVOIRE-A-PARIS-65/num_actu-2074/type_flux-.htm","_blank","image","","");
banniere.Add("images/pubs/passer-le-relais.gif","http://www.passerlerelais.fr/","_blank","image","","");
banniere.Add("images/pubs/JPO_2010.gif","http://www.campus.ccip.fr/79-journee-portes-ouvertes-2010-dans-les-ecoles-de-la-ccip.html","_blank","image","","");
banniere.Add("images/pubs/sky-web-ata.gif","http://www.ccip.fr/international-entreprise/exportation-temporaire-35/rubrique-procedures.htm","_blank","image","","");
banniere.Add("images/pubs/fichier-entreprises-grand-paris-dec09.gif","http://www.fichier-entreprises.ccip.fr/grand-paris","_blank","image","","");
banniere.Add("images/pubs/Sky_commercant.gif","http://www.boutique.ccip.fr","_blank","image","","");

function CreerBan(infobulle)
	{
	this.nb=0; 
	this.no=0;
	this.alt=infobulle;
	this.title=infobulle;
	this.Add=AjoutBan;
	this.Init=InitBan;
	}

function AjoutBan(img,href,fenetrecible,typeFichier,largeur,hauteur)
	{
	var ban=new Object;
	ban.img=img;
	ban.href=href;
	ban.fenetrecible=fenetrecible;
	ban.typeFichier=typeFichier;
	ban.largeur=largeur;
	ban.hauteur=hauteur;
	this[this.nb]=ban;
	this.nb++;
	}

function InitBan()
	{
	if (document.images)
		{ 
		for(var i=0;i<this.nb;i++)
			{
			var gif=new precharger(this[i].img)
			}
		}
	if (type_defil=='normal')
		{
		prem=0;
		}
	if ((type_defil=='aleatoire')|(type_defil=='decale'))
		{
		prem=Math.round(Math.random()*(banniere.nb-1));
		}
	if(this[prem].typeFichier=='flash')
		{
		document.write("<div id=\"pubCCIP\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\""+this[prem].largeur+"\" height=\""+this[prem].hauteur+"\" id=\"bandeau_a\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"movie\" value=\""+this[prem].img+"\" /><param name=\"quality\" value=\"high\" /><embed src=\""+this[prem].img+"\" wmode=\"transparent\" quality=\"high\" bgcolor=\"#ffffff\" width=\""+this[prem].largeur+"\" height=\""+this[prem].hauteur+"\" name=\"bandeau_a\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object></div>");
		}
	else
		{
		document.write("<div id=\"pubCCIP\"><A href='javascript:lien()'><IMG border='0' name='img' src='" + this[prem].img + "' alt='" + this.alt + "' title='"+this.alt+"'><\/A></div>");
		}
	banniere.no=prem;
	setTimeout('rotation()','10000');
	}

function rotation()
	{
	if ((type_defil=='normal')|(type_defil=='decale'))
		{	
		banniere.no++; 
		var no=banniere.no; 
		if (no>=banniere.nb)
			{
			banniere.no=0; no=0
			}
		}
	if (type_defil=='aleatoire')
		{
		banniere.no=Math.round(Math.random()*(banniere.nb-1));
		var no=banniere.no;
		}
	
	//alert(banniere[no].img);
	
		//document.images["img"].src=banniere[no].img;
	if(banniere[no].typeFichier=="flash")
		{
		html="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\""+banniere[no].largeur+"\" height=\""+banniere[no].hauteur+"\" id=\"bandeau_a\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"movie\" value=\""+banniere[no].img+"\" /><param name=\"quality\" value=\"high\" /><embed src=\""+banniere[no].img+"\" wmode=\"transparent\" quality=\"high\" bgcolor=\"#ffffff\" width=\""+banniere[no].largeur+"\" height=\""+banniere[no].hauteur+"\" name=\"bandeau_a\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>"
		$("#pubCCIP").html(html);
		}
	else
		{
		html="<A href='"+banniere[no].img+"' target='"+banniere[no].fenetrecible+"'><IMG border='0' name='img' src='" + banniere[no].img + "'><\/A>";
		$("#pubCCIP").html(html);
		}
	
	setTimeout("rotation()",10000);
	}

function lien()
	{
	with(banniere[banniere.no])
		{
		if(fenetrecible=="_blank")
			{
			window.open(href,"")
			} 
		if(fenetrecible=="_top")
			{
			parent.window.location=href
			} 
		if(fenetrecible=="_self")
			{
			window.location=href
			} 
		}
	}

function precharger()
	{
	this.length = precharger.arguments.length;
	for (var i = 0; i < this.length; i++)
		{
		this[i+1] = new Image();
		this[i+1].src = precharger.arguments[i];
		}
	}

banniere.Init();
