
//var ppwait = '<div id="loaderPop"><div id="loaderlogo"></div><div id="loaderimg"><b>Connexion...</b></div></div>';
//var ffwait = '<div id="loaderPop"><div id="loadermsg"></div><div id="loaderimg"></div></div>';

var advCount=0;
function showAdvContact(){
    if (advCount == 0){
       showAlertBox(msgContact);
    }
    advCount++;
}

function showWaitMsg(div) {
	document.getElementById('hiddendiv').innerHTML = div;
	SqueezeBox.open( $('loaderPop'), {
		handler: 'adopt',
		size: {x: 400, y: 100},
		closable: true,
		closeBtn: null,
		classOverlay: 'pp',
		shadow: true,
		classWindow: 'pp'
	});
	//timeoutSqbox = setTimeout( 'SqueezeBox.close()', 2000 );
}


function showAlertBox(div) {
	document.getElementById('hiddendiv').innerHTML = div;
	SqueezeBox.open( $('loaderPop'), {
		handler: 'adopt',
		size: {x: 400, y: 100},
		closable: true,
		closeBtn: true,
		classOverlay: 'msg',
		shadow: true,
		classWindow: 'msg'
	});
	//timeoutSqbox = setTimeout( 'SqueezeBox.close()', 2000 );
}



function showBoxDiv(div) {
	SqueezeBox.open( $(div), {
		handler: 'adopt',
		size: {x: 420, y: 220}
	});
}





function getcolor(){
	var newcolor = getActiveStyleSheet();
	if (newcolor == "bleu_jour"){

	}
}


function hideflash(){
	if (document.getElementById('flashgal') != undefined) {
		document.getElementById('flashgal').style.display = "none";
	}
}

function showloader(){
	if (document.getElementById('page-loaderbar') != undefined) {
                document.getElementById('page-loaderbar').style.display = "block";
        }
}



// Equivalent PHP
function urldecode(str) {
    var histogram = {};
    var ret = str.toString();
    var replacer = function(searche, remplace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(searche);
        return tmp_arr.join(remplace);
    };
    histogram["'"]   = '%27';
    histogram['(']   = '%28';
    histogram[')']   = '%29';
    histogram['*']   = '%2A';
    histogram['~']   = '%7E';
    histogram['!']   = '%21';
    histogram['%20'] = '+';
    for (remplace in histogram) {
        searche = histogram[remplace];
        ret = replacer(searche, remplace, ret);
    }
    ret = decodeURIComponent(ret);
    return ret;
}


function popopen(url,name,w,h){popwindow=window.open(url,'', 'width='+w+', height='+h+', toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, top=0, left=0');if(window.focus){popwindow.focus()}}


function shadowpop(url,entitle,wi,he,frame){
                titre = urldecode(entitle);
		Shadowbox.init(options);
		Shadowbox.open({
		player:     'iframe',
	    	title:      titre,
	    	content:    url,
        	width:      wi,
        	height:     he
 	    });
	    if (document.getElementById(frame) != undefined) {
		document.getElementById(frame).style.visibility="hidden";
            }

}

function modalpop(url, entitle, wi, he, frame){
     if ((wi == 0) || (he == 0)) {
	   wi = window.getSize().scrollSize.x-240;
	   he = window.getSize().size.y-160;
	}
	SqueezeBox.open(url, {
		handler: 'iframe',
		size: {x: wi, y: he}
	});
}

// virtuemart
function goto_shop(){
	setTimeout('Shadowbox.close();', 2000);
	document.location = 'http://'+location.hostname+'/index.php?page=shop.browse&category_id=7&option=com_virtuemart&Itemid=100007';
}




// detection CLIC DROIT
// ajouter document.onmousedown = droite; // dans le skin sb
function droite(e){
		var myfrcd = window.frames['galcd'];
		if (myfrcd) {
			myfrcd.ckdroit();
		}

		var myfrkc = window.frames['galkc'];
		if (myfrkc) {
			myfrkc.ckdroitkc();
		}

	return true;
}


