/*------------------------------------------------------------------------------------
 * Fonctions générales
 * Rev. 04.04.07 [oni]
 *----------------------------------------------------------------------------------*/
//--Start : Ajout d'élément html en JS----------------------------------------------------------------
window.onload = function(){
	/*add_ombre(getObjet('contourcont'));
	add_ombre(getObjet('linksbas'));
	add_ombre(getObjet('quicklinks'));
	add_ombre(getObjet('budgetmoyen'));
	add_ombre(getObjet('sous_avantage'));*/
};
function add_ombre(objet){
	/*d1a=document.createElement('div')
	d1a.className = "ombre"
	if( objet.style.width != "" ) {
		d1a.style.width = (parseInt(objet.style.width)+2)+ "px";
	}
	objet.parentNode.insertBefore(d1a,objet.nextSibling)*/
}
//--End :   Chargement----------------------------------------------------------------
function pubtv(lang)
{
	window.open('http://www.maxipress.be/_tmp/videospub/immopub.asp?lang=' + lang,'Video','toolbar=0,location=0,status=1,scrollbars=1,resizable=1,personalbar=0,menubar=1,directories=0,top=245,left=675, width=300,height=270;');
}

function _log(txt){
	//isFirefox	= (navigator.userAgent.indexOf("Firefox")!=-1) ? true : false;
	if(window.console) {
		window.console.log(txt);
	}/*else{
		alert(txt);
	}*/
}
function getObjet(objet){
	isIE = (document.all);
	isNN6 = (!isIE) && (document.getElementById);
	
	if (isIE) objet = document.all[objet];
	if (isNN6) objet = document.getElementById(objet);
  
	return objet  
}

//--fonction d'ouverture des pop ups---------------------
function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}


//--Start: fonction test pour les entiers---------------------------------------------
function isInt(x) {
	var y=parseInt(x); 
    if (isNaN(y)) return false;
 	return x==y && x.toString()==y.toString(); 
}
//--End:   fonction test pour les entiers---------------------------------------------

/*--Start : Test si 'find' est dans un tableay----------------------------------------
 * Utilisation:
 * Array.isIn([tableau], 'valeur a chercher');
 *----------------------------------------------------------------------------------*/
Array.isIn = function(tab, find){
	_temp_	= "|" + tab.join("|") + "|"
	if( _temp_.indexOf("|" + find + "|") >= 0 ){
		return true
	}else{
		return false
	}
}
//--End :   Test si 'find' est dans un tableay----------------------------------------

/*--Start : Retourne l'endrois ou se trouve la valeur recherchée dans un tableau------
* Utilisation:
* Array.find([tableau], 'valeur a chercher');
*----------------------------------------------------------------------------------*/
Array.find = function(tab, find){
	for(var i=0; i<tab.length; i++){
		if(tab[i] == find){
			return i;
		}
	}
	return -1;
}
//--End :   Retourne l'endrois ou se trouve la valeur recherchée dans un tableau------

/*------------------------------------------------------------------------------------
					Fonction de menu deroulant pour les vidéos
------------------------------------------------------------------------------------*/
function menuderoulant(type) {
	div = document.getElementById("sous_video");
	lien = document.getElementById("id_video");
	gauche = lien.offsetLeft;
	gauche = gauche + 10
	div.style.left = gauche + "px";
	if (type == 0) 
	{
		div.style.visibility = "visible";
		div.style.position = "absolute";
	}
	else
	{
		div.style.visibility = "hidden";
	}
}
function erreur(){
	document.getElementById("photocache").style.visibility = "visible";
}
function videoagence(adresse) {
	div = document.getElementById("videoagence");
	try
   	{
		codeflash = '<embed type="application/x-shockwave-flash" src="flvplayer.swf" style="" id="single" name="single" quality="high" allowfullscreen="true" flashvars="file=http://videos.maxipress.be/videostran/agence/' + adresse + '&amp;&amp;width=300&amp;height=245&amp;bufferlength=0&amp;autostart=true" height="245" width="300">'
		var noeud_texte = document.createTextNode(""); 
		div.replaceChild(noeud_texte, div.firstChild);
		html = "";
		html = codeflash;
		div.innerHTML = html;
    }
    catch(ex)
    {
    }

}


