var NewsDetails = {

	expanded: false,

	displaySubItemSommaire: function(){
		if($('SubItemSommaire')){
			var divSommaire= $('SubItemSommaire');
			divSommaire.style.display="block";
		}
	},

	unDisplaySubItemSommaire: function(){
		if($('SubItemSommaire')){
			var divSommaire= $('SubItemSommaire');
			divSommaire.style.display="none";
		}
	},

	initGallery: function(){
		if($("photoPrincipale")){
			image = $("photoPrincipale");
			largeur = $("photoPrincipale").width;
		
			if ($("galerie-wrapper")){
				cibleGalerie = $("motiongallery");
				cibleGalerieTwo = $("motioncontainer");
				trueContainerId = $("trueContainer");

				galerieWrapper = $("galerie-wrapper");
				cibleGalerie.style.width = largeur+"px";
				cibleGalerieTwo.style.width = largeur+"px";
				trueContainerId.style.width = largeur+"px";	
				galerieWrapper.style.width = largeur+"px";
				
			}
		}	
	},	

	showDocument: function(documentName){

		var win = window.open(documentName,'','height=600,width=800,scrollbars=yes,menubar=no');

		HM_IE = (document.all) ? true : false;
		
		if ( win!=null ) {
		
			var TheWindowWidth = HM_IE ? document.body.clientWidth : win.innerWidth;
			var TheWindowHeight = HM_IE ? document.body.clientHeight : win.innerHeight;
			
			ScreenWidth = screen.width; 
			ScreenHeight = screen.height;
			
			myPosX = ScreenWidth/2 - TheWindowWidth/2;
			myPosY = ScreenHeight/2 - TheWindowHeight/2;
			
			win.moveTo(myPosX,myPosY);  
		}
	},

	openWindow: function(url){
		window.open(url,'','height=40,width=170,scrollbars=yes,menubar=no,resizable=yes');
	},

	expand: function(){
		if(NewsDetails.expanded == false) {
			try{document.getElementById("NewsDetails_MiniPortlets").style.display="none";}catch(ex){}
			try{document.getElementById("NewsDetails_Main").style.width="690px";}catch(ex){}
			try{document.getElementById("Gallery").style.width="auto";}catch(ex){}
			try{document.getElementById("WebDav").style.width="auto";}catch(ex){}
			try{document.getElementById("Gallery_content").style.width="auto";}catch(ex){}
			try{document.getElementById("WebDav_content").style.width="auto";}catch(ex){}
			NewsDetails.expanded = true;
		} else {
			try{document.getElementById("NewsDetails_Main").style.width="500px";}catch(ex){}
			try{document.getElementById("Gallery").style.width="";}catch(ex){}
			try{document.getElementById("WebDav").style.width="";}catch(ex){}
			try{document.getElementById("Gallery_content").style.width="auto";}catch(ex){}
			try{document.getElementById("WebDav_content").style.width="auto";}catch(ex){}
			NewsDetails.expanded = false;
			try{document.getElementById("NewsDetails_MiniPortlets").style.display="block";}catch(ex){}
		}
	}

}
