var cogitae_popins = new Array();

function initPopin( popinid, config) {
    var popin = null;
    if (cogitae_popins[popinid]) {
        popin = cogitae_popins[popinid];
    } else {
        popin = new YAHOO.widget.Panel(popinid, {
            visible:false,
            modal: true,
            fixedcenter: true,
            underlay: "shadow",
            draggable: false
            }
        );

        cogitae_popins[popinid] = popin;

        if (config.height) {
            popin.cfg.setProperty( 'height', config.height + 'px' );
        }
        if (config.width) {
            popin.cfg.setProperty( 'width', config.width + 'px' );
        }

        popin.render(document.body);


        if (! config.noclosebutton) {
            popin.close.innerHTML = "Fermer";
        }
    }

    return popin;
}


function openPopin( popinid, config, popincontent) {
    var popin = initPopin( popinid, config );

    popin.setBody( popincontent );
    popin.show();
	var Dom = YAHOO.util.Dom;
 	var closeBtn = Dom.getElementsByClassName('container-close')[0];
 	closeBtn.blur();
}




function showAideEptica()
{
    openPopin( 'eptica', { 'width': 730 } ,'<iframe id="epticaiframe" src="http://thomascook.epticahosting.com/selfclubjumbo/template-group.do?id=87" marginheight="0" marginwidth="0" frameborder="0"></iframe>');
}

function showDailymotion(film)
{
	var innerhtml = "<object width='620' height='276'>";
	innerhtml += "<param name='movie' value='http://www.dailymotion.com/swf/video/"+film+"?width=560&theme=eggplant&foreground=%23CFCFCF&highlight=%23834596&background=%23000000'></param>";
	innerhtml += "<param name='allowFullScreen' value='true'></param>";
	innerhtml += "<param name='allowScriptAccess' value='always'></param>";
	innerhtml += "<param name='wmode' value='transparent'></param>";
	innerhtml += "<embed type='application/x-shockwave-flash' src='http://www.dailymotion.com/swf/video/"+film+"?width=560&theme=eggplant&foreground=%23CFCFCF&highlight=%23834596&background=%23000000' width='620' height='276' wmode='direct' allowfullscreen='true' allowscriptaccess='always'></embed>";
	innerhtml += "</object>";
	innerhtml  = "<iframe frameborder='0' width='640' height='270' src='http://www.dailymotion.com/embed/video/"+film+"'></iframe>";
	openPopin( 'dailymotion', { 'width': 640, 'fermerTexte': 'X'} ,innerhtml );
	return false;
}
