var fcHTMLControls=new Array();var fcEventTimeoutInterval=200;var fcExistingOnBeforeUnload;var fcRelativeMovie=false;function fcAddBlurHandler(){this._doc.xinhaEditor=this;Xinha._addEvent(this._doc,"blur",function(){var movie=fcGetMovieById(this.xinhaEditor.movieId);window.focus();movie.focus();});};function fcAddChild(o){var movie=fcGetMovieById(o.movieId);fcHTMLControls.movieId=o.movieId;if(String(o.chrome)=="true"){fcAddChildPopUp(o);}else if(o.type=="division"){fcAddChildDivision(o);}else if(o.type=="iframe"){fcAddChildIFrame(o);}else if(o.type=="editor"){fcAddChildEditor(o);}};function fcAddChildDivision(o){fcGetIncludes(o.includesBefore);var newElement=document.createElement("div");newElement.id=o.id;newElement.name=o.name;newElement.movieId=o.movieId;newElement.style.position=o.position;if(String(o.fitToContentHeight)=="true"){o.height="";};fcSetSize(newElement,o.width,o.height);fcMoveElementTo(newElement,o.x,o.y);newElement.style.backgroundColor="#"+o.backgroundColor;newElement.style.padding=o.padding;newElement.style.margin="0px";newElement.style.border=o.border;newElement.innerHTML=o.htmlText;document.body.appendChild(newElement);fcAddToGlobalArray(newElement,o);fcSetScrollPolicyById(o.id,o.htmlScrollPolicy);fcGetIncludes(o.includesAfter);if(String(o.visible)=="false"){fcHide(o.id,true,false);};fcDelayedDispatchEvent("htmlCreationComplete",o.movieId,o.id,fcEventTimeoutInterval);};function fcAddChildEditor(o){var el=document.getElementById(o.id);if(el!=null)return;fcHTMLControls[o.id]=new Object();fcGetIncludes(o.includesBefore);var editorName=o.name+"Editor";var newElement=document.createElement("div");newElement.id=o.id;newElement.name=o.name;newElement.movieId=o.movieId;newElement.style.position=o.position;fcSetSize(newElement,o.width,o.height);fcMoveElementTo(newElement,o.x,o.y);newElement.style.backgroundColor="#"+o.backgroundColor;newElement.style.padding=o.padding;newElement.style.margin="0px";newElement.style.border=o.border;var textareaElement=document.createElement("textarea");textareaElement.id=editorName;textareaElement.name=editorName;textareaElement.value=o.htmlText;fcSetSize(textareaElement,"100%","100%");newElement.appendChild(textareaElement);document.body.appendChild(newElement);fcSetScrollPolicyById(o.id,o.htmlScrollPolicy);if(o.editorType=="fckeditor"){var oFCKeditor=new FCKeditor(editorName);oFCKeditor.BasePath=o.editorPath;if(o.configPath){oFCKeditor.Config["CustomConfigurationsPath"]=o.configPath+"?"+(new Date()*1);};oFCKeditor.Width="100%";oFCKeditor.Height="100%";oFCKeditor.ReplaceTextarea();fcHTMLControls[o.id].editor=oFCKeditor;}else if(o.editorType=="tinymce"){var elm=document.getElementById(o.id);if(typeof o.editorOptions=="string"){}else{tinyMCE.init(o.editorOptions);};if(tinyMCE.getInstanceById(editorName)==null){};fcHTMLControls[o.id].editor=elm;fcHTMLControls[o.id].loaded=true;}else if(o.editorType=="xinha"){if(typeof Xinha!="undefined"){var c=new Xinha.Config();c.showLoading=true;var ed=new Xinha(editorName,c);fcHTMLControls[o.id].editor=ed;ed.movieId=o.movieId;ed.generate();ed._onGenerate=fcAddBlurHandler;ed.whenDocReady=function(e){fcHTMLControls[o.id].loaded=true;fcDelayedDispatchEvent("htmlCreationComplete",o.movieId,o.id,fcEventTimeoutInterval);}}else{fcHTMLControls[o.id].editor=textareaElement;}};fcAddToGlobalArray(newElement,o);if(String(o.visible)=="false"){fcHide(o.id,true,false);}};function fcAddChildIFrame(o){var newElement=document.createElement("iframe");newElement.id=o.id;newElement.name=o.name;newElement.movieId=o.movieId;newElement.width=o.width;newElement.height=o.height;newElement.frameBorder=o.frameborder;newElement.style.position=o.position;fcSetSize(newElement,o.width,o.height);fcMoveElementTo(newElement,o.x,o.y);newElement.style.zIndex=99;newElement.style.border=o.border;newElement.style.padding=o.padding;newElement.src=o.source;document.body.insertBefore(newElement,dummy);newElement.onload=new function(){fcDelayedDispatchEvent("htmlCreationComplete",o.movieId,o.id,fcEventTimeoutInterval);};newElement.onunload=new function(){fcDispatchEvent("htmlUnload",o.movieId,o.id);};fcAddToGlobalArray(newElement,o);if(String(o.visible)=="false"){fcHide(o.id,true,false);}};function fcAddChildPopUp(o){fcGetIncludes(o.includesBefore);var p=new Object();p.id=o.id;p.content=o.htmlText;p.x=o.x;p.y=o.y;if(String(o.centerPopUp)!="true"){p.x=o.x;p.y=o.y;};p.contentURL=String(o.source);p.bodyBgColor=""+o.backgroundColor;p.title=o.title;p.modal=o.modal;p.width=o.width;p.height=o.height;p.minimizable=o.minimizable;p.maximizable=o.maximizable;p.onContentLoaded=function(e){fcDelayedDispatchEvent("htmlPopUpContentLoaded",o.movieId,o.id,fcEventTimeoutInterval);};p.onFocus=function(e){fcDispatchEvent("htmlPopUpFocus",o.movieId,o.id);};p.onResize=function(e){fcDispatchEvent("htmlPopUpResize",o.movieId,o.id);};p.onMinimize=function(e){fcDispatchEvent("htmlPopUpMinimize",o.movieId,o.id);};p.onMaximize=function(e){fcDispatchEvent("htmlPopUpMaximize",o.movieId,o.id);};p.onClose=function(e){fcDispatchEvent("htmlPopUpClose",o.movieId,o.id);};p.onCloseComplete=function(e){fcDispatchEvent("htmlPopUpCloseComplete",o.movieId,o.id)};if(o.type=="division"){p.loadMethod="html";}else if(o.type=="iframe"){p.loadMethod="iframe";}else if(o.type=="xhr"){p.loadMethod="xhr";};if(String(o.chrome)=="true"&&document.mochaUI){document.mochaUI.newWindow(p,false);};fcAddToGlobalArray(fcGetElement(o.id),o);fcGetIncludes(o.includesAfter);if(String(o.visible)=="false"){};fcDelayedDispatchEvent("htmlCreationComplete",o.movieId,o.id,fcEventTimeoutInterval);if(String(o.alert)=="true"){var newElement=document.createElement("div");newElement.id=o.id+"_alert_buttons";newElement.movieId=o.movieId;newElement.className="mochaAlertButtons";for(var i=0;i<o.alertButtons.length;i++){var button=document.createElement("input");var value=o.alertButtons[i];button.type="button";button.value=value;button.className="mochaAlertButton";button.onclick=function(e){fcDispatchEvent2("htmlAlertHandler",o.movieId,o.id,this.value);var el=fcGetElement(o.id);if(document.mochaUI){document.mochaUI.closeWindow(el);}};newElement.appendChild(button);};var el=fcGetElement(o.id);el.appendChild(newElement);}};function fcEventTrigger(e){if(!e){e=event;};return e.target||e.srcElement;};function fcAddToGlobalArray(el,o){var newElement=new Object();newElement.element=el;newElement.id=o.id;newElement.loaded=false;newElement.type=o.type;newElement.popUp=o.chrome;newElement.alert=o.alert;newElement.movieId=o.movieId;if(o.type=="editor"){newElement.editor=fcHTMLControls[o.id].editor;}else{newElement.editor="";};fcHTMLControls[o.id]=newElement;};function fcCallScript(str){try{var something=eval(str);return something;}catch(e){return false;}};function fcDispatchEvent(eventName,movieId,id){var movie=fcGetMovieById(movieId);movie[eventName](id);};function fcDispatchEvent2(eventName,movieId,id,value){var movie=fcGetMovieById(movieId);movie[eventName](id,value);};function fcDelayedDispatchEvent(eventName,movieId,id,delay){setTimeout("fcDispatchEvent('"+eventName+"','"+movieId+"','"+id+"')",delay);};function fcDefocus(movieId){var movie=fcGetMovieById(movieId);window.focus();movie.focus();};function fcFindPosition(obj){var left=obj.offsetLeft;var top=obj.offsetTop;if(obj.offsetParent){var parentPos=this.fcFindPosition(obj.offsetParent);if(parentPos[0])left+=parentPos[0];if(parentPos[1])top+=parentPos[1];};return [left,top];};function FCKeditor_OnComplete(editorInstance){var editor=fcGetElement(editorInstance.Name);if(editor){fcHTMLControls[editor.parentNode.id].loaded=true;fcDelayedDispatchEvent("htmlCreationComplete",editor.parentNode.movieId,editor.parentNode.id,fcEventTimeoutInterval);}};function fcGetElement(id){return document.getElementById(id);};function fcGetElementHeight(id){var el=fcGetElement(id);moz=(document.getElementById&&!document.all);if(el){try{if(el.nodeName.toLowerCase()=="div"){var scrollHeight=el.scrollHeight;var divHeight=el.style.height;divHeight=(scrollHeight>parseInt(divHeight))?scrollHeight:divHeight;return divHeight;};if(moz){return el.contentDocument.body.scrollHeight;}else if(el.Document){return el.Document.body.scrollHeight;}}catch(e){return -1;}}};function fcGetElementValue(id,elProperty){if(id.indexOf(".")!=-1){var newArr=id.split(".");var elValue="";try{el=window;for(var i=0;i<newArr.length;i++){el=el[newArr[i]];}return el;}catch(e){return -1;}}else{try{var el=fcGetElement(id);var elValue=el[elProperty];return elValue;}catch(e){return -1;}}};function fcGetHTML(id,elementType,editorType,chrome){var el=fcGetElement(id);if(el!=null){if(elementType=="division"&&String(chrome)=="true"){var elContent=fcGetElement(id+"_content");if(elContent!=null){return String(elContent.innerHTML);}}else if(elementType=="division"){return el.innerHTML;}else if(elementType=="editor"){var oEditor;if(editorType=="fckeditor"){if(typeof(FCKeditorAPI)!="undefined"){oEditor=FCKeditorAPI.GetInstance(id+"Editor");if(oEditor){return oEditor.GetXHTML();}}}else if(editorType=="tinymce"){return tinyMCE.getContent(id);}else if(editorType=="xinha"){var ed=fcHTMLControls[id].editor;if(typeof Xinha!="undefined"){return ed.getHTML();};return ed.value;}}};return "";};function fcGetIncludes(includes){var len=includes.length;for(var i=0;i<len;i++){var el=document.createElement("script");el.setAttribute("src",includes[i]);el.setAttribute("type","text/javascript");document.body.appendChild(el);}};function fcGetMovieById(id){if(navigator.appName.indexOf("Microsoft")!=-1){return window[id];}else{if(id==null)id="conference";return window.document[id];}};function fcHide(id,hideOffscreen,offscreenOffset){var el=fcGetElement(id);if(hideOffscreen){};el.style.display="none";};function fcMoveElementTo(el,x,y){var movie=fcGetMovieById(el.movieId);if(fcRelativeMovie){el.style.left=parseInt(x)+fcFindPosition(movie)[0]+"px";el.style.top=parseInt(y)+fcFindPosition(movie)[1]+"px";}else{el.style.left=parseInt(x)+"px";el.style.top=parseInt(y)+"px";}};function fcPromptOnUnload(prompt,message){if(String(prompt)=="true"){window.onbeforeunload=function(e){return message;};}else{window.onbeforeunload=function(e){}}};function fcPurge(d){var a=d.attributes,i,l,n;if(a){l=a.length;for(i=0;i<l;i+=1){n=a[i].name;if(typeof d[n]==="function"){d[n]=null;}}};a=d.childNodes;if(a){l=a.length;for(i=0;i<l;i+=1){fcPurge(d.childNodes[i]);}}};function fcRefresh(id){var el=fcGetElement(id);el.style.cssText=el.style.cssText;};function fcRemove(id){var el=fcGetElement(id);var elParent=el.parentNode;fcPurge(el);fcHTMLControls[id]=null;elParent.removeChild(el);};function fcSetClip(id,top,right,bottom,left){var el=fcGetElement(id);if(el!=null){el.style.clip="rect("+top+" "+right+" "+bottom+" "+left+")";}};function fcSetDocumentTitle(title){window.document.title=title;};function fcSetHTML(id,htmlText,elementType,editorType,chrome){var el=fcGetElement(id);if(el!=null){if(elementType=="division"&&String(chrome)=="true"){var elContent=fcGetElement(id+"_content");elContent.innerHTML=htmlText;}else if(elementType=="division"){el.innerHTML=htmlText;}else if(elementType=="editor"){var oEditor;if(editorType=="fckeditor"){if(typeof(FCKeditorAPI)!="undefined"){oEditor=FCKeditorAPI.GetInstance(id+"Editor");if(oEditor){oEditor.SetHTML(htmlText);}}}else if(editorType=="tinymce"){var editor=tinyMCE.getInstanceById(id+"Editor");editor.setHTML(htmlText);}else if(editorType=="xinha"){var ed=fcHTMLControls[id].editor;if(typeof Xinha!="undefined"){ed.setEditorContent(htmlText);}else{ed.value=htmlText;}}}}};function fcSetPosition(id,x,y){var el=fcGetElement(id);var movie=fcGetMovieById(fcHTMLControls[id].movieId);if(fcHTMLControls[id].popUp==true)return;if(x!=undefined){el.style.left=parseInt(x)+fcFindPosition(movie)[0]+"px";};if(y!=undefined){el.style.top=parseInt(y)+fcFindPosition(movie)[1]+"px";}};function fcSetScrollPolicy(el,overflow){if(overflow!="resize"){el.style.overflow=overflow;}};function fcSetRelativeMovie(isRelative){fcRelativeMovie=(String(isRelative)!="false")?true:false;};function fcSetScrollPolicyById(id,overflow){var el=fcGetElement(id);if(overflow!="resize"){el.style.overflow=overflow;}};function fcSetSize(el,w,h){if(String(w)!="undefined"&&String(w)!=""){if(String(w).indexOf("%")!=-1){el.style.width=w;}else{el.style.width=parseInt(w)+"px";}};if(String(h)!="undefined"&&String(h)!=""){if(String(h).indexOf("%")!=-1){el.style.height=h;}else{el.style.height=parseInt(h)+"px";}}};function fcSetSizeByValue(id,w,h){var el=fcGetElement(id);if(el.style.display=="none"){return;}if(fcHTMLControls[id].popUp==true){return;}if(String(w)!="undefined"&&String(w)!=""){if(String(w).indexOf("%")!=-1){el.style.width=w;}else{el.style.width=parseInt(w)+"px";}};if(String(h)!="undefined"&&String(h)!=""){if(String(h).indexOf("%")!=-1){el.style.height=h;}else{el.style.height=parseInt(h)+"px";}}};function fcSetSource(id,source){var el=fcGetElement(id);el.src=source;};function fcShow(id,hideOffscreen,left,width,height){var el=fcGetElement(id);el.style.display="block";if(hideOffscreen){}};function fcFlexOnload(movieId){fcHTMLControls.pageLoaded="true";}