/* ---- Code By Astrubal - www.nawaat.org | astrubal.nawaat.org */
/* ---- This Code still under developpement May 2008 v.0.3------ */

var DivMediaList=document.getElementById("ListeSideBarHub");
var PostTitle="";
var HubPostcontainer=document.getElementById('videoHub');
var HubPostReq=false;
var I=unescape("%64%65%6d%6f%2e%64%61%69%6c%79%6d%6f%74%69%6f%6e%2e%63%6f%6d%2f");
var HubMediaRequest="";
var HubMessageAbout="Encore en version de développement, le contenu du Hub est agrégé automatiquement.\nHormis les documents propres à Nawaat, notre rédaction n'approuve ni ne désaprouve les contenus ainsi agrégés.\nDe même, si un contenu choquant y glisse, veuillez nous en excuser.\n";

var HubDefaultGoogleVid='571751592973113110';
var HubDefaultVidTitle='[Documentaire vidéo] Les beys de Tunis, une monarchie dans la tourmente coloniale';
var HubDefaultVidDesc="“D’Hussein 1er, le fondateur, à Lamine Bey “le monarque démocratique”, en passant par Ahmed Pacha, qui abolit l’esclavage en 1846, et surtout par Moncef Bey, le souverain nationaliste mort en déportation, le documentaire de Mahmoud Ben Mahmoud réécrit quelques-unes des pages prestigieuses de la dynastie des beys de Tunis, qui régnèrent sur le pays pendant deux siècles et demi.<br /> Le film retrace aussi les heures sombres de cette monarchie féodale, avec ses complots sanglants, ses injustices et sa corruption. La pire de ces heures vit l’entrée, en 1881, des troupes françaises en Tunisie. Le prince Fayçal Bey, arrière-petit-fils du dernier bey de Tunis, constitue le fil rouge du film. Celui-ci nous permet de revivre les derniers jours de la monarchie, dont l’histoire s’est achevée, il y a cinquante ans, par l’instauration de la République”";
var HubSideDefaultView="Nawaat";

var HubLoadingFromBlog='<br /> &nbsp;<br /><div style="color:#F6720C;font-size: 12px;font-style: italic;"><center>Loading data ...<br /> Please Be Patient...<br /> &nbsp; &nbsp;<br /><img src="/portail/NawaatVideoHub/images/loadingn.gif" width="32" /><br /> &nbsp;<br />Chargement en cours ...<br /> Merci pour votre patience...<\/center></div>';

var HubLoadingDefault='<br /> &nbsp;<br /><div style="color:#F6720C;font-size: 12px;font-style: italic;"><center> Loading data ...<br /> &nbsp;<br /><img src="/portail/NawaatVideoHub/images/loadingn.gif" width="32" /><\/center></div>';

function urldecode(str) {
    var chaine = str;
    chaine = chaine.replace(/\+/g, '%20');
    chaine = decodeURIComponent(chaine);
    chaine = chaine.toString();
    return chaine;
}

function OuvrirFermer(thediv){
//;
/*	clearInterval(LoopID);
	var acH=document.getElementById(thediv).offsetHeight;
	if(acH < 5)
	{
	//document.getElementById('buttons').innerHTML=document.getElementById('buttons').innerHTML.replace(/◀/g, "▼");
	OuvrirStaticDiv(thediv);
	
	}else{
	//document.getElementById('buttons').innerHTML=document.getElementById('buttons').innerHTML.replace(/▼/g, "◀");
	FermerDivKeepData(thediv);
	}
*/ 
		Localvv=thediv;
		if(document.getElementById(thediv).offsetHeight>5){
		
		if(HubReq){HubReq.abort();}
		if(HubPostReq){HubPostReq.abort();}
		
		DivMediaList=document.getElementById("ListeSideBarHub");
		document.getElementById('ListeSideBarHub').innerHTML='';
		document.getElementById('videoHub').innerHTML='<img src="/portail/NawaatVideoHub/images/NawaatMultimediaBig.jpg" width="500" height="450" />';

		setTimeout("FermerDivKeepData(Localvv)",300);
		}else{
			if (document.all  && !window.opera) { 
			document.getElementById(thediv).style.setAttribute('cssText',' height:0px; overflow:hidden;filter:alpha(opacity=0);-moz-opacity:0.0;opacity:0.0;');
			}else{
			document.getElementById(thediv).setAttribute('style',' height:0px; overflow:hidden;-moz-opacity:0.0;opacity:0.0;');
			}
			OuvrirStaticDiv(thediv);
		}


}



function GetMediaData(arg) {
var url="/portail/NawaatVideoHub/GetListMediadebug.php?list="+ arg;
var theDivID="ListeSideBarHub";
HubMediaRequest=arg;

if(HubMediaRequest =='blogtn'){
document.getElementById('ListeSideBarHub').innerHTML =HubLoadingFromBlog;
}else{
document.getElementById('ListeSideBarHub').innerHTML = HubLoadingDefault;
}

	HubReq = false;
	 if(window.XMLHttpRequest && !(window.ActiveXObject)) {
		try {
			HubReq = new XMLHttpRequest();
		  } catch(e) {
			HubReq = false;
		  }
	 } else if(window.ActiveXObject) {
			try {
			HubReq = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
			try {
				HubReq = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
					HubReq = false;
			}
		}
	 }
	if(HubReq) {
		HubReq.onreadystatechange = ProcessMediaResponse;
		HubReq.open("GET", url, true);
		HubReq.send("");
	}
	
}

function ProcessMediaResponse() {
/*
	0 = uninitialized
	1 = loading
	2 = loaded
	3 = interactive
	4 = complete
*/
DivMediaList=document.getElementById("ListeSideBarHub");

//document.getElementById('statusEnCours').innerHTML ="Etat: "+Req.readyState;
	// si chargement "loaded"
	if (HubReq.readyState == 4) {
		// si tout va bien
		if (HubReq.status == 200) {
			DivMediaList.innerHTML =HubReq.responseText;
			//stopLoading();
			}
		else {
		alert("Oupsss There was a problem retrieving data:\n" +"Error: "+ HubReq.status+"\nDesole, une erreur de connection est survenue..." );
		//DivMediaList.innerHTML = '<br /><div style="color:#FFF;font-size: 12px;font-style: italic;"><center><img src="/portail/NawaatVideoHub/images/error.jpg" alt="Oupsss There was a problem retrieving data - Desole, une erreur de connection est survenue..." width="313" height="388" /></center></div>'
		DivMediaList.innerHTML = '<br /><div style="color:#FFF;font-size: 13px;font-style: italic;"><center>Oupsss ... There was a problem retrieving data <br />Desole, une erreur de connection est survenue...</center></div>'
		}
	}else if(HubReq.readyState == 1){
		//DivMediaList.innerHTML = '<br /> &nbsp;<br /><div style="color:#F6720C;font-size: 12px;font-style: italic;"><center>Loading data ...<br /> &nbsp;<br /><img src="/portail/NawaatVideoHub/images/loadingn.gif" width="32" /><\/center></div>';
		
		if(HubMediaRequest =='blogtn'){
			DivMediaList.innerHTML =HubLoadingFromBlog;
		}else{
		DivMediaList.innerHTML = HubLoadingDefault;
		}
	
	}
}

/*-----------Req posts blogs ------------*/

function HubGetPostData(arg) {
var url="/portail/NawaatVideoHub/GetListMediadebug.php?list="+ arg;
HubPostcontainer=document.getElementById('videoHub');
HubPostcontainer.innerHTML = HubLoadingFromBlog;

	HubPostReq = false;
	 if(window.XMLHttpRequest && !(window.ActiveXObject)) {
		try {
			HubPostReq = new XMLHttpRequest();
		  } catch(e) {
			HubPostReq = false;
		  }
	 } else if(window.ActiveXObject) {
			try {
			HubPostReq = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
			try {
				HubPostReq = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
					HubPostReq = false;
			}
		}
	 }
	if(HubPostReq) {
		HubPostReq.onreadystatechange = HubProcessPostResponse;
		HubPostReq.open("GET", url, true);
		HubPostReq.send("");
	}
	
}

function HubProcessPostResponse() {
/*
	0 = uninitialized
	1 = loading
	2 = loaded
	3 = interactive
	4 = complete
*/
//DivMediaList=document.getElementById("ListeSideBarHub");

//document.getElementById('statusEnCours').innerHTML ="Etat: "+Req.readyState;
	// si chargement "loaded"
	if (HubPostReq.readyState == 4) {
		// si tout va bien
		if (HubPostReq.status == 200) {
			HubPostcontainer.innerHTML =HubPostReq.responseText;
			//stopLoading();
			}
		else {
		alert("Oupsss There was a problem retrieving data:\n" +"Error: "+ HubPostReq.status+"\nDesole, une erreur de connection est survenue..." );
		//DivMediaList.innerHTML = '<br /><div style="color:#FFF;font-size: 12px;font-style: italic;"><center><img src="/portail/NawaatVideoHub/images/error.jpg" alt="Oupsss There was a problem retrieving data - Desole, une erreur de connection est survenue..." width="313" height="388" /></center></div>'
		HubPostcontainer.innerHTML = '<br /><div style="color:#FFF;font-size: 13px;font-style: italic;"><center>Oupsss ... There was a problem retrieving data <br />Desole, une erreur de connection est survenue...</center></div>'
		}
	}else if(HubPostReq.readyState == 1){
	HubPostcontainer.innerHTML = HubLoadingFromBlog;
	}
}


/* ---------Fin post blog Req-------------*/

function HubInsertGogVid(file,title,decription){
	document.getElementById('videoHub').innerHTML ='<embed id="VideoPlayback" style="width:100%;height:450px;" flashvars="fs=true" wmode="transparent" allowfullscreen="true" src="http://video.google.com/googleplayer.swf?docid='+file+'&hl=en" type="application/x-shockwave-flash" bgcolor="#000000" />';
	document.getElementById('titleHub').innerHTML =urldecode(title);
	document.getElementById('descripHub').innerHTML ="<div>"+urldecode(decription.replace(/href%3D%26quot%3B/g, 'href="').replace(/%26quot%3B%26gt%3B/g, '">')).replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/\n/g, '<br />')+"</div>";
	document.getElementById('descripHub').scrollTop=0;
}

function HubInsertYtbe(file,title,decription){	
	document.getElementById('videoHub').innerHTML ='<object width="100%" height="450"><param name="movie" value="http://www.youtube.com/v/'+file+'&hl=fr"></param><param name="bgcolor" value="#000000"></param><embed src="http://www.youtube.com/v/'+file+'&hl=fr" type="application/x-shockwave-flash" bgcolor="#000000" width="100%" height="450"></embed></object>';
	document.getElementById('titleHub').innerHTML =urldecode(title);
	document.getElementById('descripHub').innerHTML ="<div>"+urldecode(decription.replace(/href%3D%26quot%3B/g, 'href="').replace(/%26quot%3B%26gt%3B/g, '">')).replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/\n/g, '<br />')+"</div>";
	document.getElementById('descripHub').scrollTop=0;
}

function HubInsertDmotion(file,title,decription){	
	document.getElementById('videoHub').innerHTML ='<object width="100%" height="450"><param name="movie" value="http://'+I+'swf/'+file+'&related=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="bgcolor" value="#000000"></param><embed src="http://'+I+'swf/'+file+'&related=1" type="application/x-shockwave-flash" width="100%" height="450" allowFullScreen="true" allowScriptAccess="always"  bgcolor="#000000"></embed></object>';
	
	document.getElementById('titleHub').innerHTML =urldecode(title);
	document.getElementById('descripHub').innerHTML ="<div>"+urldecode(decription.replace(/href%3D%26quot%3B/g, 'href="').replace(/%26quot%3B%26gt%3B/g, '">')).replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/\n/g, '<br />')+"</div>";
	document.getElementById('descripHub').scrollTop=0;
}

function HubInsertYahoo(file,title,decription){	
	document.getElementById('videoHub').innerHTML ='<object width="100%" height="450"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.2" /><param name="bgcolor" value="#000000" /><param name="allowFullScreen" value="true" /><param name="flashVars" value="id=616598&vid='+file+'&lang=en-us&intl=us&thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/i/us/sch/cn/v/v0/w133/'+file+'_400_300.jpeg&embed=1" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.2" type="application/x-shockwave-flash"  width="100%" height="450" allowFullScreen="true" flashVars="id=616598&vid='+file+'&lang=en-us&intl=us&thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/i/us/sch/cn/v/v0/w133/'+file+'_400_300.jpeg&embed=1" bgcolor="#000000"></embed></object>';
	
	document.getElementById('titleHub').innerHTML =urldecode(title);
	document.getElementById('descripHub').innerHTML ="<div>"+urldecode(decription.replace(/href%3D%26quot%3B/g, 'href="').replace(/%26quot%3B%26gt%3B/g, '">')).replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/\n/g, '<br />')+"</div>";
	document.getElementById('descripHub').scrollTop=0;
}

function HubInsertRevver(file,title,decription){	
	document.getElementById('videoHub').innerHTML ='<script src="http://flash.revver.com/player/1.0/player.js?mediaId:'+file+';width:100%;height:450;" type="text/javascript"></script>';
	
	document.getElementById('titleHub').innerHTML =urldecode(title);
	document.getElementById('descripHub').innerHTML ="<div>"+urldecode(decription.replace(/href%3D%26quot%3B/g, 'href="').replace(/%26quot%3B%26gt%3B/g, '">')).replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/\n/g, '<br />')+"</div>";
	document.getElementById('descripHub').scrollTop=0;
}

function HubInsertKewego(file,title,decription){	
	document.getElementById('videoHub').innerHTML ='<object type="application/x-shockwave-flash" data="http://www.kewego.fr/p/fr/'+file+'"  width="100%" height="450"><param name="movie" value="http://www.kewego.fr/p/fr/'+file+'" /><param name="bgcolor" value="#000000" /><param name="allowScriptAccess" value="always" /><embed src="http://www.kewego.fr/p/fr/'+file+'"  width="100%" height="450" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#000000"></embed></object>';
	
	document.getElementById('titleHub').innerHTML =urldecode(title);
	document.getElementById('descripHub').innerHTML ="<div>"+urldecode(decription.replace(/href%3D%26quot%3B/g, 'href="').replace(/%26quot%3B%26gt%3B/g, '">')).replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/\n/g, '<br />')+"</div>";
	document.getElementById('descripHub').scrollTop=0;
}
function AFdescrip(ref){
	//parent.videoscreen.document.getElementById('descripHub').innerHTML = ArrRef[ref];
	document.getElementById('descripHub').innerHTML = ArrRef[ref];
}

function HubInsertWMVVid(ref,title){
	HubPlayer='<object id="MediaPlayer" height="100%" width="100%" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">';
	HubPlayer+='<param name="filename" value="'+ref+'" /><param name="Showcontrols" value="True" /><param name="autoStart" value="True" /><param name="bgcolor" value="#000000" />';
	HubPlayer+='<param name="StretchToFit" value="1" /><param name="showstatusbar" value="True" />';
	HubPlayer+='<param name="invokeurls" value="True" /><param name="animationatstart" value="false" />';
	HubPlayer+='<param name="ShowPositionControls" value="True" /><param name="AllowChangeDisplaySize" value="1" />';
	
	HubPlayer+='<EMBED type="application/x-mplayer2" SRC="'+ref+'"  name="MediaPlayer" width="100%" height="100%" ShowControls="1" AllowChangeDisplaySize="1" AutoStart="1" stretchtofit="True" showstatusbar="1" invokeurls="1" animationatstart="0" ShowPositionControls="1" bgcolor="#000000"></EMBED></object>';
	//parent.videoscreen.document.getElementById('videoHub').innerHTML = HubPlayer;
	document.getElementById('videoHub').innerHTML = HubPlayer;
	document.getElementById('titleHub').innerHTML =urldecode(title);
	document.getElementById('descripHub').innerHTML ="";
	
	}

function HubInsertQtime(ref,title){
	HubPlayer='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="100%" height="100%"  id="movie1" codebase="http://www.apple.com/qtactivex/qtplugin.cab">';
	HubPlayer+='<param name="src" value="'+ref+'" /><param name="autoplay" value="True" /><param name="controller" value="true">';
	HubPlayer+='<param name="scale" value="ASPECT" /><param name="bgcolor" value="#000000" /><param name="volume" value="60" />';
	HubPlayer+='<param name="enablejavascript" value="true" /><param name="kioskmode" value="true"><param name="qtsrcdontusebrowser" value="true" />';
	HubPlayer+='<param name="type" value="video/quicktime" /><param name="bgcolor" value="#000000" />';
	
	HubPlayer+='<embed src="'+ref+'" qtsrcdontusebrowser="true" width="100%" volume="60" height="100%" name="movie1"  type="video/quicktime" bgcolor="000000"  kioskmode="FALSE" scale="ASPECT"  autoplay="True" controller="true" enablejavascript="true" pluginspage="http://www.apple.com/quicktime/download/" bgcolor="#000000" /></object>';
	//parent.videoscreen.document.getElementById('videoHub').innerHTML = HubPlayer;
	document.getElementById('videoHub').innerHTML = HubPlayer;
	document.getElementById('titleHub').innerHTML =urldecode(title);
	document.getElementById('descripHub').innerHTML ="";

	
	//<div id="DivprogBar" style="width:480; background-image:url(images/ProgBarreBckW.gif); color: #8080FF; font-size:10px; font-weight: bold; font-family: Verdana, Arial; text-align:left;"><img src="images/ProgBarreB.gif" height=17 width=0></div>
	//<div id="DivJauge" style="width:480; background-color:rgb(240, 240, 240); color: #8080FF; font-size:10px; font-weight: bold; font-family: Verdana, Arial; text-align:center;">-</div>
	}

function HubInsertReal(ref,title){	
	HubPlayer='<OBJECT ID=RVOCX CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" WIDTH="100%" HEIGHT="90%">';
	HubPlayer+='<param name="SRC" value="'+ref+'" /><param name="controls" value="ImageWindow" /><param name="console" value="one" />';
	HubPlayer+='<param name="AUTOSTART" value="false" /><param name="type" value="audio/x-pn-realaudio-plugin" />';
	HubPlayer+='<EMBED SRC="'+ref+'" WIDTH="100%" HEIGHT="90%" NOJAVA="true" CONTROLS="ImageWindow"  type="audio/x-pn-realaudio-plugin" CONSOLE="one" AUTOSTART="false" /></OBJECT>';
	
	HubPlayer+='<OBJECT ID=RVOCX CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" WIDTH="100%" HEIGHT="10%">';
	HubPlayer+='<param name="CONTROLS" value="All" /><param name="CONSOLE" value="one"><param name="AUTOSTART" value="false" /><param name="type" value="audio/x-pn-realaudio-plugin" />';
	HubPlayer+='<EMBED  type="audio/x-pn-realaudio-plugin" SRC="'+ref+'" WIDTH="100%" HEIGHT="10%" AUTOSTART="false" NOJAVA="true" CONTROLS="All" CONSOLE="one" /></OBJECT>';
	//parent.videoscreen.document.getElementById('videoHub').innerHTML = HubPlayer;
	document.getElementById('videoHub').innerHTML = HubPlayer;
	document.getElementById('titleHub').innerHTML =urldecode(title);
	document.getElementById('descripHub').innerHTML ="";

}


function HubInsertblogPost(pid,title){
Postcontainer=document.getElementById('videoHub');
document.getElementById('titleHub').innerHTML ="";
document.getElementById('descripHub').innerHTML ='<div style="color: #FF7717;font-weight:bold;">'+urldecode(title)+"</div>";
HubGetPostData(pid);
}

function HubInsertblogComment(arg,title){
Postcontainer=document.getElementById('videoHub');
document.getElementById('titleHub').innerHTML ="";
document.getElementById('descripHub').innerHTML ='<div style="color: #FF7717;font-weight:bold;">'+urldecode(title)+"</div>";
HubGetPostData(arg);
}


/* ----------------------- */
	var LoopID=0;
	
	
	function FillDivFrom(DivDestination,DivSource){
	zediv= DivDestination;
	zesource= DivSource;
	var idtag;
	var BoolDataIn=false;
	
	if (document.all  && !window.opera) {
		idtag=(DivSource+"idHubAstru").toLowerCase(); // oui .. oui c est bien ainsi, ne pas changer en "DivSource.toLowerCase()+"idHubAstru"
			var divdest = document.getElementById(zediv);
			var kids=divdest.childNodes, i=0, k;
		try{
			while(k=kids[i++]){
				if(k.name.toLowerCase()==idtag){
					BoolDataIn=true;
					//alert("ok");
					break;
				}
				//alert(k.name+" - " +idtag);
			}
		} catch(e) {}
		
	}else{
		idtag=DivSource.toLowerCase()+"idHubAstru";
		if(document.getElementById(zediv).innerHTML.indexOf(idtag)>-1){BoolDataIn=true;}
	}
	

		//alert(document.getElementById(DivDestination).innerHTML.indexOf(idtag)+idtag);
	if(BoolDataIn==true){
		if(document.getElementById(zediv).offsetHeight>5){
		HubReq.abort();
		document.getElementById('ListeSideBarHub').innerHTML='';
		document.getElementById('videoHub').innerHTML='<img src="/portail/NawaatVideoHub/images/NawaatMultimediaBig.jpg" width="500" height="450" />';

		setTimeout("FermerDivKeepData(zediv)",300);
		}else{
			if (document.all  && !window.opera) { 
			document.getElementById(zediv).style.setAttribute('cssText',' height:0px; overflow:hidden;filter:alpha(opacity=0);-moz-opacity:0.0;opacity:0.0;');
			}else{
			document.getElementById(zediv).setAttribute('style',' height:0px; overflow:hidden;-moz-opacity:0.0;opacity:0.0;');
			}
		OuvrirStaticDiv(zediv);
		}
		return;
	}

	document.getElementById(zediv).innerHTML='';
	if (document.all && !window.opera) { 
	document.getElementById(zediv).style.setAttribute('cssText',' height:0px; overflow:hidden;filter:alpha(opacity=0);-moz-opacity:0.0;opacity:0.0;');
	}else{
	document.getElementById(zediv).setAttribute('style',' height:0px; overflow:hidden;-moz-opacity:0.0;opacity:0.0;');
	}
	setTimeout("OuvrirApresSleep(zediv,zesource)",80);
}

function OuvrirApresSleep(zedivdata,zesource){
	zediv=zedivdata;
	var HtmlCloseButton=""
	var BoolAddCloseButton=false; // option a gerer ulterieurement ... surtout pas en global mais au choix a chaque appel
	
	if(BoolAddCloseButton==true){
	HtmlCloseButton='<div class="CloseButton"><a href="javascript:;" onclick="FermerDivKeepData(\''+zedivdata+'\'); return false;" style="outline: 0px"><img src="Fermer.png" border="0" /></a></div><br/>';
	}else{
	HtmlCloseButton="";
	}
document.getElementById(zedivdata).innerHTML='<a name="'+ zesource.toLowerCase()+'idHubAstru" ></a>'+HtmlCloseButton+document.getElementById(zesource).innerHTML;
document.getElementById(zesource).innerHTML=''; // la vider pour liberer memoire et surtout les id pour ne pas être en doublons
OuvrirStaticDiv(zediv);
}


function OuvrirStaticDiv(thediv){
	var IntDelay=50;
	dddivh=thediv;

	if (document.all  && !window.opera) { 
		document.getElementById(dddivh).style.setAttribute('cssText',' height:35px; overflow:hidden;filter:alpha(opacity=5);-moz-opacity:0.1;opacity:0.01;');

		}else{
		document.getElementById(dddivh).setAttribute('style',' height:35px; overflow:hidden;-moz-opacity:0.1;opacity:0.01;');
	}
	clearInterval(LoopID);
	opc=100;
	
	//document.body.scrollTop=0;
	$('HubHOOK').scrollTo();
	LoopID=window.setInterval("AgrandirHauteurStaticDiv(dddivh,LoopID)",IntDelay);

}

function AgrandirHauteurStaticDiv(thediv,LoopID){
//thediv='fortestm';
var divh=Math.round((document.getElementById(thediv).offsetHeight+1) * 1.4);
opc=opc+4;
opc=100; // on desactive transparence
opcmoz=opc/100;
			//	alert('tt '+document.getElementById(thediv).innerHTML);

	if (document.all && !window.opera) { 
		document.getElementById(thediv).style.setAttribute('cssText',' height:'+ divh+ 'px; bottom:0px; overflow:hidden;filter:alpha(opacity='+opc+');');
		}else{
		document.getElementById(thediv).setAttribute('style',' height:'+ divh+ 'px; overflow:hidden;-moz-opacity:'+opcmoz+';opacity:'+opcmoz);
	}

 if ((divh)>700){

// if ((divh+40)>document.getElementById(thediv).scrollHeight){
		if (document.all && !window.opera) { 
			document.getElementById(thediv).style.setAttribute('cssText',' height:auto;filter:alpha(opacity=100);-moz-opacity:1;opacity:1;');
			}else{
			document.getElementById(thediv).setAttribute('style',' height:auto;-moz-opacity:1;opacity:1;');
			}
		document.getElementById(thediv).setAttribute('style',' height:auto;-moz-opacity:1;opacity:1;');



		clearInterval(LoopID);
		GetMediaData(HubSideDefaultView);
		HubInsertGogVid(HubDefaultGoogleVid,HubDefaultVidTitle , HubDefaultVidDesc);
		//HubInsertGogVid('324150353848834351','Tunisie : Ed. 165 du 12/06/08 - Canal du Dialogue Tunisien (El Hiwar)' , 'Il+y+a+d%E2%80%99un+cot%C3%A9+cette+couverture+des+derni%C3%A8res+actualit%C3%A9s+si+douloureuses+de+la+Tunisie+par+Canal+du+Dialogue+et+de+l%E2%80%99autre%2C+le+gros+titre+d%E2%80%99aujourd%E2%80%99hui+%C2%AB+Au+c%C5%93ur+de+l%E2%80%99actualit%C3%A9+%3A+Un+havre+de+paix%2C+de+prosp%C3%A9rit%C3%A9%2C+de+libert%C3%A9+et+de+progr%C3%A8s+pour+tous+%C2%BB+par+Mouldi+M%E2%80%99Barek.%0AParce+que+ces+deux+sources+s%E2%80%99opposent+si+radicalement+quant+%C3%A0+la+pr%C3%A9sentation+de+la+situation+actuelle+qui+pr%C3%A9vaut+dans+notre+pays%2C+je+ne+peux+que+conclure+que+l%E2%80%99une+des+deux+incarne+l%E2%80%99image+la+plus+m%C3%A9prisable+de+ce+que+peut+repr%C3%A9senter+un+certain+%C2%AB+journalisme+%C2%BB.%0AInutile+d%E2%80%99en+dire+plus%2C+je+pr%C3%A9f%C3%A8re+juste+reproduire+un+extrait+de+la+%C2%ABD%C3%A9claration+des+devoirs+et+des+droits+des+journalistes%C2%BB+de+Munich+adopt%C3%A9e+par+la+F%C3%A9d%C3%A9ration+Internationale+des+Journalistes+%28FIJ%29+au+Congr%C3%A8s+d%E2%80%99Istanbul+en+1972.%0AAstrubal%2C+le+12+juin+2008%0ASource+http%3A%2F%2Fastrubal.nawaat.org%0ATags+%3A+libert%C3%A9+de+la+presse%2C+M%C3%A9dias%2C+propagande%2C+r%C3%A9pression%2C+redeyef%2C+Tunisie%0ACanal+du+Dialogue+Tunisien%3A+M%C3%A9dia+d%26%2339%3Bexpression+de+l%26%2339%3Bopposition+d%C3%A9mocratique+et+progressiste+tunisienne.');
//		HubInsertYtbe('Xxa0ihsoiYI','Barack Obama\'s Victory Speech on June 3, 2008' , 'On the evening he wins the Democratic Party\'s nomination for president, Barack Obama speaks from St. Paul, Minnesota.');
		//HubInsertReal('/portail/video_acc/cdt_162.ram','Canal du Dialogue Tunisien, éd. 162 du 05/06/2008' , 'Canal du Dialogue Tunisien, éd. 162 du 05/06/2008.');

	}
}

function FermerDivKeepData(thediv){
	bugdiv=thediv;
	var IntDelay=30;

	clearInterval(LoopID);
	LoopID=window.setInterval("FermerDivSansPurger(bugdiv,LoopID)",IntDelay);

}

function FermerDivSansPurger(thediv,LoopID){
	var divh = Math.round(document.getElementById(thediv).offsetHeight/1.4);
	
	opc=opc/1.07;
	opcmoz=opc/100;
	if (document.all && !window.opera) {
	
		document.getElementById(thediv).style.setAttribute('cssText',' height:'+ divh+ 'px; overflow:hidden;filter:alpha(opacity='+opc+');-moz-opacity:'+opcmoz+';opacity:'+opcmoz);
	}else{
		document.getElementById(thediv).setAttribute('style',' height:'+ divh+ 'px; overflow:hidden;-moz-opacity:'+opcmoz+';opacity:'+opcmoz);
	}
	
	if (divh<10){
		if (document.all  && !window.opera) { 
				//document.getElementById(thediv).innerHTML='';
				//document.getElementById(thediv).style.setAttribute('cssText',' display:none;');
				document.getElementById(thediv).style.setAttribute('cssText',' height:0px; overflow:hidden;filter:alpha(opacity=0);-moz-opacity:0.0;opacity:0.0;');
			}else{
				document.getElementById(thediv).setAttribute('style',' height:0px; overflow:hidden;-moz-opacity:0.0;opacity:0.0;');
			}
	// 	document.getElementById(thediv).removeChild(thediv);
	clearInterval(LoopID);
	}

}

/* ---- Code By Astrubal - www.nawaat.org | astrubal.nawaat.org */
/* ---- This Code still under developpement May 2008 v.0.3------ */