/* www.wikio.com - AB */
var agt=window.navigator.userAgent.toLowerCase();var ie=(agt.indexOf("msie")!=-1)?true:false;var moz=(agt.indexOf("gekko")!=-1 || agt.indexOf("khtml")!=-1)?true:false;var khtml=(agt.indexOf("khtml")!=-1)?true:false;var isSafari=false;if(agt.indexOf("safari")!=-1 && agt.indexOf("version/3")<0){moz=false;isSafari=true;};var isOpera=(agt.indexOf("opera")!=-1 && !isSafari)?true:false;var t=top.document;
if(typeof(editNode)=="undefined"){ var editNode=editMode=editorMenu=editableDocument=closeMenuContacts=top.tmpWiki=top.tmpWikiTitle=null;top.designMode=false;var closeEditor;var usedUrls=new Array();}
top.authExtensions=new Array(".jpg","jpeg",".gif",".png");
var autNodes=new Array("img","a","div","p","b","u","i","strong","br");
var fbid=new Array("script","noscript","frame","style","form");
var autAtt=new Array("href","src");
var RemAtt=new Array("onclick","ondblclick","onchange","onfocus","onkeydown","onkeypress","onkeyup","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","id","class","height","width","border","name","action","nowrap","lang");
function editor(objRef,id,name,action,tgt,mode,elemId,extCss,minWidth,minHeight){
	top.edit=true;
	this.objRef=objRef;
	this.id=(id!=null && id!="")?id:"0";
	this.name=(name!=null && name!="")?name:"wiki";
	this.action=(action!=null && action!="")?action:"/datas/saveWiki.jsp";
	this.tgt=(tgt)?tgt:"stdfrm";
	this.extCss=(extCss)?extCss:false;
	this.buttonpath="/shared/gui/editor/buttons/";
	this.mode=(mode!=null && mode!="")?mode:"normal";
	this.minWidth=(minWidth!=null && minWidth!="")?minWidth:false;
	this.minHeight=(minHeight!=null && minHeight!="")?minHeight:false;
	editMode=this.mode;
}
editor.prototype.build=function(cancelDatas,cssClass){
	this.form=top.document.createElement("FORM");
	if(cssClass)this.form.className=cssClass;
	this.form.name=this.name;
	this.form.action=this.action;
	this.form.method="post";
	this.form.target="stdfrm";
	this.form.id="wikiform";
	this.form.enctype = "application/x-www-form-urlencoded";
	this.form.acceptCharset="UTF-8";
	this.editortitle=top.document.createElement("INPUT");this.editortitle.name="wikititle";this.editortitle.type="hidden";this.editortitle.value="";this.form.appendChild(this.editortitle);
	this.editordata=top.document.createElement("INPUT");this.editordata.name="wikidatas";this.editordata.type="hidden";this.editordata.value="";this.form.appendChild(this.editordata);
	this.editorid=top.document.createElement("INPUT");this.editorid.name="id";this.editorid.type="hidden";this.editorid.value=this.id;this.form.appendChild(this.editorid);
	this.mainBody=top.document.createElement("DIV");
	this.mainBody.className="editor";
	if(this.extCss)this.mainBody.className="editor "+this.extCss;
	if(this.minWidth)this.mainBody.style.minWidth=this.minWidth;
	if(this.minHeight)this.mainBody.style.minHeight=this.minHeight;
	if(editMode!="publish"){this.form.appendChild(this.mainBody);};
	
	this.topBAR=top.document.createElement("DIV");
	this.topBAR.id="topbar";
	this.topBAR.className="topbar";
	editorMenu=this.topBAR;
	this.mainBody.appendChild(this.topBAR);
	
	this.datasDIV=top.document.createElement("DIV");
	this.datasDIV.className="eddatas";
	this.mainBody.appendChild(this.datasDIV);
	this.datas();
	this.editBar();
	return (this.mode!="publish")?this.form:this.mainBody;
}

editor.prototype.datas=function(){
if(ie || isSafari){
	this.editZone=top.document.createElement("DIV");
	this.editZone.contentEditable="true";
	this.editZone.id="edit";
	this.editZone.className="wikiedit";
	this.editZone.contentEditable=true;
	//document.designMode="on";
	if(window.attachEvent){this.editZone.attachEvent("onmouseup",this.getEditorAttributes);}
	else{this.editZone.addEventListener("mouseup",this.getEditorAttributes,true);};
	
	this.datasDIV.appendChild(this.editZone);
	editNode=this.editZone;
	if(tmpNode && tmpNode.innerHTML)editNode.innerHTML=tmpNode.innerHTML;
}
else{
	this.editZone=document.createElement("iframe");
	this.editZone.className="ifwikiedit";
	this.editZone.id="ifwikiedit";
	this.editZone.style.width="99%";
	editNode=this.editZone;
	this.datasDIV.appendChild(this.editZone);
	this.datasDIV.style.textAlign="center";
	window.setTimeout(this.setItOn,80);}
}
editor.prototype.setItOn = function(){
var eNode=editNode.contentWindow.document;
var extCss=(WIKI.extCss)?"<link rel='stylesheet' type='text/css' href='/shared/style/external.css'/>\n":"";
var blank="<?xml version=\"1.0\" encoding=\"utf-8\" ?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n"+extCss+"</head>\n<body leftmargin=\"5\" topmargin=\"5\" style=\"font-size:12px;\"><div style=\"min-height:20px;\" class=\"edblank\">&nbsp;</div></body>\n</html>";
eNode.open();eNode.write(blank);eNode.close();if(eNode.body){eNode.body.addEventListener("mouseup",iframeAttributes,true);};editableDocument=editNode.contentDocument;if(editableDocument){editableDocument.addEventListener("mouseup",iframeAttributes,true);editableDocument.pageStyle="@import url(/shared/css/external.css);";var eBody=editableDocument.body;if(eBody){eBody.className="wikiedit";eBody.style.marginLeft="5px";eBody.id="edit";};editableDocument.designMode="on";};try{editableDocument.designMode="on";}catch(e){window.setTimeout(function(){editableDocument.designMode="on";},100);};}
editor.prototype.editBar=function(){
	while(this.topBAR.hasChildNodes())this.topBAR.removeChild(this.topBAR.childNodes[0]);
	if(editMode=="light" || editMode=="LE"){this.ligthMode();}
	else if(editMode=="mail") {this.mailMode();}
	else if(editMode=="publish"){this.publishMode();}
	else if(top.g_mode){
		if(top.g_mode=="advanced"){
			this.normalMode();
			this.topBAR.appendChild(this.modeButton("advanced"));
		}
		else{
			this.normalMode();
			this.topBAR.appendChild(this.modeButton("normal"));
		};
	}
	else if(editMode=="advanced"){
		this.normalMode();	}
	else{
		this.normalMode();
	}
}

editor.prototype.normalMode=function(method){
	editbar=top.document.createElement("DIV");
	editbar.id="editormenu";
	editbar.className="edmenubar";
	editbar.appendChild(this.saveBank());
	editbar.appendChild(this.textBank());
	//editbar.appendChild(this.justifyBank());
	if(method=="get"){return editbar;}
	else{this.topBAR.appendChild(editbar);};
}
editor.prototype.publishMode=function(method){
	editbar=top.document.createElement("DIV");
	editbar.id="editormenu";
	editbar.className="edmenubar";
	editbar.appendChild(this.textBank());
	editbar.appendChild(this.linksBank());
	if(method=="get"){return editbar;}
	else{this.topBAR.appendChild(editbar);};
}
editor.prototype.ligthMode=function(){
	editbar=top.document.createElement("DIV");
	editbar.id="editormenu";
	editbar.className="edmenubar";
	editbar.appendChild(this.saveBank());
	editbar.appendChild(this.linksBank());
	editbar.appendChild(this.textBank());
	this.topBAR.appendChild(editbar);
}

editor.prototype.mailMode=function(){
	editbar=top.document.createElement("DIV");
	editbar.id="editormenu";
	editbar.className="edmenubar";
	this.topBAR.appendChild(editbar);

	sendBar=top.document.createElement("DIV");
	sendBar.style.width="100%";
	sendBar.style.padding="3px";
	editbar.appendChild(sendBar);

	toLine=top.document.createElement("DIV");
	sendBar.appendChild(toLine);
	
	warnAdress=top.document.createElement("DIV");
	sendBar.appendChild(warnAdress);
	
	sendToLabel=top.document.createElement("DIV");
	sendToLabel.className="edlabel";
	sendToLabel.style.textAlign=(moz)?"moz-right":"right";
	sendToLabelTxt=top.document.createTextNode(_to);
	sendToLabel.appendChild(sendToLabelTxt);
	toLine.appendChild(sendToLabel);
	
	sendToAddress=top.document.createElement("DIV");
	sendToAddress.style.width="100%";
	sendToInput=top.document.createElement("TEXTAREA");
	sendToInput.name="sendto";
	sendToInput.className="edinput";
	sendToAddress.appendChild(sendToInput);
	toLine.appendChild(sendToAddress);
	if(window.attachEvent){sendToInput.attachEvent("onkeyup",this.callContact,true);}
	else if(window.addEventListener){sendToInput.addEventListener("keyup",this.callContact,true);};
	if(window.attachEvent){sendToInput.attachEvent("onfocus",this.callContact,true);}
	else if(window.addEventListener){sendToInput.addEventListener("focus",this.callContact,true);};
	if(window.attachEvent){sendToInput.attachEvent("onblur",closeMenucontacts,false);}
	else if(window.addEventListener){sendToInput.addEventListener("blur",closeMenucontacts,false);};
	if(window.attachEvent){sendToInput.attachEvent("onmouseout",closeMenucontacts,false);}
	else if(window.addEventListener){sendToInput.addEventListener("mouseout",closeMenucontacts,false);};
	
	warn=top.document.createElement("DIV");
	warn.style.display="none";
	warn.id="warnadress";
	warn.className="warnadress";
	warnAdress.appendChild(warn);
	
	subjectLine=top.document.createElement("DIV");
	sendBar.appendChild(subjectLine);
	subjectLabel=top.document.createElement("DIV");
	subjectLabel.className="edlabel";
	subjectLabel.style.textAlign=(moz)?"moz-right":"right";
	subjectLabelTxt=top.document.createTextNode(_subject);
	subjectLabel.appendChild(subjectLabelTxt);
	subjectLine.appendChild(subjectLabel);
	
	objToAddress=top.document.createElement("DIV");
	objToAddress.style.width="100%";
	objToInput=top.document.createElement("TEXTAREA");
	objToInput.name="object";
	objToInput.className="edinput";
	objToAddress.appendChild(objToInput);
	subjectLine.appendChild(objToAddress);

	fromLine=top.document.createElement("DIV");
	fromLine.style.display="none";
	fromLine.id="fromline";
	sendBar.appendChild(fromLine);
	fromLabel=top.document.createElement("DIV");
	fromLabel.className="edlabel";
	fromLabel.style.textAlign=(moz)?"moz-right":"right";
	fromLabelTxt=top.document.createTextNode(_from);
	fromLabel.appendChild(fromLabelTxt);
	fromLine.appendChild(fromLabel);
	fromAddress=top.document.createElement("DIV");
	fromAddress.style.width="100%";
	fromInput=top.document.createElement("TEXTAREA");
	fromInput.name="mailfrom";
	fromInput.className="edinput";
	fromAddress.appendChild(fromInput);
	fromLine.appendChild(fromAddress);
	
	warnSenderAdress=top.document.createElement("DIV");
	sendBar.appendChild(warnSenderAdress);
	
	warn=top.document.createElement("DIV");
	warn.style.display="none";
	warn.id="warnsender";
	warn.className="warnadress";
	warnSenderAdress.appendChild(warn);
	
	tempTxt=top.document.createElement("INPUT");
	tempTxt.type="hidden";
	tempTxt.name="temptxt";
	editbar.appendChild(tempTxt);
	
	recaptchaDiv=top.document.createElement("DIV");
	recaptchaDiv.id="recaptchaDiv";
	this.mainBody.appendChild(recaptchaDiv);
	//this.mainBody.appendChild(this.captcha());
	this.mainBody.appendChild(this.saveMailBank());
	this.saveDiv.appendChild(this.sendtoAlert());
}
editor.prototype.captcha=function(){
	nd=new Date();
	captcha=top.document.createElement("DIV");
	desc=top.document.createElement("DIV");captcha.id="security";captcha.style.display="none";
	desc.className="form";desc.style.styleFloat="none";
	captcha.appendChild(desc);
	captcha.style.height="70px";
	faDiv=top.document.createElement("DIV");faDiv.className="form-area";desc.appendChild(faDiv);
	ul=top.document.createElement("UL");ul.style.padding=0;ul.style.margin=0;ul.style.border="none";faDiv.appendChild(ul);	
	liCaptcha=top.document.createElement("LI");ul.appendChild(liCaptcha);
	labelCaptcha=top.document.createElement("label");liCaptcha.appendChild(labelCaptcha);labelCaptcha.appendChild(top.document.createTextNode(top._pleasefillcapt));
	bubbleDiv=top.document.createElement("DIV");bubbleDiv.className="inf";liCaptcha.appendChild(bubbleDiv);
	bubA=top.document.createElement("A");bubA.href="#";bubbleDiv.appendChild(bubA);
	bubPopup=top.document.createElement("DIV");bubPopup.className="pop-up";bubbleDiv.appendChild(bubPopup);
	bubTop=top.document.createElement("SPAN");bubTop.className="top-bg";bubPopup.appendChild(bubTop);
	bubP=top.document.createElement("P");bubPopup.appendChild(bubP);
	bubTxt=top.document.createElement("SPAN");bubTxt.appendChild(top.document.createTextNode(top._humanControl));bubP.appendChild(bubTxt);
	bubBt=top.document.createElement("SPAN");bubBt.className="bt-bg";bubPopup.appendChild(bubBt);
	captchaDiv=top.document.createElement("DIV");captchaDiv.className="pic";liCaptcha.appendChild(captchaDiv);
	captchaImg=top.document.createElement("IMG");captchaImg.src="/captcha?d="+nd.getSeconds();captchaImg.className="captimg";
	captchaImg.id="captimg";captchaDiv.appendChild(captchaImg);
	captchaInput=top.document.createElement("INPUT");
	captchaInput.type="text";
	captchaInput.value="";
	captchaInput.name="captchacodes";
	captchaInput.id="captchacodes";
	captchaInput.className="captinput";
	if(window.attachEvent){captchaInput.attachEvent("onkeydown",keySubmit);}else if(window.addEventListener){captchaInput.addEventListener("keydown",keySubmit,true);};
	captchaInput.size=5;
	captchaDiv.appendChild(captchaInput);	
	return captcha;
}

editor.prototype.callContact=function(event){
	var event=(ie)?window.event.srcElement:event.target;
	wa = top.document.getElementById("warnadress");
	if (wa) wa.style.display="none";
	
	var start = (ie)? getCharPos(event):event.selectionStart;
	var address=(event.value)?event.value:"";
	var s=0;var e=(address)?address.length:0;
	var sTxt=eTxt="";
	var m = address.match(/\w+[.]?\w*@\w+[.]\w+/g);
	var count=(m)?m.length :0;
	if (count>4) ajCaptcha();
	if(address.indexOf(";")>-1){
		if(address.indexOf(";",start)>0){
			e=address.indexOf(";",start);
			eTxt=address.substring(e,address.length);
		};
		if(address.indexOf(";")>0){
			tmpe=address.substring(0,start);
			s=tmpe.lastIndexOf(";")+1;
			sTxt=address.substring(0,s);
		};
		address=address.substring(s,e);
	}
	else{e=address.length;};
	var tmpcontacts=new Array();
	for(i=0;i<top.mycontacts.length;i++){
		if(top.mycontacts[i].indexOf(address)==0)tmpcontacts.addElement(top.mycontacts[i]);
	};
	if(tmpcontacts.length>0){
		if(!this.contactslist){
			this.contactslist=top.document.createElement("DIV");
			this.contactslist.style.position="absolute";
			this.contactslist.id="menucontacts";
			this.contactslist.className="subs";
			this.contactslist.style.textAlign="left";
			if(window.attachEvent){this.contactslist.attachEvent("onmouseout",closeMenucontacts,false);}
			else if(window.addEventListener){this.contactslist.addEventListener("mouseout",closeMenucontacts,false);};
			top.document.body.appendChild(this.contactslist);
		}else{
			while(this.contactslist.hasChildNodes())this.contactslist.removeChild(this.contactslist.childNodes[0]);
			this.contactslist.style.display="";
		};
		this.contactslist.style.top=toolkit.getOffsetCoor(event)[toolkit.coor.Y]+event.offsetHeight-1+"px";
		this.contactslist.style.left=toolkit.getOffsetCoor(event)[toolkit.coor.X]+10+"px";
		this.contactslist.style.width=event.offsetWidth-10+"px";
		for(i=0;i<tmpcontacts.length;i++){
			addressline=top.document.createElement("DIV");
			addressline.appendChild(top.document.createTextNode(tmpcontacts[i]));
			addressline.tgt=event;eTxt=(eTxt.length>0)?eTxt:";";
			addressline.txtvalue=sTxt+tmpcontacts[i]+eTxt;
			if(window.attachEvent){addressline.attachEvent("onmouseover",stopMenucontactsClosure,false);}
			else if(window.addEventListener){addressline.addEventListener("mouseover",stopMenucontactsClosure,false);};
			if(window.attachEvent){addressline.attachEvent("onmouseout",closeMenucontacts,false);}
			else if(window.addEventListener){addressline.addEventListener("mouseout",closeMenucontacts,false);};
			if(window.attachEvent){addressline.attachEvent("onclick",fillAddress,false);}
			else if(window.addEventListener){addressline.addEventListener("click",fillAddress,false);};
			this.contactslist.appendChild(addressline);
		};
	}else if(this.contactslist){t.body.removeChild(this.contactslist);this.contactslist=null;};
	
	if(document.addEventListener) document.addEventListener('mousedown', closeMenucontacts, true);
	else document.onmousedown=closeMenucontacts;


}
editor.prototype.makeTextButton=function(btId,name,family,cssClass,title,doClick){
	buttonLI=top.document.createElement("DIV");
	buttonLI.setAttribute("unselectable","on");
	buttonLI.className=cssClass;
	if(btId){buttonLI.id="td"+btId;};
	this.buttonA=top.document.createElement("A");
	if(btId)this.buttonA.id=btId;
	
	this.buttonA.setAttribute("unselectable","on");
	if(title){this.buttonA.appendChild(top.document.createTextNode(title));};
	if(name){this.buttonA.name=name;};
	if(family){this.buttonA.family=family;};
	if(window.attachEvent){if(doClick){this.buttonA.attachEvent("onclick",this.toggleImg);};}
	else if(window.addEventListener){if(doClick){this.buttonA.addEventListener("click",this.toggleImg,true);};};
	buttonLI.appendChild(this.buttonA);
	return buttonLI;
}
editor.prototype.makeButton=function(btId,name,family,imgSrc,title,doClick){
	buttonLI=top.document.createElement("DIV");
	buttonLI.setAttribute("unselectable","on");
	buttonLI.unselectable="on";
	buttonLI.className="edbutton";
	if(btId)buttonLI.id="td"+btId;
	this.buttonImg=top.document.createElement("IMG");
	if(btId)this.buttonImg.id=btId;
	this.buttonImg.src=this.buttonpath+imgSrc;
	if(title)this.buttonImg.title=title;
	this.buttonImg.setAttribute("unselectable","on");
	this.buttonImg.unselectable="on";
	if(name)this.buttonImg.name=name;
	if(family)this.buttonImg.family=family;
	if(window.attachEvent){if(doClick && family)this.buttonImg.attachEvent("onclick",this.toggleImg);}
	else if(window.addEventListener){if(doClick && family)this.buttonImg.addEventListener("click",this.toggleImg,true);};
	buttonLI.appendChild(this.buttonImg);
	return buttonLI;
}
editor.prototype.saveBank=function(){
	this.saveDiv=top.document.createElement("DIV");
	this.saveDiv.className="editorlist";
	this.saveDiv.appendChild(this.makeTextButton("edSave","Save","action","modify",_editSave,false));
	this.buttonA.objRef=this.objRef;if(window.attachEvent){this.buttonA.attachEvent("onclick",this.checkForm,false);}
	else if(window.addEventListener){this.buttonA.addEventListener("click",this.checkForm,false);};
	this.saveDiv.appendChild(this.makeTextButton("edCancel","Cancel","action","modify",_cancel,false));
	this.buttonA.objRef=this.objRef;if(window.attachEvent){this.buttonA.attachEvent("onclick",this.exitEditor,false);}
	else if(window.addEventListener){this.buttonA.addEventListener("click",this.exitEditor,false);};
	return this.saveDiv;
}
editor.prototype.saveMailBank=function(){
	this.saveDiv=top.document.createElement("DIV");
	this.saveDiv.style.styleFloat="none";
	this.saveDiv.className="editorbottom";
	//bankTable.style.height="40px";
	this.saveDiv.appendChild(this.makeTextButton("edSave","Save","action","modify",_editSend,false));
	this.buttonA.objRef=this.objRef;
	if(window.attachEvent){this.buttonA.attachEvent("onclick",this.checkMail,false);}
	else if(window.addEventListener){this.buttonA.addEventListener("click",this.checkMail,false);};
	this.saveDiv.appendChild(this.makeTextButton("edCancel","Cancel","action","modify",_cancel,false));
	this.buttonA.objRef=this.objRef;if(window.attachEvent){this.buttonA.attachEvent("onclick",this.cancelMail,false);}
	else if(window.addEventListener){this.buttonA.addEventListener("click",this.cancelMail,false);};
	return this.saveDiv;
}
editor.prototype.sendtoAlert=function(){
	alertzone=top.document.createElement("DIV");
	alertzone.className="editoralert";
	alertzone.id="editorAlert";	
	return alertzone;
}
editor.prototype.justifyBank=function(){
	bankTable=top.document.createElement("DIV");
	bankTable.className="editorlist";
	bankTable.appendChild(this.makeButton("edLeft","JustifyLeft","align","left.gif",_editLeft,true));
	bankTable.appendChild(this.makeButton("edCenter","JustifyCenter","align","center.gif",_editCenter,true));
	bankTable.appendChild(this.makeButton("edRight","JustifyRight","align","right.gif",_editRight,true));
	bankTable.appendChild(this.makeButton("edJustify","JustifyFull","align","justify.gif",_editJustify,true));
	return bankTable;
}

editor.prototype.linksBank=function(){
	bankTable=top.document.createElement("DIV");
	bankTable.className="editorlist";
	bankTable.appendChild(this.makeButton("edCreateLink","CreateLink","action","link.gif",_editCreateLink,true));
	return bankTable;
}
editor.prototype.textBank=function(){
	bankTable=top.document.createElement("DIV");
	bankTable.className="editorlist";
	bankTable.appendChild(this.makeButton("edBold","Bold","richtext","bold.gif",_editBold,true));
	bankTable.appendChild(this.makeButton("edItalic","Italic","richtext","italic.gif",_editItalic,true));
	bankTable.appendChild(this.makeButton("edUnderline","Underline","richtext","underline.gif",_editUnderline,true));
	return bankTable;
}
editor.prototype.setMode=function(event){var tgt=event=(ie)?window.event.srcElement:event.target;top.g_mode=event.switchTo;eval("top."+event.obj+".editBar()");}
editor.prototype.toggleImg=function(event){
	var topEditor=event=(ie)?window.event.srcElement:event.target;
	if(ie){document.execCommand(event.name);}
	else{
		if(event.name=="CreateLink"){
			var myUrl=prompt("URL",["http://"]);
			if (myUrl == null || myUrl.length<10){
				if(editableDocument)editableDocument.execCommand("CreateLink",false);
				else document.execCommand("CreateLink",false);
				
			}
			else {
				if(editableDocument) editableDocument.execCommand("CreateLink",false,myUrl);
				else document.execCommand("CreateLink",false,myUrl);
			}
			
		}
		else{editableDocument.execCommand(event.name,false,null);};
	}
	while(topEditor.nodeName!="FORM"){topEditor=topEditor.parentNode;};
	datas=findInChildren(null,topEditor,"edit",0);
	if(ie || isSafari){
		if(datas){datas.focus();}
	}
	else{editNode.contentWindow.focus();};
	if(event.family!="action"){
		if(event.family=="align")top.resetFamily(event,"align");
		if(event.family=="ulist")top.resetFamily(event,"ulist");
		if(!isSafari) event.parentNode.className=(event.parentNode.className=="edbutton")?"edactive":"edbutton";
	}
}
editor.prototype.publish=function(frm){f=(frm)?frm:top.document.forms['publish'];
if(!ie && !isSafari){startContainer=(editNode.contentWindow.document.getElementById("startContainer"))?editNode.contentWindow.document.getElementById("startContainer"):editNode.contentWindow.document.body;};
datas=(ie || isSafari)?findInChildren(null,top.document.body,"edit",0):startContainer;modDatas(datas,0);
if(top.document.getElementById("textedit")){if(ie || khtml || isOpera){top.document.getElementById("textedit").value=(hasText(datas))?datas.innerHTML:"";}else{top.document.getElementById("textedit").innerHTML=(hasText(datas))?datas.innerHTML:"";}};
if(f){for(i=0;i<f.elements.length;i++){if(f.elements[i].name=="urls"){f.elements[i].value=usedUrls.join('____WIKIO-SEP____');}}};top.designMode=false;top.edit=false;}
editor.prototype.bio=function(frm){f=(frm)?frm:top.document.forms['register'];
if(!ie && !isSafari ){startContainer=(editNode.contentWindow.document.getElementById("startContainer"))?editNode.contentWindow.document.getElementById("startContainer"):editNode.contentWindow.document.body;};
datas=(ie || isSafari)?findInChildren(null,top.document.body,"edit",0):startContainer;
modDatas(datas,0);
if(top.document.getElementById("textedit")){top.document.getElementById("textedit").value=(hasText(datas))?datas.innerHTML:"";};
if(f){for(i=0;i<f.elements.length;i++){if(f.elements[i].name=="urls"){f.elements[i].value=usedUrls.join('____WIKIO-SEP____');}}};top.designMode=false;top.edit=false;}
editor.prototype.getText=function(){if(!ie && !isSafari){startContainer=(editNode.contentWindow.document.getElementById("startContainer"))?editNode.contentWindow.document.getElementById("startContainer"):editNode.contentWindow.document.body;};datas=(ie || isSafari)?findInChildren(null,top.document.body,"edit",0):startContainer;tmpTextNode=top.document.createElement("DIV");this.vacuum(tmpTextNode,datas,0);return tmpTextNode.innerHTML;}
editor.prototype.checkForm=function(event){
	var e=(ie)?window.event.srcElement:event.target;
	var myform=datas=e;
	while(myform.nodeName!="FORM"){
	myform=myform.parentNode;};
	wikiTd=myform.parentNode;
	rstTitle=eval("top."+e.objRef);
	for(i=0;i<myform.elements.length;i++){
		if(myform.elements[i].id=="textedit"){var dest=myform.elements[i];}
		if(myform.elements[i].name=="wikidatas"){var dest=myform.elements[i];};
		if(myform.elements[i].name=="wikititle"){top.tmpWikiTitle=myform.elements[i].value;}
	};
	if(!ie && !isSafari)startContainer=(editNode.contentWindow.document.getElementById("startContainer"))?editNode.contentWindow.document.getElementById("startContainer"):editNode.contentWindow.document.body;
	datas=(ie || isSafari)?findInChildren(null,myform,"edit",0):startContainer;
	modDatas(datas,0);rstTitle=eval("top."+e.objRef);
	if(dest)dest.value=top.tmpWiki=datas.innerHTML;
	myform.submit();top.designMode=false;while(wikiTd.hasChildNodes()){wikiTd.removeChild(wikiTd.childNodes[0]);};wikiContent=top.document.createElement("DIV");wikiContent.id="wikitgt";wikiContent.innerHTML=top.tmpWiki;wikiTd.appendChild(wikiContent);}
editor.prototype.checkMail=function(event){
	var e=(ie)?window.event.srcElement:event.target;var subj=null;var tTxt="";var send=true;checkAlert="";var myform=datas=e;
	closeContact();
	while(myform.nodeName!="FORM"){myform=myform.parentNode;};
	wikiTd=myform.parentNode;
	rstTitle=eval("top."+e.objRef);
	for(i=0;i<myform.elements.length;i++){
		if(myform.elements[i].name=="temptxt"){tTxt=myform.elements[i];};
		if(myform.elements[i].name=="wikidatas"){var dest=myform.elements[i];};
		if(myform.elements[i].name=="object"){
			if(myform.elements[i].value.length==0){
				send=false;
				//checkAlert+=_fillsubject;
				if(top.confirm(_wanttofillsubject)) {
					myform.elements[i].value=_noSubject;
					top.WIKI.checkMail(event);
				}
				else{
					myform.elements[i].focus();
				}
			}
			else{subj=myform.elements[i];};
		};
		if(myform.elements[i].name=="mailfrom" && false){
			var f=myform.elements[i].value;idxAt=f.indexOf("@");idxDot=f.indexOf(".");idxDotLast=f.lastIndexOf(".");
			if((idxDot<0) || (idxAt<0)){checkAlert+=_email0;send=false;}
			else if ((idxDotLast-2)<=idxAt){checkAlert+=_email2;send=false;}
			else if(f.length<(idxDotLast+3)){checkAlert+=_email2;send=false;};
		};
	};
	if(checkAlert.length==0){
		if(!ie && !isSafari)startContainer=(editNode.contentWindow.document.getElementById("startContainer"))?editNode.contentWindow.document.getElementById("startContainer"):editNode.contentWindow.document.body;
		datas=(ie || isSafari)?findInChildren(null,myform,"edit",0):startContainer;
		modMailDatas(datas,0);
		if(dest) dest.value=datas.innerHTML;
	}
	else{alert(checkAlert);};
	if(send){myform.submit();
	if ('function' == typeof myform.afterSubmit) {myform.afterSubmit();};};}
editor.prototype.exitEditor=function(event){
	var event=(ie)?window.event.srcElement:event.target;
	var myform=datas=event;while(myform.nodeName!="FORM"){myform=myform.parentNode;};
	wikiTd=myform.parentNode;
	while(wikiTd.hasChildNodes())wikiTd.removeChild(wikiTd.childNodes[0]);
	wikiContent=top.document.createElement("DIV");
	wikiContent.id="wikitgt";
	wikiContent.innerHTML=top.tmpWiki;
	wikiTd.appendChild(wikiContent);
	top.designMode=false;top.edit=false;top.tmpWiki=top.tmpWikiTitle=null;}
editor.prototype.cancelMail=function(event){var event=(ie)?window.event.srcElement:event.target;var myform=datas=event;while(myform.nodeName!="FORM"){myform=myform.parentNode;};wikiTd=myform.parentNode;wikiTd.removeChild(myform);top.designMode=false;top.edit=false;top.tmpWiki=top.tmpWikiTitle=null;closeContact()}
editor.prototype.exitFromDoc=function(){
	wikiReceiver=top.document.getElementById("wiki");
	if(wikiReceiver){
		while(wikiReceiver.hasChildNodes()){wikiReceiver.removeChild(wikiReceiver.childNodes[0]);};
		wikiContent=top.document.createElement("DIV");
		wikiContent.id="wikitgt";
		wikiContent.className="wikitgt";
		wikiContent.innerHTML=top.tmpWiki;
		wikiReceiver.appendChild(wikiContent);
	}
	top.designMode=false;
	top.edit=false;
}
editor.prototype.closeWiki=function(){
	wiki=top.document.getElementById("wikiform");
	if(wiki && wiki.parentNode){
		closeContact();
		closeEditorMenu();
		wiki.parentNode.removeChild(wiki);
	}
top.designMode=false;
top.edit=false
}
editor.prototype.vacuum=function(parentNode,node,id){var k=id+'_';if(node && node.nodeType==1 && node.hasChildNodes()){for(var k=0;k<node.childNodes.length;k++)this.vacuum(parentNode,node.childNodes[k],k);}else{parentNode.appendChild(top.document.createTextNode(node.nodeValue));}}
editor.prototype.toggleSelect=function(event){var event=(ie)?window.event.srcElement:event.target;if(ie || isSafari){document.execCommand(event.name,false,event.options[event.selectedIndex].value);}else{editableDocument.execCommand(event.name,false,event.options[event.selectedIndex].value);}}
editor.prototype.toggleValue=function(event){var event=(ie)?window.event.srcElement:event.target;if(ie || isSafari){document.execCommand(event.name,false,event.value);}else{editableDocument.execCommand(event.name,false,event.value);}}
editor.prototype.overWrite=function(event){var event=(ie)?window.event.srcElement:event.target;if(ie || isSafari){document.execCommand(event.name);}else{editableDocument.execCommand(event.name,false,null);};event.className=(event.className=="edswitch1")?"edswitch0":"edswitch1";if(ie || isSafari){event.tgt.focus();}else{editNode.contentWindow.focus();};}
editor.prototype.insertImage=function(event,newItem){var event=(ie)?window.event.srcElement:event.target;if(ie || isSafari){document.execCommand("InsertImage",newItem,event.src);}else{editableDocument.execCommand("InsertImage",newItem,event.src);};if((ie || isSafari) && event.tgt){event.tgt.focus();}else{editNode.contentWindow.focus();}}
editor.prototype.getEditorAttributes=function(event){
	var topEditor=event=(ie)?window.event.srcElement:event.target;
	try{
		if(top.aText) {top.setCssName("txtzone","");top.aText=false;}
		while(topEditor.nodeName!="FORM"){topEditor=topEditor.parentNode;};
		EM=STRONG=U=align=null;
		if(ie){var cRange=document.selection.createRange();var para=sel=cRange.parentElement();}
		else if(isOpera || isSafari){var cRange=window.getSelection().getRangeAt(0);var para=sel=cRange.parentElement();};
		while(para.nodeName!="P" && para.nodeName!="DIV"){para=para.parentNode;};
		if(para.getAttribute("ALIGN")){align=para.getAttribute("ALIGN");};	
		top.resetFamily(top.editorMenu,"align");
		while((sel.nodeName!="P" && sel.nodeName!="DIV") && (sel.parentNode && (sel.parentNode.nodeName!="p" && sel.parentNode.nodeName!="DIV"))){
			if(sel.getAttribute("ALIGN")){align=sel.getAttribute("ALIGN");};
			if(sel.nodeName=="EM"){EM=true;};
			if(sel.nodeName=="STRONG"){STRONG=true;};
			if(sel.nodeName=="U"){U=true;};
			sel=sel.parentNode;
		};
		if(align){
			switch(align){
				case "left":findInChildren(null,topEditor,"JustifyLeft",0).parentNode.className="edactive";break;
				case "center":findInChildren(null,topEditor,"JustifyCenter",0).parentNode.className="edactive";break;
				case "right":findInChildren(null,topEditor,"JustifyRight",0).parentNode.className="edactive";break;
				case "justify":findInChildren(null,topEditor,"JustifyFull",0).parentNode.className="edactive";break;
			}
		};
		top.frmCtrl = false;
	}
	catch(e){return false;}
}
function closeEditorTimeOut(event){ closeEditor = window.setTimeout("closeEditorMenu()", 500);}
function stopEditorClosure(event){window.clearTimeout(closeEditor);closeEditor=null;}
function closeEditorMenu(event){if(openedEditorWindow)t.body.removeChild(openedEditorWindow);openedEditorWindow=null;}
function closeMenucontacts(event){ if(!closeMenuContacts) closeMenuContacts = window.setTimeout("closeContact()",500);}
function stopMenucontactsClosure(event){if(closeMenuContacts)window.clearTimeout(closeMenuContacts);closeMenuContacts=null;}
function closeContact(){t=top.document.getElementById("menucontacts");if(t){t.style.display="none";};}
function fillAddress(event){var event=(ie)?window.event.srcElement:event.target;event.tgt.value=event.txtvalue;event.tgt.focus();}
function getCharPos(event){event.focus();var range=event.createTextRange();range.moveToBookmark(document.selection.createRange().getBookmark());range.moveEnd('character', event.value.length);return event.value.length - range.text.length;}
function modDatas(fromNode,id,authtype){
	var k=id+'_';
	for(k=0;k<fromNode.childNodes.length;k++){
		n=fromNode.childNodes[k];
		nName=n.nodeName.toLowerCase();
		if(n.nodeType==1){
		
			for(var attName=0;attName<n.attributes.length;attName++){
				if(n.attributes[attName].specified && RemAtt.contains(n.attributes[attName].nodeName.toLowerCase())){
					n.removeAttribute(n.attributes[attName].nodeName);
				}
				else if(n.attributes[attName].specified && n.attributes[attName].nodeName.toLowerCase()=="href" && n.nodeName.toLowerCase()=="a"){
					if(n.attributes[attName].specified && n.attributes[attName].value.indexOf("javascript:")<0){
						if(!usedUrls.contains(trim(n.attributes[attName].value))){usedUrls.addElement(trim(n.attributes[attName].value));}
					}
					else{n.removeAttribute(n.attributes[attName].nodeName);}
				}
				else if(n.attributes[attName].specified && n.attributes[attName].nodeName.toLowerCase()=="style"){
					var bBold=n.style.fontWeight=="bold";
					var bItalic=n.style.fontStyle=="italic";
					var bUnderline=n.style.textDecoration=="underline";	
					n.removeAttribute(n.attributes[attName].nodeName);
					if(bBold)n.style.fontWeight="bold";
					if(bItalic)n.style.fontStyle="italic";
					if(bUnderline)n.style.textDecoration="underline";
				}
			}
			if(nName=="img" && (n.width<50 || n.height<50))n.parentNode.removeChild(n);
		};
		if(fbid.contains(nName)){n.parentNode.removeChild(n);};
		if(n.href && n.href.substring(0,_editSelfUrl.length)!=_editSelfUrl){n.setAttribute("target","_blank");n.setAttribute("rel","nofollow");};
		if(n.href){try{n.href=trim(n.href)}catch(e){}};
		if(n.nodeType==7 || (n.nodeType==8 && (!authtype || authtype!=8))){n.parentNode.removeChild(n);};
		if(n.childNodes.length>0){modDatas(n,k);};
	}
}
function modMailDatas(fromNode,id,authtype){
	var k=id+'_';
	for(k=0;k<fromNode.childNodes.length;k++){n=fromNode.childNodes[k];nName=n.nodeName.toLowerCase();
		
		if(n.nodeType==1){
			for(var attName=0;attName<n.attributes.length;attName++){
				att=n.attributes[attName];
				if(att.specified && RemAtt.contains(att.nodeName.toLowerCase())){
					if(att.nodeName!="id")n.removeAttribute(att.nodeName);
				};
			}
		};
	if(n.style && n.style.position){n.style.position="fixed";};if(nName.indexOf("script") >=0 || nName.indexOf("frame")>=0){n.parentNode.removeChild(n);};
	if(n.href && n.href.substring(0,_editSelfUrl.length)!=_editSelfUrl){n.setAttribute("target","_blank");};if(n.nodeType==7 || (n.nodeType==8 && (!authtype || authtype!=8))){n.parentNode.removeChild(n);};if(n.childNodes.length>0){modMailDatas(n,k);};}}
function iframeAttributes(event){
	var event=event.target;
	try{
	if(top.aText) {top.setCssName("txtzone","");top.aText=false;}
	var EM=STRONG=U=align=null;
	while(event.nodeName!="BODY"){
		if(!align && event && event.style && event.style.textAlign)align=event.style.textAlign;
		if(!STRONG && event && ((event.style && event.style.fontWeight=="bold") || event.nodeName=="STRONG" || event.nodeName=="B"))STRONG=true;
		if(!U  && event && ((event.style && event.style.textDecoration.toLowerCase().indexOf("underline")>=0) || event.nodeName=="U"))U=true;
		if(!EM  && event && ((event.style && event.style.fontStyle.toLowerCase().indexOf("italic")>=0) || event.nodeName=="I"))EM=true;
		event=event.parentNode;
	}
	if(findInChildren(event,top.editorMenu,"tdedBold",0))findInChildren(event,top.editorMenu,"tdedBold",0).className=(STRONG)?"edactive":"edbutton";
	if(findInChildren(event,top.editorMenu,"tdedItalic",0))findInChildren(event,top.editorMenu,"tdedItalic",0).className=(EM)?"edactive":"edbutton";
	if(findInChildren(event,top.editorMenu,"tdedUnderline",0))findInChildren(event,top.editorMenu,"tdedUnderline",0).className=(U)?"edactive":"edbutton";
	if(findInChildren(event,top.editorMenu,"tdedLeft",0))findInChildren(event,top.editorMenu,"tdedLeft",0).className=(align && align=="left")?"edactive":"edbutton";
	if(findInChildren(event,top.editorMenu,"tdedCenter",0))findInChildren(event,top.editorMenu,"tdedCenter",0).className=(align && align=="center")?"edactive":"edbutton";
	if(findInChildren(event,top.editorMenu,"tdedRight",0))findInChildren(event,top.editorMenu,"tdedRight",0).className=(align && align=="right")?"edactive":"edbutton";
	if(findInChildren(event,top.editorMenu,"tdedJustify",0))findInChildren(event,top.editorMenu,"tdedJustify",0).className=(align && align=="justify")?"edactive":"edbutton";
	top.frmCtrl=false;
	}
	catch(e){}
}