function MM_findObj(n, d) { //v4.01
	var p,i,x,myMM_FindObj;  
	if(!d) d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length){
		d=parent.frames[n.substring(p+1)].document; 
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_changeProp(objName,x,theProp,theValue){
	var obj = MM_findObj(objName);
	if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
		if (theValue == true || theValue == false) eval("obj."+theProp+"="+theValue); else eval("obj."+theProp+"='"+theValue+"'");
	}
}
function MM_HideH1(vOldH1, vNewH1){
	var myDispString;
	MM_changeProp('H1_' + vOldH1,'','style.display','none','DIV');
	MM_changeProp('H1_' + vNewH1,'','style.display','block','DIV');
	document.idxH1.oldH1.value = vNewH1;
}
function UpdTocOfPage(nbreHeadToc){
	for (j=1; j<nbreHeadToc+1; j++) {SetTocTopOfPage(j);}
}
function browser_check(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie4=(document.all && !this.dom)?1:0;
	this.ie4mac=this.ie4 && navigator.userAgent.indexOf("Mac")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.all=(this.ie6||this.ie5 || this.ie4 || this.ns4 || this.ns5) && !this.ie4mac;
	this.IE = (this.ie6||this.ie5 || this.ie4);
	this.NS = (this.ns4 || this.ns5);
	return this
}
/*********************
***Popup functions ***
*********************/
function createPopup(url, h, w){
	self.name = '';
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var popUp = window.open (url, 'WinTag', 'toolbar=yes,directories=no,menubar=yes,scrollbars=yes,resizable=yes,top='+wint+',left='+winl+',width='+w+',height='+h+'');
	if(x != null) popUp.focus();
}
function openWindow(url,w,h,tb,stb,l,mb,sb,rs,x,y){
	var t=(document.layers)? ',screenX='+x+',screenY='+y: ',left='+x+',top='+y; //A LITTLE CROSS-BROWSER CODE FOR WINDOW POSITIONING
	tb=(tb)?'yes':'no'; stb=(stb)?'yes':'no'; l=(l)?'yes':'no'; mb=(mb)?'yes':'no'; sb=(sb)?'yes':'no'; rs=(rs)?'yes':'no';
	var x=window.open(url, 'newWin'+new Date().getTime(), 'scrollbars='+sb+',width='+w+',height='+h+',toolbar='+tb+',status='+stb+',menubar='+mb+',links='+l+',resizable='+rs+t);
	if(x != null) x.focus();
}
function openWindowC(url,w,h,tb,stb,l,mb,sb,rs){	
	var w1 = 480, h1 = 340;
	if (document.all || document.layers){
	   w1 = screen.availWidth;
	   h1 = screen.availHeight;
	}
	var popW = w, popH = h;	
	var x = (w1-popW)/2, y = (h1-popH)/2;
	var t=(document.layers)? ',screenX='+x+',screenY='+y: ',left='+x+',top='+y; //A LITTLE CROSS-BROWSER CODE FOR WINDOW POSITIONING
	tb=(tb)?'yes':'no'; stb=(stb)?'yes':'no'; l=(l)?'yes':'no'; mb=(mb)?'yes':'no'; sb=(sb)?'yes':'no'; rs=(rs)?'yes':'no';
	var x=window.open(url, 'newWin'+new Date().getTime(), 'scrollbars='+sb+',width='+w+',height='+h+',toolbar='+tb+',status='+stb+',menubar='+mb+',links='+l+',resizable='+rs+t);
	if(x != null) x.focus();
}
function openPopup(url){openWindowC(url,800,450,0,0,0,1,1,1);}
function openNew(url){openWindowC(url,800,450,1,1,0,1,1,1);}
function openPdfPopup(url){
	openPopup("http://cms.be.intranet/intradoc-cgi/idc_cgi_isapi.dll?IdcService=GET_PDF&dDocName=" + url);
}
function openFilePopup(url){
	openPopup("http://cms.be.intranet/intradoc-cgi/idc_cgi_isapi.dll?IdcService=GET_FILE&dDocName=" + url + "&RevisionSelectionMethod=latestReleased&allowInterrupt=1");
}

function openNewsPopup(url){
	openWindow(url,540,460,0,1,0,1,1,1,100,20);
}
function openDocNewsPopup(url){
	openNewsPopup("http://cms.be.intranet/intradoc-cgi/idc_cgi_isapi.dll?IdcService=GET_DYNAMIC_CONVERSIONPAGE&dDocName=" + url);
}
function openPdfNewsPopup(url){
	openNewsPopup("http://cms.be.intranet/intradoc-cgi/idc_cgi_isapi.dll?IdcService=GET_PDF&dDocName=" + url);
}
function openFileNewsPopup(url){
	openNewsPopup("http://cms.be.intranet/intradoc-cgi/idc_cgi_isapi.dll?IdcService=GET_FILE&dDocName=" + url + "&RevisionSelectionMethod=latestReleased&allowInterrupt=1");
}
function exitSite(url,newWin,name){
	//var imgdoc = document.getElementsByTagName("img");
	var wtac = name;
	/*if (typeof(imgdoc)!="undefined"){
		for (var i=1;i<=imgdoc.length;i++){
			myMeta=imgdoc.item(i-1);
			if (myMeta.name){
				if(WT.ad != null && WT.ad != '') WT.ad+=";"; else WT.ad="";
				WT.ad+=myMeta.name;
			}
		}
	}*/
	if(wtac != null && wtac != "") {
		WT.ac=wtac;
		dcsVar();
		dcsMeta();
		dcsTag();
	}
	if(newWin!=null && newWin == 1) openNew(url); else document.location.replace(url);
}
//openWin
function openWin(url,w,h) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	window.open(url, '_blank', 'menubar=0,location=0,scrollbars=1,resizable=1,status=0,width='+w+',height='+h+',top='+wint+',left='+winl); 
}
