/**
  * Same one of CMS_
  */
function client_addEvent(obj, evType, fcn) {
	if (obj.addEventListener) {
		obj.addEventListener(evType, fcn, true);
		return true;
	} else if (obj.attachEvent) {
		var r = obj.attachEvent("on"+evType, fcn);
		return r;
	} else {
		return false;
	}
	return true;
}
/**********************************************
* Browser definition                          *
**********************************************/
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && navigator.userAgent.toLowerCase().indexOf('opera') == -1) {
	var isIE = true;
}

client_addEvent(window,'load', function() {

/**
  * WYSIWYG row with hidden div.
  * Optional Content inside.
  * Can be multiple row in same page
  * Without javascript divs can't be see
  * With javascript localise hotlink add mouse event and change cursor style
  * And change div' style (display, z-index);
  */
  	winArtOfLife = function() {
		var myLink = false;

		this.constructor=function(obj){
				this.myLink=obj.getElementsByTagName('span')[0];
				this.myLink.style.cursor='pointer';
				client_addEvent(this.myLink, 'mouseover', this.seeHiddenDiv);
				client_addEvent(this.myLink, 'mouseout', this.hiddeVisibleDiv);
		}
		
		this.seeHiddenDiv=function(){
			if (isIE) {
				e = window.event.srcElement;
				el = e.parentNode.parentNode;
			}else{
				el=this.parentNode.parentNode;
			}
			myDiv=el.getElementsByTagName('div')[15];
			el.style.zIndex=100;
			myDiv.style.zIndex=101;
			myDiv.style.display = "block";
		}

		this.hiddeVisibleDiv=function(){
			if (isIE) {
				e = window.event.srcElement;
				el = e.parentNode.parentNode;
			}else{
				el=this.parentNode.parentNode;
			}
			myDiv=el.getElementsByTagName('div')[15];
			el.style.zIndex=90;
			myDiv.style.zIndex=91;
			myDiv.style.display = "none";
		}
	
	}
	var winAOL = new winArtOfLife;
	var aDivs = document.getElementsByTagName('div');
	for(var i=0; i<aDivs.length; i++){
		if(aDivs[i].className == 'artOfLife'){
			winAOL.constructor(aDivs[i]);
		}
	}
	
	if(document.getElementById('sourceForm')){
		document.getElementById('sourceForm').onsubmit = testSubmit;
	}
	function testSubmit(){
		window.location.href=document.forms.sourceForm.IDTopic.options[document.forms.sourceForm.IDTopic.options.selectedIndex].value;
		return false;	
	}	

	
		

		
	/* 
  * Without javascript the div is hidden
  * With javascript activ print function;
  */
	if(document.getElementById('footerPrint')){
		var printButton = document.getElementById('footerPrint');
		printButton.style.display = "block";
		client_addEvent(printButton, 'click', function(){
			window.print();
		});
	}
	
});
