
ORYANOO=Class.create();ORYANOO.prototype={marginT:0,marginL:170,site_title:'',admFlag:false,userid:'',demo:false,poweredby:'',colors:[],menu_data:[],favourite_data:[],initialize:function(){},starter:function(uri){new Ajax.Request(url='/intranet-e/page/ws_init.ies',{onSuccess:function(xhr){content=xhr.responseText.evalJSON();ies.window=new ORYANOO.window;if(content.status=='login'){ies.window.login_dialog(uri);}else{ies.window.vd_load(uri);}}});}}
var Synthesis=function(){}
ORYANOO.userid='';ORYANOO.framework=function(){}
ORYANOO.Tree=Class.create();ORYANOO.Tree.prototype={divId:null,url:null,id:0,data:[],t_selected_id:[],initialize:function(param){if(param.divId)this.divId=param.divId;if(param.url)this.url=param.url;},dataGetAndDraw:function(id,includeRootFlag){if(!this.url)return false;if(id)this.id=id;var html='';new Ajax.Request(this.url,{method:'post',parameters:{ieAction:'ws_get',id:this.id,includeRootFlag:includeRootFlag},onSuccess:function(xhr){content=xhr.responseText.evalJSON();content.tree.each(function(c){this.data[c.id]=c;html+=this.node(c);}.bind(this));if(this.id&&$(this.divId+'_children_'+this.id)){$(this.divId+'_children_'+this.id).update(html);var childrenFlag=true;}else{$(this.divId).update(html);var childrenFlag=false;}
Position.includeScrollOffsets=true;$$('#'+this.divId+(childrenFlag?'_children_'+this.id:'')+' .node').each(function(obj){new Draggable(obj,{revert:true,ghosting:true,delay:200,scroll:this.divId,scrollSensitivity:1,zindex:1000});Droppables.add(obj.id,{hoverclass:'nodeDdOnOver',onDrop:function(draged,droped,e){this.node_move(draged.id.split('_')[2],droped.id.split('_')[2]);Event.stop(e);}.bind(this)});Event.observe(obj,"click",function(e){this.clickHandler(e);Event.stop(e);}.bind(this));Event.observe(obj,"mouseover",function(e){$(obj.id.replace('_node_','_context_')).style.visibility='visible';Event.stop(e);}.bind(this));Event.observe(obj,"mouseout",function(e){$(obj.id.replace('_node_','_context_')).style.visibility='hidden';Event.stop(e);}.bind(this));Event.observe(obj,"contextmenu",function(e){this.context(obj.id);Event.stop(e);}.bind(this));}.bind(this));if(includeRootFlag)this.link(id);}.bind(this)});},node:function(dataNode){this.data[dataNode.id]=dataNode;var html='';var cl=(dataNode.children.length>0||dataNode.children_count>0)?((getCookie(this.divId+this.id)==null)?'expand':'reduce'):'neutral';html+='<div class="node" id="'+this.divId+'_node_'+dataNode.id+'">';html+='<div class="'+cl+'" id="'+this.divId+'_expand_'+dataNode.id+'"></div>';html+='<div class="nodeImage" '+(dataNode.color?'style="background-color:'+rgba(dataNode.color,1)+'"':'')+'><img src="/html/cm/img/'+(dataNode.image?dataNode.image:'folder2.png')+'" width="16" height="16" /></div>';html+='<div class="nodeContextButton" id="'+this.divId+'_context_'+dataNode.id+'" style="visibility:hidden"></div>';html+='<a class="nodeLabel" id="'+this.divId+'_link_'+dataNode.id+'" href="#">'+dataNode.label+'</a>';if(dataNode.notes){html+='<div class="nodeNotes" id="'+this.divId+'_notes_'+dataNode.id+'" style="display:none;background-color:'+rgba(dataNode.color,0.2)+'">'+dataNode.notes+'</div>';}
html+='</div>';html+='<div class="nodeChild" id="'+this.divId+'_children_'+dataNode.id+'" style="display:none">';dataNode.children.each(function(c){html+=this.node(c);}.bind(this));html+='</div>';return html;},clickHandler:function(e){var target_type=e.target.id.split('_')[1];switch(target_type){case'expand':this.expand(e.target.id.split('_')[2]);break;case'link':this.link(e.target.id.split('_')[2]);break;case'context':this.context(e.target.id.split('_')[2]);break;default:break}},expand:function(id,force,reset){var childrenId=this.divId+'_children_'+id;var expandId=this.divId+'_expand_'+id;if($(childrenId).style.display!='none'&&!force){$(childrenId).fade();$(expandId).className='expand';}else{if(reset){this.node_children_reset(id);}
if(!$(childrenId).innerHTML){$(childrenId).update('<img src="/html/cm/img/wait3.gif" width="16" height="16" alt="" />');this.dataGetAndDraw(id);}
$(childrenId).appear();$(expandId).className='reduce';}},node_children_reset:function(id){$(this.divId+'_children_'+id).update();},node_parent_id:function(id){var tid=$(this.divId+'_node_'+id).ancestors()[0].id.split('_');return tid[2]?tid[2]:0;},link:function(id){if(this.id){$(this.divId+'_link_'+this.id).style.fontWeight='normal';if($(this.divId+'_notes_'+this.id))$(this.divId+'_notes_'+this.id).hide();}
this.id=id;$(this.divId+'_link_'+this.id).style.fontWeight='bold';if($(this.divId+'_notes_'+this.id))$(this.divId+'_notes_'+this.id).show();divScrollTo(this.divId,this.divId+'_node_'+this.id,{effect:true,middle:true});this.open(id);},node_delete:function(id,go){var dialog=new ORYANOO.dialog('dialogDiv');if(!go){dialog.title({value:lang('warning'),color:'red'});dialog.text({value:$(this.divId+'_link_'+id).innerHTML+"\n\n"+lang("you are on the point of definitively removing the selected files"),style:'width:400px;height:80px;background-color:#FFF;border:1px solid #999;padding:4px'});dialog.button({text:lang('delete'),color:'red',link:"new ORYANOO.Tree({divId:'"+this.divId+"',url:'"+this.url+"'}).node_delete('"+id+"',true)"});dialog.draw();}else{new Ajax.Request(url=this.url,{method:'post',parameters:{ieAction:'node_delete',category_id:id},onCreate:function(){dialog.status(lang('please wait'),'orange');},onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){dialog.status('ok ...','green');this.expand(this.node_parent_id(id),true,true);}else{dialog.status(content.status,'red');}}.bind(this)});}},node_move:function(draged_id,droped_id){if(this.t_selected_id.length>0){draged_id=this.t_selected_id.join(',');}
new Ajax.Request(url=this.url,{method:'post',parameters:{ieAction:'node_move',draged_id:draged_id,droped_id:droped_id},onCreate:function(){$(this.divId+'_node_'+droped_id).style.backgroundColor=bg_colors['orange'];}.bind(this),onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){$(this.divId+'_node_'+droped_id).style.backgroundColor='';if($(this.divId+'_node_'+draged_id)){$(this.divId+'_node_'+draged_id).remove();$(this.divId+'_children_'+draged_id).remove();this.expand(droped_id,true,true);}else{this.link(this.id,true,true);}}else{$(this.divId+'_node_'+droped_id).style.backgroundColor=bg_colors['red'];}}.bind(this)});},open:function(id){},context:function(){}}
ORYANOO.Tree1=function(divId){this.init(divId);}
ORYANOO.Tree1.nodeCount=0;ORYANOO.Tree1.prototype={divId:null,init:function(divId){this.divId=divId;this.root=new ORYANOO.Node(null,null,null,this.divId);},draw:function(){$(this.divId).innerHTML=this.root.draw();},getRoot:function(){return this.root;}}
ORYANOO.Node=function(nText,nParent,askedId,treeDivId){this.init(nText,nParent,askedId,treeDivId);}
ORYANOO.Node.prototype={id:0,text:null,onclick:null,parent:null,children:null,image:null,divId:null,init:function(nText,nParent,askedId,treeDivId){this.id=askedId>0?askedId:ORYANOO.Tree1.nodeCount;this.text=nText;this.children=[];ORYANOO.Tree1.nodeCount++;if(nParent){this.parent=nParent;nParent.appendChild(this);this.divId=nParent.divId;}
if(treeDivId){this.divId=treeDivId;}},appendChild:function(node){this.children[this.children.length]=node;return node;},expandLink:function(id){return"new ORYANOO.Node().expand('"+this.id+"','"+this.divId+"')";},draw:function(){var cl=(this.children.length>0)?((getCookie(this.divId+this.id)==null)?'expandOld':'reduceOld'):'neutralOld';var html='';if(this.text){html+='<div id="'+this.divId+'_expandDiv'+this.id+'" class="'+cl+'" onclick="javascript:'+this.expandLink()+'"></div>';html+='<div class="nodeOld" id="'+this.divId+'_nodeDiv'+this.id+'" ';if(this.oncontextmenu){html+='oncontextmenu="'+this.oncontextmenu+';return false" ';html+='onmouseover="new ORYANOO.Node(null,null,null,\''+this.divId+'\').nodeOver(\''+this.id+'\')" ';html+='onmouseout="new ORYANOO.Node(null,null,null,\''+this.divId+'\').nodeOut(\''+this.id+'\')" ';}
if(this.image)html+='style="background-image:url('+this.image+')" ';html+='>';html+='<div id="'+this.divId+'_nodeDivContextButton'+this.id+'" class="nodeContextButton" style="display:none" onclick="'+this.oncontextmenu+'"></div>';html+=this.text;html+='</div>';html+='<div id="'+this.divId+'_nodeChildDiv'+this.id+'" class="nodeChild" style="display:'+((getCookie(this.divId+this.id)==null)?'none':'block')+'">';}
this.children.each(function(child){html+=child.draw();});if(this.text)html+='</div>';return html;},nodeOver:function(id){$(this.divId+'_nodeDivContextButton'+id).show();$(this.divId+'_nodeDiv'+id).setStyle({backgroundColor:'#EEE'});},nodeOut:function(id){$(this.divId+'_nodeDivContextButton'+id).hide();$(this.divId+'_nodeDiv'+id).setStyle({backgroundColor:'#FFF'});},expand:function(id,divId,force){if(!$(divId+'_nodeChildDiv'+id).innerHTML){setCookie(divId+id,1);return;}
if($(divId+'_nodeChildDiv'+id).style.display=='block'&&!force){$(divId+'_nodeChildDiv'+id).style.display='none';$(divId+'_expandDiv'+id).className='expandOld';deleteCookie(divId+id);}else{$(divId+'_nodeChildDiv'+id).style.display='block';$(divId+'_expandDiv'+id).className='reduceOld';setCookie(divId+id,1);}}}
ORYANOO.menu=Class.create();ORYANOO.menu.prototype={data:null,feedback:null,initialize:function(){this.draw();},draw:function(){var menu1='';var menu2='';var menu_entry=function(link,label,image){return'<table class="menu_entry" cellpadding="2" cellspacing="0" border="0" width="100%">'+'<tr onclick="'+link+'">'+'<td align="left" width="40" style="cursor:pointer">'+
(image?'<img src="/html/cm/img/'+image+'" width="16" height="16" style="padding-left:10px;padding-right:10px" alt="" border="0" />':'&nbsp;')+'</td>'+'<td align="left" style="padding-right:16px;cursor:pointer">'+label+'</td>'+'</tr>'+'</table>';}
var menu_separator=function(){return'<hr style="border-left:0;border-right:0px;border-top:1px solid #777;border-bottom:1px solid #FFF" />';}
$H(ies.menu_data).each(function(m){if(m[1].menu){menu1+='<div id="menu1_'+m[1].object+'" class="menu1">'+m[1].label+'</div>';menu2+='<div id="menu2_'+m[1].object+'" class="menu2">';menu2+='<table cellpadding="0" cellspacing="0" border="0"><tr><td>';m[1].menu.each(function(n){if(n.url){if(n.url.substr(0,10)=='javascript'){var onclick=n.url.substr(11);}else{var onclick='ies.window.tab.open(\''+n.url+'\',\''+(n.object?n.object:m[1].object)+'\',\''+(n.label?js_filter(n.label):'')+'\');ies.window.menu.close()';}
menu2+=menu_entry(onclick,n.label,n.image);}else{menu2+=menu_separator();}});if(ies.demo){menu2+=menu_separator();menu2+=menu_entry("javascript:window.open('https://store.extranet-e.net/store/')","Je m'abonne","basket.gif");}
menu2+='</td></tr></table>';menu2+='</div>';}});$('ie_menu').update(menu1);$('ie_menu2').update(menu2);$('ie_menu').setStyle({position:'relative',zIndex:99});$$("#ie_menu2 .menu2").each(function(obj){obj.setStyle({position:'relative'});Element.clonePosition(obj.id,obj.id.replace('menu2_','menu1_'),{setLeft:true,setTop:true,setWidth:false,setHeight:false,offsetLeft:0,offsetTop:((navigator.appName=='Microsoft Internet Explorer'?0:ies.marginT)+$('ie_menu').getHeight()-1)});obj.setStyle({position:'absolute',zIndex:101});obj.hide();}.bind(this));$('ie_menu').observe('mouseover',this.mouseover.bindAsEventListener(this));$('ie_menu2').observe('mouseover',this.mouseover.bindAsEventListener(this));Event.observe(window,'mouseout',this.mouseout.bindAsEventListener(this));},mouseout:function(e){if(!e.relatedTarget)this.close();},mouseover:function(e){if(e.target.id){if(e.target.id=='ie_menu2'){this.close();return true;}
if(e.target.id.indexOf('menu1_')==0){$$("#ie_menu2 .menu2").each(function(obj){this.hide(obj.id);}.bind(this));this.show(e.target.id);$('ie_menu2').show();}}},show:function(id){$(id.replace('menu2_','menu1_')).setStyle({position:'relative',zIndex:'100',backgroundColor:'#EEE'});var queue=Effect.Queues.get('menuscope');queue.each(function(effect){effect.cancel();});new Effect.Appear(id.replace('menu1_','menu2_'),{queue:{position:'end',scope:'menuscope'},delay:0.1,duration:0.4});},hide:function(id){$(id.replace('menu1_','menu2_')).hide();$(id.replace('menu2_','menu1_')).setStyle({position:'relative',zIndex:'98',background:rgba(255,255,255,0)});},close:function(){$$("#ie_menu2 .menu2").each(function(obj){this.hide(obj.id);}.bind(this));$('ie_menu2').hide();}}
ORYANOO.widget=function(){this.init();}
ORYANOO.widget.prototype={id:'',width:null,classname:null,html:'',init:function(){},button:function(param){var html='<a href="#"';if(param.img)html+=' class="iconButton" style="background-image:url(\'/html/cm/img/'+param.img+'\')"';if(param.classname)html+=' class="'+param.classname+'Button"';if(param.alt)html+=' title="'+param.alt+'"';if(param.style)html+=' style="'+param.style+'"';if(param.id)html+=' id="'+param.id+'"';if(param.selectable)html+=' onclick="new ORYANOO.widget().buttonSelect(this);'+param.onclick+';return false"';if(param.onclick&&!param.selectable)html+=' onclick="'+param.onclick+';return false"';html+='>&nbsp;';if(param.text)html+=param.text+'&nbsp;';html+='</a>';this.cell(html);},buttonSelect:function(obj){obj.className=obj.className=='iconButtonSelected'?'iconButton':'iconButtonSelected';obj.blur();},text:function(txt){this.cell('<div class="widgetText">'+txt+'</div>');},input:function(param){f=new ORYANOO.form;if(!param.css)param.css='widgetInput';this.cell(f.input(param));},select:function(param){f=new ORYANOO.form;this.cell(f.select(param));},selectMultiple:function(encoded,action,event){if(encoded){param=decodeURIComponent(encoded).replace(/--blank--/g,' ').evalJSON();}
switch(action){case'go':var value='';var allChecked=true;var noOneChecked=true;$$('.selectCB').each(function(obj){if(obj.checked){value+=(value.length>0?',':'')+obj.value;noOneChecked=false;}else{allChecked=false;}});if($('dialogSearchInput').value.length>0)allChecked=false;if(noOneChecked)allChecked=true;$(param.name).value=allChecked?'none':value;synthesis_widget2('submit','',param.name);break;case'checkAll2':$('selectCbAll').checked=!$('selectCbAll').checked;case'checkAll':var checked=$('selectCbAll').checked;$$('.selectCB').each(function(obj){obj.checked=checked;});break;case'search':var html='<table border="0" cellspacing="1" width="100%" class="synthesis">';var tr_class='rowOn';var t_checked=$(ORYANOO.widget.param.name).value.split(',');var allChecked=($(ORYANOO.widget.param.name).value=='none');var searchText=$('dialogSearchInput').value.toLowerCase();html+='<tr class="thead1"><td><input type="checkbox" id="selectCbAll" '+(allChecked?'checked="checked"':'')+' onclick="new ORYANOO.widget().selectMultiple(null,\'checkAll\')"></td><td>'+lang('select all')+'</td></tr>';ORYANOO.widget.param.values.each(function(row){if(row.value!='none'){if(row.text.toLowerCase().indexOf(searchText)>=0){html+='<tr class="'+tr_class+'"><td style="width:10%"><input type="checkbox" class="selectCB" value="'+row.value+'" '+(allChecked||t_checked.indexOf(row.value)!=-1?'checked="checked"':'')+'></td><td>'+row.text+'</td></tr>';tr_class=(tr_class=='rowOn'?'rowOff':'rowOn');}}else{if(row.field)$('dialogTitle').innerHTML=lang("edit filter")+' '+lang(row.field);}});html+='</table>';$('selectDiv').innerHTML=html;if(event&&event.keyCode==13)this.selectMultiple(null,'go');break;default:var dialog=new ORYANOO.dialog();dialog.title({id:'dialogTitle',color:'grey'});dialog.input({id:'dialogSearchInput',style:'overflow:auto;width:380px;background-color:#FFF;border:1px solid #999;margin-bottom:1px',css:'search',onkeyup:"new ORYANOO.widget().selectMultiple(null,'search',event)"});dialog.text({id:'selectDiv',style:'overflow:auto;width:400px;height:235px;background-color:#FFF;border:1px solid #999;padding:4px'});dialog.button({text:lang('OK'),color:'grey',link:"new ORYANOO.widget().selectMultiple(null,'go')"});dialog.button({text:lang('select all'),color:'grey',link:"new ORYANOO.widget().selectMultiple(null,'checkAll2')"});dialog.draw();ORYANOO.widget.param=param;this.selectMultiple(null,'search');$('dialogSearchInput').focus();break;}},separator:function(){this.html+='<div class="wdgsep">&nbsp;</div>';},raw:function(content){this.cell(content);},cell:function(content){this.html+='<div class="widgetElement">'+content+'</div>';},draw:function(){return'<div class="widget">'+this.html+'</div>';}}
ORYANOO.scan=function(){}
ORYANOO.scan.scanInProgress=false;ORYANOO.scan.prototype={listen:function(){$('scanInput').focus();},onkeyup:function(forceReadNow){if(!forceReadNow&&ORYANOO.scan.scanInProgress)return;if(!ORYANOO.scan.scanInProgress){ORYANOO.scan.scanInProgress=true;this.onkeyup.delay(0.3,true);return;}
var scanInput=$('scanInput').value;ORYANOO.scan.scanInProgress=false;$('scanInput').value='';if(ORYANOO.scan.scan_done)ORYANOO.scan.scan_done(scanInput);},onfocus:function(){$('scanInput').setStyle({backgroundColor:'#9FC'});$('scanInput').value='';$('scanStatus').update(lang('ready_to_scan'));},onblur:function(){$('scanInput').setStyle({backgroundColor:'#F99'});$('scanInput').value=lang('click_here_to_scan');$('scanStatus').update(lang('scan_stopped'));}}
ORYANOO.tab=Class.create();ORYANOO.tab.prototype={button_container_div_id:null,content_container_div_id:null,initialize:function(button_container_div_id,content_container_div_id){this.button_container_div_id=button_container_div_id;this.content_container_div_id=content_container_div_id;},open:function(url,id,label){var ref_button='';var reloadFlag=true;if(id){if(id=='unik'){var jsDate=new Date();id=this.button_container_div_id+'_'+jsDate.getMilliseconds();}
ref_button=this.button_container_div_id+':button:'+id;}
if(!$(ref_button)){var ref_content=ref_button.replace(':button:',':content:');var tab_container='<div id="'+ref_button+'" '+'class="'+this.button_container_div_id+'_tab_button" '+'style="float:left;overflow:visible;margin:0px 0px 0px 4px;height:30px"'+'onmouseover="new ORYANOO.tab(\''+this.button_container_div_id+'\',\''+this.content_container_div_id+'\').button_style(this,\'over\')"'+'onmouseout="new ORYANOO.tab(\''+this.button_container_div_id+'\',\''+this.content_container_div_id+'\').button_style(this,\'off\')"'+'>'+'<div class="tab_button" id="'+ref_button+'_content"></div>'+'</div>';$(this.button_container_div_id).update($(this.button_container_div_id).innerHTML+tab_container);reloadFlag=false;}
var html='';var method='';if(url.indexOf('/')<0){if(url.indexOf('(')<0){eval('html = '+url+'();');}else{eval('html = '+url+';');}}else{var frame_id=ref_button.replace(':button:','_iframe_');if(url.indexOf('//')<0){html='<iframe name="'+frame_id+'" id="'+frame_id+'" class="container1" style="display:none" src="'+url+'" frameborder="0" scrolling="no"></iframe>';}else{html='<iframe name="'+frame_id+'" id="'+frame_id+'" class="container1" src="'+url+'" frameborder="0" scrolling="yes"></iframe>';}}
$(ref_button).writeAttribute({o_label:label?label:lang('loading')});$(ref_button).writeAttribute({o_url:url});$(ref_button).writeAttribute({o_id:id});this.button_draw(ref_button);if(reloadFlag){$(ref_button.replace(':button:',':content:')).update(html);}else{$(this.content_container_div_id).insert('<div id="'+ref_content+'" class="'+this.button_container_div_id+'_tab_content" style="width:100%;height:100%;display:block;visibility:visible;position:absolute;">'+html+'</div>');}
if(frame_id){$(frame_id).setStyle({height:($('ie_main').getHeight()-10)+'px'});$(frame_id).setStyle({width:($('ie_main').getWidth()-10)+'px'});$(frame_id).appear();}
this.show(ref_button);},set_tab_label:function(label,ref_button){ref_button=ref_button.replace(this.button_container_div_id+':button:','');if($(this.button_container_div_id+':button:'+ref_button)){$(this.button_container_div_id+':button:'+ref_button).writeAttribute({'o_label':label});this.button_draw(ref_button);}},button_style:function(bId,action,force){$(bId).childElements().each(function(a){var selected=(a.getStyle('backgroundColor').substr(0,8)=='rgba(255');if(!selected||force){switch(action){case'off':color='#000';bgcolor=rgba(0,0,0,0.1);break;case'over':color='#000';bgcolor='#FA0';break;case'on':color='#000';bgcolor=rgba(255,255,255,0.2);break;default:break;}
a.setStyle({color:color,backgroundColor:bgcolor});}});},button_draw:function(ref_button){ref_button=ref_button.replace(this.button_container_div_id+':button:','');var html='';html+='<div style="cursor:pointer;padding:8px;float:left" onclick="new ORYANOO.tab(\''+this.button_container_div_id+'\',\''+this.content_container_div_id+'\').show(\''+ref_button+'\')" >'+$(this.button_container_div_id+':button:'+ref_button).readAttribute('o_label')+'</div><div onclick="new ORYANOO.tab(\''+this.button_container_div_id+'\',\''+this.content_container_div_id+'\').remove(\''+ref_button+'\')" style="cursor:pointer;padding:8px;float:left"><div class="close"></div></div>';$(this.button_container_div_id+':button:'+ref_button+'_content').update(html);},show:function(divId){divId=this.button_container_div_id+':button:'+divId.replace(this.button_container_div_id+':button:','');if(!$(divId))return false;this.button_container_div_id=divId.split(':')[0];var count=divId.split(':')[2];var lastId='';if(count>0&&!$(divId))return false;$$('#body .'+this.button_container_div_id+'_tab_content').each(function(div){div.style.visibility='hidden';div.style.zIndex=1;});$$('#body .'+this.button_container_div_id+'_tab_button').each(function(div){this.button_style(div.id,'off',true);}.bind(this));this.stack_remove(divId);this.stack_set_top(divId);$(divId.replace(':button:',':content:')).style.visibility='visible';$(divId.replace(':button:',':content:')).style.zIndex=10;this.button_style(divId,'on',true);Sortable.create(this.button_container_div_id,{tag:'div',overlap:'horizontal',constraint:'horizontal'});if($(divId).readAttribute('o_url').indexOf('/')<0){var url=$(divId).readAttribute('o_url');var pos=url.indexOf('(');var func=(pos>0?url.substr(0,pos):url)+'_event';if(typeof func=='string'&&eval('typeof '+func)=='function'){eval(func+'();');}}else{ies.window.handlerInit();ORYANOO.keydown_manage=function(e){}
ORYANOO.mouseup_manage=function(e){}
ORYANOO.mousedown_manage=function(e){}
ORYANOO.mousemove_manage=function(e){}}},remove:function(divId){divId=this.button_container_div_id+':button:'+divId.replace(this.button_container_div_id+':button:','');this.button_container_div_id=divId.split(':')[0];var contentId=divId.replace(':button:',':content:');$(contentId).fade({afterFinish:function(){$(contentId).remove();}});$(divId).fade({afterFinish:function(){$(divId).remove();},duration:0.1});var cur=this.stack_get_top(divId);if(cur.id){this.show(cur.id);}},stack_remove:function(divId){var stack=[];this.button_container_div_id=divId.split(':')[0];$$('#body .'+this.button_container_div_id+'_tab_button').each(function(div){if(div.id!=divId)stack[parseInt(div.style.zIndex)]=div.id;});stack.each(function(id,zindex){if(id)$(id).style.zIndex=zindex;});$(divId).style.zIndex=0;},stack_set_top:function(divId){this.button_container_div_id=divId.split(':')[0];var lastTab=this.stack_get_top(divId);$(divId).style.zIndex=(lastTab.zIndex?lastTab.zIndex:0)+1;},stack_get_top:function(excludeDivId){var max=0;var id='';$$('#body .'+this.button_container_div_id+'_tab_button').each(function(div){if(div.style.zIndex&&parseInt(div.style.zIndex)>max&&div.id!=excludeDivId){max=parseInt(div.style.zIndex);id=div.id;}});return{id:id,zIndex:max};}}
ORYANOO.history=Class.create();ORYANOO.history.prototype={data:[],initialize:function(){var html='';var widget1=new ORYANOO.widget;widget1.button({classname:'close',alt:lang('close this window'),onclick:"ies.window.history.show_hide()"});widget1.separator();widget1.text(lang('history'));html+='<div id="history_container" class="container1" style="width:146px;display:none">';html+='<div class="widgetBg" style="height:32px">'+widget1.draw()+'</div>';html+='<div id="historyDiv" class="container2" style="width:146px">';html+='</div>';html+='</div>';$('ie_left').update(html);$('history_container').appear();},add:function(url,label,object,image){var newdata=[];for(i=0;i<this.data.length;i++){if(url!=this.data[i].url)newdata[newdata.length]=this.data[i];}
newdata[newdata.length]={url:url,label:label,object:object,image:image};this.data=newdata;this.draw();},draw:function(){var html='';for(i=this.data.length-1;i>=0;i--){var h=this.data[i];html+='<img src="/html/cm/img/'+h.image+'" style="vertical-align:middle; margin:4px;" />'+'<a href="#" onclick="ies.window.tab.open(\''+h.url+'\',\''+h.object+'\',\''+js_filter(h.label)+'\'); return false" title="'+h.label+'">'+h.label+'</a><br/>';};$('historyDiv').update(html);},show_hide:function(){top.Effect.toggle('ie_left','slide',{scaleX:true,scaleY:false,afterFinish:function(){top.ies.window.resize_manage();}});}}
ORYANOO.canvas=function(){this.init();}
ORYANOO.canvas.prototype={id:'canvas_',nb_col:2,t_width:['60%','40%'],t_containment:[],t_html:[],title:null,init:function(){this.t_html=[];this.t_containment=[];for(var i=0;i<this.nb_col;i++){this.t_html[i]='';}},container:function(html,col){if(!col)col=0;this.t_html[col]+=html;},draw:function(){var html='';ORYANOO.resize_info={canvas_content:0};html+='<div id="canvas_content" style="overflow:auto">';for(var i=0;i<this.nb_col;i++){html+='<div id="'+this.id+i+'" style="float:left;width:'+this.t_width[i]+'">'+this.t_html[i]+'</div>';this.t_containment[i]=this.id+i;}
html+='</div>';this.t_html=[];ORYANOO.resize_manage();Position.includeScrollOffsets=true;for(var i=0;i<this.nb_col;i++){Sortable.create(this.id+i,{tag:'div',overlap:'horizontal',constraint:false,only:'container',scroll:'canvas_content',containment:this.t_containment,onUpdate:function(){}});}}}
ORYANOO.window=Class.create();ORYANOO.window.prototype={ctlFlag:false,shiftFlag:false,menu:null,tab:null,left:null,email_uidnext:null,sound_status:true,initialize:function(){this.tab=new ORYANOO.tab('ie_tab','ie_main');},login_dialog:function(uri){var widget1=new ORYANOO.widget;$A(['br','de','en','es','fr','nl']).each(function(lg){widget1.button({classname:'generic',text:lg.toUpperCase(),onclick:"location='?langsel="+lg+"'"});});var widget2=new ORYANOO.widget;widget2.button({classname:'generic',text:lang('enter'),onclick:"ies.window.login_submit()"});var html='';if(browser_support==1){html+='<div class="loginNavigatorNotSupported">';html+=lang('navigator_not_fully_supported').replace('LINKSTART','<a href="/html/browsers.ies" class="loginNavigatorNotSupported">').replace('LINKSTOP','</a>');html+='</div>';}
html+='<div id="loginWidgetDiv" style="top:200px;left:200px;display:none;">';html+=widget1.draw()+'<div style="clear:both;height:8px"></div>';if(browser_support>0){html+='<div style="float:right;height:24px">';html+='<span style="font-weight: bold">'+lang('username')+'&nbsp;&nbsp;</span>';html+='<input id="logininput" type="text" class="textInput" style="width: 150px" maxlength="100" value="" onkeypress="ies.window.login_keypress(event,this)" />';html+='</div>';html+='<div style="float:right;height:24px">';html+='<span style="font-weight: bold">'+lang('password')+'&nbsp;&nbsp;</span>';html+='<input id="passwdinput" type="password" class="textInput" style="width: 150px" maxlength="100" value="" onkeypress="ies.window.login_keypress(event,this)" />';html+='</div>';html+='<div style="float:right;width:152px;padding:4px">'+widget2.draw()+'</div><div style="clear:both"></div>';html+='<div id="loginS" style="color:#000">'+lang('please enter your access codes')+'</div>';if(register.length>0)html+='<div style="padding:4px 4px 4px 9px"><a href="/intranet-e/register">'+register+'</a></div>';}else{html+='<div class="loginNavigatorNotSupported" style="margin:0px">';html+=lang('navigator_not_supported').replace('LINKSTART','<a href="/html/browsers.ies" class="loginNavigatorNotSupported">').replace('LINKSTOP','</a>');html+='</div>';}
html+='</div>';html+='<input type="hidden" id="uri" value="'+uri+'">';$('body').update(html);$('loginWidgetDiv').appear();new Draggable('loginWidgetDiv');$('logininput').focus();setTimeout("$('logininput').focus()","2000");},login_submit:function(){if(!$('logininput')||$('logininput').value.length==0){$('loginS').appear();$('loginS').innerHTML=lang('empty login');$('loginS').setColor('red');$('loginS').fade({duration:5});$('logininput').focus();return false;}
if(!$('passwdinput')||$('passwdinput').value.length==0){$('loginS').appear();$('loginS').innerHTML=lang('empty password');$('loginS').setColor('red');$('loginS').fade({duration:5});$('passwdinput').focus();return false;}
new Ajax.Request(url='/intranet-e/page/ws_init.ies',{method:'post',parameters:{ieAction:'login',login:$('logininput').value,passwd:$('passwdinput').value},onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status!='ok'){if(content.status=='nok')$('loginS').innerHTML=lang('badlogin');if(content.status=='locked')$('loginS').innerHTML=lang('too many failure');$('loginS').setColor('red');$('loginS').show();$('loginS').fade({duration:5});}else{ies.starter($('uri').value);}}});},login_keypress:function(e,obj){if(navigator.appName=='Netscape'){k=e.keyCode;}else if(window.event){k=window.event.keyCode;}
switch(k){case 13:switch(obj.id){case'logininput':$('passwdinput').focus();break;case'passwdinput':ies.window.login_submit();break;default:break;}
break;default:break;}},vd_load:function(uri){new Ajax.Request(url='/intranet-e/page/ws_init.ies',{method:'post',parameters:{ieAction:'menu'},onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){ies.poweredby=content.hide_poweredby;ies.version=content.version;ies.marginT=parseInt(content.top_height);ies.site_title=content.site_title;ies.admFlag=content.admFlag;ies.userid=content.userid;ies.demo=content.demo;ies.colors=content.colors;ies.lang=content.lang;ies.ofile=content.ofile;ies.menu_data=content.menu;ies.favourite_data=content.favourite;var html='';html+='<div id="ie_top"><img src="/intranet-e/page/image.ies?object=logo" /></div>';html+='<div id="ie_menu"></div>';html+='<div id="ie_tab"></div>';html+='<div id="ie_left"></div>';html+='<div id="ie_main"></div>';html+='<div id="ie_bottom"> <div id="footer1"></div> <div id="footer2"></div> <div id="footer3"></div> </div>';html+='<div id="label" style="display:none"></div>';html+='<div id="ie_menu2" style="display:none;position:absolute;top:0;left:0;z-index:98;width:100%;height:100%"></div>';$('body').update(html);if(navigator.appName=='Microsoft Internet Explorer')this.resize_manage();this.menu=new ORYANOO.menu();this.history=new ORYANOO.history();setTimeout("ies.window.PeriodicalUpdater()",10000);this.resize_manage();this.handlerInit();if(!uri)uri='/intranet-e/page/';setTimeout("ies.window.tab.open('"+uri+"','home')","1000");$('footer1').update('&nbsp;'+ies.poweredby);$('footer3').update(ies.version+'&nbsp;&nbsp;&nbsp;<img id="soundStatusImg" src="/html/cm/img/sound_on.png" alt="" align="absbottom" style="cursor:pointer" onclick="ies.window.sound_on_off();" />&nbsp;');this.resize_manage();}}.bind(this)});},PeriodicalUpdater:function(){var timer=60;setTimeout("ies.window.PeriodicalUpdater()",timer*1000);new Ajax.Request(url='/intranet-e/page/autoupdate.ies',{method:'get',onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){var html='';if(content.data.email){this.title_update({email:content.data.email.unread});html+='<a href="#" onclick="ies.window.tab.open(\'ies.email.screen_1\',\'email\',\''+lang('Messages')+'\');return false">'+lang('unread messages')+' : '+content.data.email.unread+'</a>';if(content.data.email.unread>0&&this.email_uidnext&&this.email_uidnext!=content.data.email.uidnext&&!content.data.notification){if(content.data.email.signal=='sound')this.sound_alert('mail');if(content.data.email.signal=='popup')alert(content.data.email.unread>1?lang('you have x new messages!').replace('%1',content.data.email.unread):lang('you have 1 new message!'));}
this.email_uidnext=content.data.email.uidnext;}
if(content.data.user){html+=(html.length>0?'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;':'')+'<a href="#" onclick="ies.window.tab.open(\'/intranet-e/admin/currentusers.ies\',\'admin_security\'); return false">'+lang('current users')+' : '+content.data.user.length+'</a>';}
$('footer2').update(html);if(content.data.notification){this.sound_alert('event');html='';$A(content.data.notification).each(function(m){html+=m+'<hr/>';});dialog=new ORYANOO.dialog();dialog.modal=false;dialog.title({value:content.data.notification.length>1?lang('x new messages!').replace('%1',content.data.notification.length):lang('1 new message!'),color:'yellow'});dialog.text({value:html,style:'background-color:#FFF;border:1px solid #999;padding:4px;height:200px;overflow:auto'});dialog.draw();$(dialog.divId).hide();$(dialog.divId).style.top='-400px';$(dialog.divId).style.left='100px';$(dialog.divId).show();new Effect.Move(dialog.divId,{x:0,y:550,mode:'relative',delay:2,duration:2,transition:Effect.Transitions.sinoidal});}
if(content.data.monitoring){$('ie_top').style.backgroundColor=content.data.monitoring.color;top.document.title=content.data.monitoring.title;if(content.data.monitoring.level>0){this.sound_alert('alert');}}}}.bind(this)});},sound_on_off:function(){if(this.sound_status){$('soundStatusImg').src='/html/cm/img/sound_off.png';this.sound_status=false;}else{$('soundStatusImg').src='/html/cm/img/sound_on.png';this.sound_status=true;}},sound_alert:function(sound){if(this.sound_status){Sound.play('/html/cm/audio/'+sound+'.mp3');}},set_tab_label:function(label,tabId){if(!tabId||tabId=='unik'){tabId=this.get_my_tab();}
this.tab.set_tab_label(label,tabId);},get_my_tab:function(){var tabId='';$$('#body .ie_tab_tab_content').each(function(a){if(a.style.visibility!='hidden'){tabId=a.id.replace(':content:',':button:');}});return tabId;},close_my_tab:function(){this.tab.remove(this.get_my_tab());},handlerInit:function(){Event.observe(window,'resize',this.resize_manage);Event.observe(document,'keydown',this.keydown_manage);Event.observe(document,'mouseup',this.mouseup_manage);Event.observe(document,'mousedown',this.mousedown_manage);Event.observe(document,'mousemove',this.mousemove_manage);},keydown_manage:function(e){ORYANOO.keydown_manage(e);},mousedown_manage:function(e){ORYANOO.mousedown_manage(e);},mouseup_manage:function(e){ORYANOO.mouseup_manage(e);},mousemove_manage:function(e){if(Event.pointerX){xMouse=Event.pointerX(e);yMouse=Event.pointerY(e);ORYANOO.mousemove_manage(e);}},resize_manage:function(e){if(document.all){winW=document.documentElement.clientWidth;winH=document.documentElement.clientHeight;}else{winW=window.innerWidth+window.pageXOffset;winH=window.innerHeight+window.pageYOffset;}
var left_width=0;var bottom_height=0;if($('ie_top')){var left_width=$('ie_left').getStyle('display')!='none'?$('ie_left').getWidth():0;var bottom_height=20;var menu_height=20;var tab_height=35;var tab_bottom=0;var y=0;if(ies.marginT>0){$('ie_top').style.width=winW+'px';$('ie_top').style.height=ies.marginT+'px';y+=ies.marginT;}
$('ie_menu').style.top=y+'px';$('ie_menu').style.position='absolute';$('ie_menu').style.left='0px';$('ie_menu').style.height=menu_height+'px';$('ie_menu').style.overflow='hidden';y+=menu_height;$('ie_tab').style.top=y+'px';$('ie_tab').style.left='0px';$('ie_tab').style.position='absolute';$('ie_tab').style.width=winW+'px';$('ie_tab').style.height=tab_height+'px';$('ie_tab').style.overflow='hidden';y+=tab_height;$('ie_left').style.top=y+'px';$('ie_left').style.height=(winH-ies.marginT-menu_height-tab_height-tab_bottom-bottom_height)+'px';$('ie_main').style.top=$('ie_left').style.top;$('ie_main').style.left=(left_width+0)+'px';$('ie_main').style.width=(winW-left_width-(navigator.appName=='Microsoft Internet Explorer'?4:0))+'px';$('ie_main').style.height=$('ie_left').style.height;y+=winH-ies.marginT-menu_height-tab_height-tab_bottom-bottom_height;$('ie_bottom').style.top=y+'px';$('ie_bottom').style.width=winW+'px';$('ie_bottom').style.height=bottom_height+'px';$('ie_main').style.overflow='hidden';$$('.container1').each(function(obj){obj.style.height=(winH-ies.marginT-menu_height-tab_height-tab_bottom-bottom_height-10)+'px';if(obj.id!='history_container'){obj.style.width=(winW-left_width-10)+'px';}});$$('.container2').each(function(obj){obj.style.height=(winH-ies.marginT-menu_height-tab_height-tab_bottom-bottom_height-50)+'px';});}else{ORYANOO.resize_info={mainDiv:40};if($H(ORYANOO.resize_info).size()>0){$H(ORYANOO.resize_info).each(function(elt){if($(elt[0]))$(elt[0]).style.height=(winH-ies.marginT-bottom_height-elt[1])+'px';});}
if($('mainDiv')){$('mainDiv').style.visibility='visible';$('mainDiv').style.zIndex=10;$('mainDiv').style.display='block';}}
return ORYANOO.resize_manage(e);},title_update:function(param){var sep=' :: ';var t_cur=top.document.title.split(sep);var title='';if(typeof(param.email)!='undefined'){title+=param.email;}else if(t_cur[0]){title+=t_cur[0];}
title+=sep;if(t_cur[2]){title+=t_cur[2];}else if(ies&&ies.site_title){title+=ies.site_title;}
top.document.title=title;},status:function(text,color,timeout){if(text){$('footer1').innerHTML='&nbsp;'+text;$('footer1').style.backgroundColor=bg_colors[color];$('footer1').style.color=text_colors[color];if(timeout)setTimeout("ies.window.status()",timeout);}else{$('footer1').innerHTML='&nbsp;'+ies.poweredby;$('footer1').style.backgroundColor='';$('footer1').style.border='0px';}}}
ORYANOO.chart=function(divId){this.init(divId);}
ORYANOO.chart.prototype={divId:null,type:null,dataUrl:null,width:300,height:300,init:function(divId){this.divId=divId;},draw:function(){var loading=lang('loading');var html='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+this.width+'" height="'+this.height+'">'
+'<param name="movie" value="/charts/FCF_'+this.type+'.swf" />'
+'<param name="FlashVars" value="&dataURL='+encodeURIComponent(this.dataUrl)+'&chartWidth='+this.width+'&chartHeight='+this.height+'&XMLLoadingText='+loading+'&PBarLoadingText='+loading+'&ParsingDataText='+loading+'">'
+'<param name="quality" value="high" />'
+'<embed src="/charts/FCF_'+this.type+'.swf" flashVars="&dataURL='+encodeURIComponent(this.dataUrl)+'&chartWidth='+this.width+'&chartHeight='+this.height+'&XMLLoadingText='+loading+'&PBarLoadingText='+loading+'&ParsingDataText='+loading+'" quality="high" width="'+this.width+'" height="'+this.height+'" name="'+this.type+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
+'</object>';$(this.divId).update(html);}}
ORYANOO.contextMenu=Class.create();ORYANOO.contextMenu.prototype={divId:'__contextMenuDiv',nodeInfo:null,title:null,colorPicker:null,initialize:function(param){if(param){if(param.colorPicker)this.colorPicker=param.colorPicker;}
this.nodeInfo=[];this.close();if(!$(this.divId))$('body').insert('<div id="'+this.divId+'" style="display:none"></div>');},addNode:function(nInfo){this.nodeInfo[this.nodeInfo.length]=nInfo;},draw:function(){if(!$(this.divId))$('body').insert('<div id="'+this.divId+'" style="display:none"></div>');var html='';var divId=this.divId;$(this.divId).style.position='absolute';$(this.divId).style.zIndex='10000';$(this.divId).style.backgroundColor='#EEE';$(this.divId).style.border='1px solid #999';$(this.divId).style.padding='6px';if(this.title){html+='<div style="padding:6px 6px 6px 28px;font-weight:bold">'+this.title+'</div>';}
this.nodeInfo.each(function(node){html+='<a href="#" onmousedown="'+node.link+';$(\''+divId+'\').remove()" class="aMenuWidget">'+node.text+'</a>';});if(this.colorPicker){html+='<div style="clear:both;float:left;margin:10px 20px 10px 22px;padding:4px;border-bottom:1px solid #CCC;border-top:1px solid #CCC">'+new ORYANOO.colorPicker({callbackFunction:this.colorPicker}).draw()+'</div>';}
html+='<a href="#" onmousedown="$(\''+divId+'\').remove()" class="aMenuWidget">'+lang('close this window')+'</a>';$(this.divId).update(html);if(document.all){winW=document.documentElement.clientWidth;winH=document.documentElement.clientHeight;}else{winW=window.innerWidth+window.pageXOffset;winH=window.innerHeight+window.pageYOffset;}
if(top.xMouse)xMouse=top.xMouse;if(top.yMouse)yMouse=top.yMouse;if(winW<(xMouse+$(this.divId).getWidth())){var xPos=winW-$(this.divId).getWidth()-10;}else{var xPos=xMouse;}
if(winH<(yMouse+$(this.divId).getHeight())){var yPos=winH-$(this.divId).getHeight()-10;}else{var yPos=yMouse;}
$(this.divId).style.left=xPos+'px';$(this.divId).style.top=yPos+'px';$(this.divId).style.display=html?'block':'none';},close:function(){if($(this.divId))$(this.divId).remove();}}
ORYANOO.dialog=function(divId){this.init(divId);}
ORYANOO.dialog.release=function(divId,removeOnRelease){if(removeOnRelease){$(divId).hide();$(divId).remove();}else{$(divId).hide();$(divId).innerHTML='';}
if($('blackDiv'))$('blackDiv').hide();}
ORYANOO.dialog.prototype={divId:null,content:null,button_content:null,width:null,height:null,top:null,left:null,removeOnRelease:true,modal:true,init:function(divId){if(divId){this.divId=divId;if($(divId)){this.removeOnRelease=false;}else{$('body').insert('<div id="'+this.divId+'" style="display:none"></div>');}}else{var jsDate=new Date();this.divId='dialogDiv'+jsDate.getTime();$('body').insert('<div id="'+this.divId+'" style="display:none"></div>');}
this.content='';this.button_content='';},status:function(txt,level,greenTimeout){if(!txt){$(this.divId+'Status').style.display='none';return true;}
$(this.divId+'Status').innerHTML=txt;$(this.divId+'Status').style.border='1px solid '+border_colors[level];$(this.divId+'Status').style.textDecoration='blink';$(this.divId+'Status').style.backgroundColor=bg_colors[level];$(this.divId+'Status').style.color=text_colors[level];$(this.divId+'Status').style.display='block';if(level=='green'&&greenTimeout!=-1){setTimeout("ORYANOO.dialog.release('"+this.divId+"',"+this.removeOnRelease+")",typeof(greenTimeout)!='undefined'?greenTimeout:"1000");}},draw:function(hideOK){if(!hideOK){this.button({text:this.button_content.length>0?lang('cancel'):lang('OK'),color:'grey',link:"ORYANOO.completionBlur();ORYANOO.dialog.release('"+this.divId+"',"+this.removeOnRelease+")"});}
if(!$('blackDiv')&&this.modal){$('body').insert('<div id="blackDiv" style="display:none;position:absolute;z-index:900;width:100%;height:1px;left:0;top:0;background-color:rgba(0,0,0,0.2);border-radius:6px"></div>');blackDivResize=function(){if(document.all){winH=document.documentElement.clientHeight;}else{winH=window.innerHeight+window.pageYOffset;}
if($('blackDiv'))$('blackDiv').setStyle({height:winH+'px'});}
Event.observe(window,'resize',blackDivResize);}
if($('blackDiv')){blackDivResize();$('blackDiv').show();}
this.content+='<div style="z-index:1000;padding:0px;margin:10px 0px 5px 0px;overflow:visible;">'+this.button_content+'</div><div id="'+this.divId+'Status" style="padding:4px;margin:10px 0px 5px 0px;height:20px;display:none"></div>';$(this.divId).style.position='absolute';$(this.divId).style.zIndex='1000';$(this.divId).style.backgroundColor='#EEE';$(this.divId).style.border='1px solid #999';$(this.divId).style.padding='6px';$(this.divId).update(this.content);if(this.width)$(this.divId).style.width=this.width+(this.width!='auto'?'px':'');if(this.height)$(this.divId).style.height=this.height+'px';$(this.divId).style.display=this.content?'block':'none';var height=$(this.divId).getHeight();if(height>winH){$(this.divId).setStyle({height:(winH-40)+'px'});$(this.divId).style.overflow='auto';}
if(this.mouseFlag){$(this.divId).style.left=(this.left?this.left:xMouse+'px');$(this.divId).style.top=(this.top?this.top:yMouse+'px');}else{$(this.divId).Center();}
new Draggable(this.divId,{handle:'dialog_title'});},input:function(param){var form=new ORYANOO.form;this.content+=form.input(param);},password:function(param){var form=new ORYANOO.form;this.content+=form.password(param);},textarea:function(param){var form=new ORYANOO.form;this.content+=form.textarea(param);},date:function(param){var form=new ORYANOO.form;this.content+=form.date(param);},select:function(param){var form=new ORYANOO.form;this.content+=form.select(param);},checkbox:function(param){var form=new ORYANOO.form;this.content+=form.checkbox(param);},radio:function(param){var form=new ORYANOO.form;this.content+=form.radio(param);},hidden:function(param){var form=new ORYANOO.form;this.content+=form.hidden(param);},text:function(param){var form=new ORYANOO.form;this.content+=form.text(param);},title:function(param){var form=new ORYANOO.form;if(!param.css){param.css='dialog_title';}
if(!param.style){param.style='';}
param.style+=';cursor:move';this.content+=form.title(param);},button:function(param){var form=new ORYANOO.form;this.button_content+=form.button(param);},popup_status:function(status_code){this.draw();this.status(lang(status_code),status_code.split('_')[0]=='status'?'green':'red');}}
ORYANOO.colorPicker=Class.create();ORYANOO.colorPicker.prototype={target_id:null,initialize:function(param){if(param){if(param.target_id)this.target_id=param.target_id;if(param.callbackFunction)ORYANOO.color_select=param.callbackFunction;}},draw:function(){var html='<div>';var i=0;$A(this.palette1()).each(function(c){html+='<div style="'+(i%7>0?'':'clear:both;')+'float:left;margin:2px;width:14px;height:14px;background-color:'+c+';border:1px solid #FFF;cursor:pointer" onmouseover="this.style.border=\'1px solid #000\'" onmouseout="this.style.border=\'1px solid #FFF\'" onclick="ORYANOO.color_select(\''+c+'\')"></div>';i++;}.bind(this));html+='</div>';return html;},palette1:function(){return['#CC3333','#DD4477','#994499','#6633CC','#336699','#3366CC','#22AA99','#329262','#109618','#66AA00','#AAAA11','#D6AE00','#EE8800','#DD5511','#A87070','#8C6D8C','#627487','#7083A8','#5C8D87','#898951','#B08B59','#000000','#333333','#666666','#999999','#CCCCCC','#EEEEEE','#FFFFFF'];}}
ORYANOO.form=function(formId){this.init(formId);}
ORYANOO.form.toJson=function(divId,url,callback_url){var out=new Array();var type=new Array('input','textarea');type.each(function(t){$$(divId+' .dataCell'+t).each(function(cell){eval('out[out.length] = { '+cell.id.replace(/\./g,'__')+":'"+js_filter($(cell.id).innerHTML)+"' };");});});new Ajax.Request(url,{method:'post',parameters:{data:Object.toJSON(out)},onSuccess:function(xhr){content=xhr.responseText.evalJSON();location=callback_url;}});}
ORYANOO.form.prototype={formId:null,maxcol:0,curcol:0,content:'',init:function(formId){if(formId)this.formId=formId;},button:function(param){var html='<a href="#"';if(param.id)html+=' id="'+param.id+'"';if(param.css)html+=' class="'+param.css+'Button"';if(param.color)html+=' style="background-image:url(/html/cm/img/bg50_white.png);background-color:'+bg_colors[param.color]+';border:1px solid '+border_colors[param.color]+';color:'+text_colors[param.color]+';padding:4px 12px 4px 12px;margin-right:8px;-moz-border-radius:4px"';if(param.link)html+=' onclick="'+param.link+';return false"';if(param.alt)html+=' title="'+param.alt+'"';html+='>';if(param.text)html+=param.text;html+='</a>';return html;},password:function(param){return this.input(param,true);},input:function(param,password){var html='<input type="'+(password?'password':'text')+'"';if(param.id)html+=' name="'+param.id+'" id="'+param.id+'"';if(param.value)html+=' value="'+param.value+'"';if(param.readonly)html+=' readonly="readonly"';if(param.autofocus)html+=' autofocus="autofocus"';if(param.css)html+=' class="'+param.css+'"';if(param.style)html+=' style="'+param.style+'"';else html+=' style="width:98%"';if(param.onchange)html+=' onchange="'+param.onchange+'"';if(param.onclick)html+=' onclick="'+param.onclick+'"';if(param.onkeypress)html+=' onkeypress="'+param.onkeypress+'"';if(param.onkeyup)html+=' onkeyup="'+param.onkeyup+'"';if(param.completionUrl||param.completionUrlFunction){if(param.completionUrlFunction)ORYANOO.completionUrlFunction[param.id]=param.completionUrlFunction;if(!param.completionUpdateFields)param.completionUpdateFields=[];html+=' autocomplete="off" onkeyup="ORYANOO.completion(event,this.id,\''+param.completionUrl+'\',\''+param.completionUpdateFields+'\')" onblur="ORYANOO.completionBlur()"'
if(!$('completionList')){document.writeln('<div id="completionList" style="background-color:#F6F6F6;height:160px;position:absolute;z-index:10;display:none;border:1px solid #999;overflow-y:scroll;overflow-x:hidden"></div>');}}
html+=' />';return html;},textarea:function(param){var html='<textarea';if(param.id)html+=' name="'+param.id+'" id="'+param.id+'"';if(param.css)html+=' class="'+param.css+'"';if(param.style)html+=' style="'+param.style+'"';else html+=' style="width:98%"';html+='>';if(param.value)html+=param.value;html+='</textarea>';return html;},date:function(param){var html='<input type="text" onfocus="new ORYANOO.calendar(\''+param.id+'\','+(param.timeFlag?true:false)+')" onclick="new ORYANOO.calendar(\''+param.id+'\','+(param.timeFlag?true:false)+')"';if(param.id)html+=' name="'+param.id+'" id="'+param.id+'"';if(param.value)html+=' value="'+param.value+'"';if(param.css)html+=' class="'+param.css+'"';if(param.style)html+=' style="'+param.style+'"';else html+=' style="width:98%"';if(param.onchange)html+=' onchange="'+param.onchange+'"';html+=' />';return html;},text:function(param){var html='<div';if(param.id)html+=' id="'+param.id+'"';if(param.css)html+=' class="'+param.css+'"';if(param.style)html+=' style="'+param.style+'"';html+='>';if(param.value)html+=param.value.replace(/\n/g,"<br/>");html+='</div>';return html;},tab_button_start:function(){return'<div class="thead1" style="margin:0px 1px 0px 1px;height:23px;">';},tab_button:function(id,label,display){return'<div id="tab_button_'+id+'" class="tab_button2'+(display?'_selected':'')+'" onclick="iesTabSelect(this)">'+label+'</div>';},tab_button_end:function(){return'</div><div style="clear:both"></div>';},tab_content_start:function(id,display){return'<div id="tab_content_'+id+'"'+(display?'':' style="display: none"')+' class="tab_content">';},tab_content_end:function(){return'</div>';},title:function(param){var html='<h1';if(param.id)html+=' id="'+param.id+'"';if(param.css)html+=' class="'+param.css+'"';if(!param.style)param.style='';if(param.color){html+=' style="background-image:url(/html/cm/img/bg50_white.png);background-color:'+bg_colors[param.color]+';border:1px solid '+border_colors[param.color]+';color:'+text_colors[param.color]+';margin:0px 0px 6px 0px;'+param.style+'"';}else if(param.style){html+=' style="'+param.style+'"';}
html+='>';if(param.value)html+=param.value;html+='</h1>';return html;},hidden:function(param){var html='<input type="hidden"';if(param.id)html+=' name="'+param.id+'" id="'+param.id+'"';if(param.value)html+=' value="'+param.value+'"';html+=' />';return html;},select:function(param){var html='<select';if(param.id)html+=' name="'+param.id+'" id="'+param.id+'"';if(param.css)html+=' class="'+param.css+'"';if(param.style)html+=' style="'+param.style+'"';if(param.onchange)html+=' onchange="'+param.onchange+'"';html+='>';if(param.values){$A(param.values).each(function(v){if(typeof(v.value)=='undefined'){v={value:v,text:v};}
html+='<option value="'+v.value+'"'+(param.selected==v.value?' selected="selected"':'')+'>'+v.text+'</option>';});}
html+='</select>';return html;},checkbox:function(param){var html='<input type="checkbox"';if(param.id)html+=' name="'+param.id+'" id="'+param.id+'"';if(param.onchange)html+=' onchange="'+param.onchange+'"';if(param.css)html+=' class="'+param.css+'"';html+=' value="'+param.value+'"';if(param.checked)html+=' checked="checked"';html+=' />&nbsp;'+param.text+(param.br?'<br/>':'');return html;},radio:function(param){var html='<input type="radio"';if(param.id)html+=' name="'+param.id+'" id="'+param.id+'"';if(param.name)html+=' name="'+param.name+'"';if(param.onchange)html+=' onchange="'+param.onchange+'"';if(param.css)html+=' class="'+param.css+'"';html+=' value="'+param.value+'"';if(param.checked)html+=' checked="checked"';html+=' />&nbsp;'+param.text+(param.br?'<br/>':'');return html;},newRow:function(){if(this.content.length>0){this.content+='</tr>';}
this.content+='<tr>';this.curcol=0;},newCell:function(param){this.content+='<td class="dataCell.'+param.type+'" valign="top" id="'+param.id+'" onclick="ORYANOO.Table.editCell(\''+param.id+'\')" style="height:24px">';if(param.value)this.content+=param.value.replace(/\n/g,"<br/>");this.content+='</td>';this.curcol++;if(this.maxcol<=this.curcol)this.maxcol=this.curcol;},draw:function(){var html='<table rules="all" frame="box" cellpadding="4" cellspacing="0" border="1" width="100%" style="border: 1px solid #CCC">';html+=this.content;html+='</tr></table>';$(this.formId).update(html);}}
ORYANOO.completionLength=2;ORYANOO.completionCs='';ORYANOO.completionCurrentSel=-1;ORYANOO.completionCpt=0,ORYANOO.completionInputId=0;ORYANOO.completionData=new Array();ORYANOO.completionRowToId=new Array();ORYANOO.completionUpdateFields=new Array();ORYANOO.completionUrlFunction=new Array();ORYANOO.completion=function(e,inputId,url,updateFields){ORYANOO.completion.UpdateFields=updateFields?updateFields.split(','):new Array();if(navigator.appName=='Netscape'){k=e.keyCode;}else if(window.event){k=window.event.keyCode;}
switch(k){case 13:ORYANOO.completionSubmit(ORYANOO.completionCurrentSel);break;case 38:if(ORYANOO.completionCurrentSel>0)ORYANOO.completionCurrentSel--;break;case 40:if(ORYANOO.completionCurrentSel<ORYANOO.completionCpt)ORYANOO.completionCurrentSel++;break;default:ORYANOO.completionCurrentSel=-1;break;}
ORYANOO.completionInputId=inputId;var cs=$(inputId).value;if(ORYANOO.completionLength>0&&cs.length==ORYANOO.completionLength&&cs!=ORYANOO.completionCs){$('completionList').style.display='block';Element.clonePosition('completionList',inputId,{offsetTop:25});var pos1=$(inputId).cumulativeOffset();var pos2=$(inputId).cumulativeScrollOffset();var top=pos1[1]-pos2[1];if(top<185){$('completionList').setStyle({height:'160px',top:(top+25)+'px'});}else{$('completionList').setStyle({height:'160px',top:(top-160-25)+'px'});}
if(ORYANOO.completionUrlFunction[inputId])url=ORYANOO.completionUrlFunction[inputId]();new Ajax.Request(url=url,{method:'post',parameters:{cs:cs},onSuccess:function(xhr){ORYANOO.completionData=xhr.responseText.evalJSON();ORYANOO.completionCs=cs;ORYANOO.refreshCompletionList();}});}else{ORYANOO.refreshCompletionList();}}
ORYANOO.refreshCompletionList=function(){var found=false;var content='';var row=0;var cs=$(ORYANOO.completionInputId).value;if(ORYANOO.completionData.status=='ok'&&cs.length>=ORYANOO.completionLength){row=0;i=0;ORYANOO.completionRowToId=new Array();ORYANOO.completionData.data.each(function(entry){if(typeof(entry[ORYANOO.completionInputId])=='object'){var ilabel=entry[ORYANOO.completionInputId][0]+'<br/>'+entry[ORYANOO.completionInputId][1];}else{var ilabel=entry[ORYANOO.completionInputId];}
if(ilabel&&ilabel.toLowerCase().indexOf(cs.toLowerCase())>-1){found=true;if(row==ORYANOO.completionCurrentSel||(row==0&&ORYANOO.completionCurrentSel==-1)){if(row==0&&ORYANOO.completionCurrentSel==-1)ORYANOO.completionCurrentSel=0;content+='<div onclick="ORYANOO.completionSubmit('+row+')" id="list'+row+'" class="cListRowSelected">'+ilabel+'</div>';}else{content+='<div onclick="ORYANOO.completionSubmit('+row+')" id="list'+row+'" class="cListRow">'+ilabel+'</div>';}
ORYANOO.completionRowToId[row]=i;row++;}
i++;});}
content+='<div style="cursor:pointer;background-color:#CCC;padding:1px" onclick="ORYANOO.completionBlur();"><img src="/html/cm/img/close.gif" width="16" height="16" alt=""></div>';ORYANOO.completionCpt=row-1;$('completionList').innerHTML=content;if(found){$('completionList').style.display='block';$('completionList').style.zIndex='2000';divScrollTo('completionList','list'+ORYANOO.completionCurrentSel);}else{$('completionList').style.display='none';ORYANOO.completionCurrentSel=-1;}}
ORYANOO.completionSubmit=function(row){if(row>-1&&ORYANOO.completionInputId.length>0){var id=ORYANOO.completionRowToId[row];if(typeof(ORYANOO.completionData.data[id][ORYANOO.completionInputId])=='object'){$(ORYANOO.completionInputId).value=ORYANOO.completionData.data[id][ORYANOO.completionInputId][0];}else{$(ORYANOO.completionInputId).value=ORYANOO.completionData.data[id][ORYANOO.completionInputId];}
ORYANOO.completion.UpdateFields.each(function(f){var field=f.split(':')[0];var event=f.split(':')[1];$(field).value=ORYANOO.completionData.data[id][field];if(event)$(field).fireEvent(event);});$('completionList').style.display='none';ORYANOO.completionCurrentSel=-1;$(ORYANOO.completionInputId).blur();}}
ORYANOO.completionBlur=function(){ORYANOO.completionCs='';if($('completionList'))setTimeout("$('completionList').style.display = 'none'",100);}
ORYANOO.drg=function(){}
ORYANOO.drg.Flag=false;ORYANOO.drg.startFlag=false;ORYANOO.drg.xStart=0;ORYANOO.drg.yStart=0;ORYANOO.drg.source='';ORYANOO.drg.target='';ORYANOO.drg.encapsulation='%content%';ORYANOO.drg.mouse_down_manage=function(e){if(!Event.isLeftClick(e))return false;if(!e.target)return false;if(!e.target.nodeName)return false;switch(e.target.nodeName){case'TEXTAREA':case'INPUT':case'SELECT':case'RADIO':return false;break;default:break;}
ORYANOO.drg.startFlag=true;Event.stop(e);}
ORYANOO.drg.mouse_up_manage=function(e){if(!Event.isLeftClick(e))return false;if(ORYANOO.drg.target&&ORYANOO.drg.Flag&&ORYANOO.drg.isActive()){var go=true;}else{var go=false;}
$('drgDiv').innerHTML='';$('drgDiv').style.display='none';ORYANOO.drg.xStart=0;ORYANOO.drg.yStart=0;ORYANOO.drg.startFlag=false;ORYANOO.drg.Flag=false;if(go)ORYANOO.drg.targetRun();ORYANOO.drg.source='';ORYANOO.drg.target='';}
ORYANOO.drg.mouse_move_manage=function(e){if(!ORYANOO.drg.startFlag)return false;if(navigator.appName=='Microsoft Internet Explorer'){xMouse=event.clientX;yMouse=event.clientY;if(document.all){xMouse+=document.body.scrollLeft;yMouse+=document.body.scrollTop;}}else{xMouse=e.pageX;yMouse=e.pageY;}
var sensibility=4;if(!ORYANOO.drg.Flag){if(!ORYANOO.drg.xStart&&!ORYANOO.drg.yStart){ORYANOO.drg.xStart=xMouse;ORYANOO.drg.yStart=yMouse;}
var xDiff=Math.abs(ORYANOO.drg.xStart-xMouse);var yDiff=Math.abs(ORYANOO.drg.yStart-yMouse);if(xDiff>sensibility||yDiff>sensibility){ORYANOO.drg.Flag=true;}}
if(ORYANOO.drg.source&&ORYANOO.drg.Flag&&ORYANOO.drg.isActive()){if(!$('drgDiv').innerHTML){$('drgDiv').setColor('yellow');$('drgDiv').innerHTML=ORYANOO.drg.encapsulation.replace('%content%',$(ORYANOO.drg.source).innerHTML);$('drgDiv').style.display='block';opacitySet($('drgDiv'),0.8);}
$('drgDiv').style.left=xMouse+20+'px';$('drgDiv').style.top=yMouse+'px';}
Event.stop(e);}
ORYANOO.drg.isActive=function(){return false;}
ORYANOO.drg.mouse_over_manage=function(id,outFlag){if(ORYANOO.drg.source.length==0){ORYANOO.drg.source=id;}else if(ORYANOO.drg.source!=id&&ORYANOO.drg.Flag&&ORYANOO.drg.isActive()){if(outFlag){$(id).setColor('white');$('drgDiv').setColor('yellow');ORYANOO.drg.target='';}else{$(id).setColor('green');$('drgDiv').setColor('green');ORYANOO.drg.target=id;}}
return true;}
ORYANOO.drg.targetRun=function(){return false;}
ORYANOO.drg.handlerInit=function(){if(!$('drgDiv')){$('body').insert('<div id="drgDiv" style="position:absolute;display:none;overflow:auto"></div>');}
ORYANOO.handlerInit=function(){Event.observe(document,'mouseup',ORYANOO.drg.mouse_up_manage);Event.observe(document,'mousedown',ORYANOO.drg.mouse_down_manage);Event.observe(document,'mousemove',ORYANOO.drg.mouse_move_manage);return true;}
ORYANOO.handlerInit();}
ORYANOO.Table=function(tableId){this.init(tableId);}
ORYANOO.Tables=[];ORYANOO.selected=[];ORYANOO.Table.editCell=function(cellId){if(ORYANOO.drg.isActive())return false;var dialog=new ORYANOO.dialog(this.tableId+'editCellDiv');var cellType=$(cellId).className.split('.')[1];var tableId=cellId.split('.')[0];var field=cellId.split('.')[2];var val=$(cellId).innerHTML.replace(/\n/g,"").replace(/<br\/>/gi,"\n").replace(/<br>/gi,"\n");if(ORYANOO.Tables[tableId].readonly)return false;dialog.mouseFlag=true;if($(cellId).getWidth()>200){dialog.width=$(cellId).getWidth();}else{dialog.width=200;}
var completionUrl='';if(ORYANOO.Tables[tableId].fields[field].completionUrlFunction){completionUrl=ORYANOO.Tables[tableId].fields[field].completionUrlFunction();}else if(ORYANOO.Tables[tableId].fields[field].completionUrl){completionUrl=ORYANOO.Tables[tableId].fields[field].completionUrl;}
switch(cellType){case'input':dialog.input({id:'cellValue',value:val,completionUrl:completionUrl});break;case'date':dialog.date({id:'cellValue',value:val});break;case'select':dialog.select({id:'cellValue',selected:val,values:ORYANOO.Table.getSelectValues(cellId)});break;case'text':dialog.select({id:'cellValue',values:[val]});break;default:dialog.textarea({id:'cellValue',value:val,style:'height:'+$(cellId).getHeight()+'px;width:'+dialog.width+'px'});break;}
if(ORYANOO.Tables[tableId].cellAjaxOptFunction){param=ORYANOO.Tables[tableId].cellAjaxOptFunction();}
dialog.button({text:'OK',color:'yellow',link:ORYANOO.Tables[cellId.split('.')[0]].cellAjaxUrl?"ORYANOO.completionBlur();ORYANOO.Table.setCellContent('"+cellId+"', $('cellValue').value)":"ORYANOO.Table.setCellContent('"+cellId+"', $('cellValue').value);ORYANOO.dialog.release('"+this.tableId+"editCellDiv')"});dialog.draw();Element.clonePosition($(this.tableId+'editCellDiv'),$(cellId),{setLeft:true,setTop:true,setWidth:false,setHeight:false,offsetLeft:0,offsetTop:0});var editCellBottom=parseInt($(this.tableId+'editCellDiv').style.top.replace('px',''))+$(this.tableId+'editCellDiv').getHeight();if(document.all){winH=document.documentElement.clientHeight;}else{winH=window.innerHeight+window.pageYOffset;}
if(editCellBottom>winH){var editCellTop=winH-$(this.tableId+'editCellDiv').getHeight()-4;$(this.tableId+'editCellDiv').style.top=editCellTop+'px';}
$('cellValue').focus();}
ORYANOO.Table.checkRow=function(checkAllFlag,tableId){ORYANOO.selected=[];$$('#'+tableId+' .rowSelector').each(function(cb){var rowId=cb.id.replace('.rowSelector','');if(cb.checked){ORYANOO.selected[ORYANOO.selected.length]=rowId;$(rowId).setColor('select');}else{$(rowId).setColor('white');}});}
ORYANOO.Table.deleteCheckedRows=function(tableId){if(!confirm(lang('confirm_delete_rows')))return;var tRowId=[];$$('#'+tableId+' .rowSelector').each(function(cb){if(cb.checked){var rowId=cb.id.replace('.rowSelector','');tRowId[tRowId.length]=rowId;$(rowId).setColor('orange');}});if(ORYANOO.Tables[tableId].cellAjaxUrl&&tRowId.length>0){ORYANOO.Tables[tableId].cellAjaxParameters['tRowId']=Object.toJSON(tRowId);ORYANOO.Tables[tableId].cellAjaxParameters['ieAction']='ws_deleteRow';new Ajax.Request(url=ORYANOO.Tables[tableId].cellAjaxUrl,{method:'post',parameters:ORYANOO.Tables[tableId].cellAjaxParameters,onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){content.tRowId.each(function(rowId){delete ORYANOO.Tables[tableId].rows[rowId.split('.')[2]];});ORYANOO.Tables[tableId].draw();}}});}}
ORYANOO.Table.newRow=function(tableId){var found=false;var rowId=tableId+'.0.0';$$('#'+tableId+' .rowSelector').each(function(cb){if(!found){rowId=cb.id.replace('.rowSelector','');if(cb.checked){found=true;}}});if(ORYANOO.Tables[tableId].cellAjaxUrl){if(ORYANOO.Tables[tableId].cellAjaxOptFunction){ORYANOO.Tables[tableId].cellAjaxParameters=ORYANOO.Tables[tableId].cellAjaxOptFunction();}
ORYANOO.Tables[tableId].cellAjaxParameters['ieAction']='ws_newRow';ORYANOO.Tables[tableId].cellAjaxParameters['rowId']=rowId;ORYANOO.Tables[tableId].cellAjaxParameters['cellId']='';new Ajax.Request(url=ORYANOO.Tables[tableId].cellAjaxUrl,{method:'post',parameters:ORYANOO.Tables[tableId].cellAjaxParameters,onCreate:function(){if($(rowId))$(rowId).setColor('orange');},onSuccess:function(xhr){content=xhr.responseText.evalJSON();ORYANOO.Tables[tableId].rows[content.id]=content.row;ORYANOO.Tables[tableId].draw();}});}}
ORYANOO.Table.setCellContent=function(cellId,val){var tmp=cellId.split('.');var tableId=tmp[0];var rowid=tmp[1];var col=tmp[2];var id=tmp[3];if(ORYANOO.Tables[tableId])ORYANOO.Tables[tableId].rows[id][col]=val;$(cellId).innerHTML=val.replace(/\n/g,'<br/>');if(ORYANOO.Tables[tableId].cellAjaxUrl){var dialog=new ORYANOO.dialog(this.tableId+'editCellDiv');if(ORYANOO.Tables[tableId].cellAjaxOptFunction){ORYANOO.Tables[tableId].cellAjaxParameters=ORYANOO.Tables[tableId].cellAjaxOptFunction();}
var confirmIfnotEmpty=false;if(ORYANOO.Tables[tableId].confirmIfnotEmpty&&ORYANOO.Tables[tableId].confirmIfnotEmpty.indexOf(col)>=0){$(tableId+'.'+rowid+'.'+id).childElements().each(function(obj){if(obj.id&&obj.id!=tableId+'.'+rowid+'.'+col+'.'+id){switch(obj.innerHTML){case'0.00':case'0.0000':case'':break;default:confirmIfnotEmpty=true;break;}}});}
ORYANOO.Tables[tableId].cellAjaxParameters['ieAction']='ws_setCellContent';ORYANOO.Tables[tableId].cellAjaxParameters['cellId']=cellId;ORYANOO.Tables[tableId].cellAjaxParameters['value']=val;ORYANOO.Tables[tableId].cellAjaxParameters['updateFullRow']=confirmIfnotEmpty?(confirm(lang('update whole row?'))?1:0):1;new Ajax.Request(url=ORYANOO.Tables[tableId].cellAjaxUrl,{method:'post',parameters:ORYANOO.Tables[tableId].cellAjaxParameters,onCreate:function(){dialog.status(lang('please wait'),'orange');}.bind(this),onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){dialog.status('ok ...','green',200);ORYANOO.Tables[tableId].rows[content.id]=content.row;$H(content.row).each(function(cell){$(tableId+'.'+rowid+'.'+cell[0]+'.'+content.id).innerHTML=cell[1];});ORYANOO.Table.totalCompute(tableId);}else{dialog.status(content.status,'red');}}.bind(this)});}}
ORYANOO.Table.totalCompute=function(tableId){if(ORYANOO.Tables[tableId].totalFields.length==0)return false;$(ORYANOO.Tables[tableId].totalFields).each(function(f){var total=0;$H(ORYANOO.Tables[tableId].rows).each(function(row){total+=parseFloat(row[1][f]);});$(tableId+'.tfoot.'+f).innerHTML=total.toFixed(2);});}
ORYANOO.Table.mouse_move_manage=function(e){if(ORYANOO.selected.length==1){$('drgDiv').style.left=xMouse+20+'px';$('drgDiv').style.top=yMouse+20+'px';$('drgDiv').innerHTML=xMouse+' : '+yMouse;}}
ORYANOO.Table.prototype={tableId:null,fields:[],totalFields:[],rows:[],cellAjaxUrl:null,cellAjaxParameters:[],cellAjaxOptFunction:null,drgFlag:false,init:function(tableId){this.tableId=tableId;},addRow:function(row){},draw:function(){var html='<table rules="all" frame="box" cellpadding="4" cellspacing="0" border="1" width="100%" style="border: 1px solid #CCC">';if(this.drgFlag){ORYANOO.drg.handlerInit();ORYANOO.drg.isActive=function(){if(ORYANOO.selected.length==1)return true;else return false;}
ORYANOO.drg.encapsulation=html.replace('width="100%"','')+'%content%</table>';ORYANOO.drg.targetRun=function(){var tableId=ORYANOO.drg.source.split('.')[0];if(!ORYANOO.drg.source||!ORYANOO.drg.target||!ORYANOO.Tables[tableId].drgFlag)return false;if(ORYANOO.Tables[tableId].cellAjaxOptFunction){ORYANOO.Tables[tableId].cellAjaxParameters=ORYANOO.Tables[tableId].cellAjaxOptFunction();}
var parameters=ORYANOO.Tables[tableId].cellAjaxParameters;parameters['ieAction']='ws_reorderRow';parameters['source']=ORYANOO.drg.source;parameters['target']=ORYANOO.drg.target;new Ajax.Request(url=ORYANOO.Tables[tableId].cellAjaxUrl,{method:'post',parameters:ORYANOO.Tables[tableId].cellAjaxParameters,onCreate:function(){$(ORYANOO.drg.source).setColor('orange');$(ORYANOO.drg.target).setColor('orange');},onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){ORYANOO.Tables[tableId].rows=typeof(content.data.rows.length)=='undefined'?content.data.rows:{};ORYANOO.Tables[tableId].draw();ORYANOO.selected=[];}}});return true;}}
var tableId=this.tableId;var rownum=1;var id=0;html+='<thead><tr>';if(!ORYANOO.Tables[tableId].readonly){html+='<th align="left" style="background-image:url(/html/cm/img/bg30_white_grey.png)"><input type="checkbox" onclick="new ORYANOO.Table().checkAll(this,\''+tableId+'\');" /><img src="/html/cm/img/switch.gif" style="cursor:pointer" onclick="new ORYANOO.Table().selectionInvert(\''+tableId+'\');" /></th>';}
$H(this.fields).each(function(f){if(f[0]!='id')html+='<th style="background-image:url(/html/cm/img/bg30_white_grey.png)">'+f[1].text+'</th>';});html+='<tr></thead>';html+='<tbody id="tbody'+this.tableId+'">';$H(ORYANOO.Tables[tableId].rows).each(function(row){var id=row[0].length>0?row[0]:'0';html+='<tr id="'+tableId+'.'+rownum+'.'+id+'" onmouseover="ORYANOO.drg.mouse_over_manage(this.id)" onmouseout="ORYANOO.drg.mouse_over_manage(this.id,true)">';if(!ORYANOO.Tables[tableId].readonly){html+='<td nowrap="nowrap">'+(id>0?'<input type="checkbox" id="'+tableId+'.'+rownum+'.'+id+'.rowSelector" class="rowSelector" onclick="ORYANOO.Table.checkRow(false,\''+tableId+'\')" />':'')+'&nbsp;'+rownum+'</td>';}
$H(row[1]).each(function(f){var key=f[0];var val=f[1];var cellType=$H(ORYANOO.Tables[tableId].fields[key]).get('type');html+='<td id="'+tableId+'.'+rownum+'.'+key+'.'+id+'" class="dataCell.'+cellType+'" style="height:24px"';if(cellType!='readonly')html+=' onclick="ORYANOO.Table.editCell(this.id);return false"';html+='">'+val+'</td>';});rownum++;html+='</tr>';});html+='</tbody>';if(this.totalFields.length>0){html+='<tfoot><tr>';if(1==1){html+='<td>&nbsp;</td>';}
$H(this.fields).each(function(f){if(f[0]!='id')html+='<td id="'+tableId+'.tfoot.'+f[0]+'"></td>';});html+='<tr></tfoot>';}
html+='</table>';html+='<div id="'+this.tableId+'editCellDiv"></div>';ORYANOO.selected=[];if(this.tableId){$(this.tableId).update(html);ORYANOO.Table.totalCompute(this.tableId);}else{return html;}},checkAll:function(me,tableId){ORYANOO.selected=[];$$('#'+tableId+' .rowSelector').each(function(obj){obj.checked=me.checked;var rowId=obj.id.replace('.rowSelector','');if(me.checked){ORYANOO.selected[ORYANOO.selected.length]=rowId;$(rowId).setColor('select');}else{$(rowId).setColor('white');}});},selectionInvert:function(tableId){ORYANOO.selected=[];$$('#'+tableId+' .rowSelector').each(function(obj){obj.checked=!obj.checked;var rowId=obj.id.replace('.rowSelector','');if(obj.checked){ORYANOO.selected[ORYANOO.selected.length]=rowId;$(rowId).setColor('select');}else{$(rowId).setColor('white');}});}}
ORYANOO.calendar=Class.create();ORYANOO.calendars=[];ORYANOO.calendar.prototype={calId:'__smallcal',retId:null,date:null,asked_id:'',today_id:'',timeFlag:false,noPopUp:false,external_clic:null,DAY:"D",WEEK:"W",YEAR:"Y",MONTH:"M",initialize:function(retId,timeFlag,options){if(retId)this.retId=retId;if(timeFlag)this.timeFlag=timeFlag;if(options&&options.noPopUp)this.noPopUp=options.noPopUp;if(options&&options.calId)this.calId=options.calId;if(options&&options.external_clic)this.external_clic=options.external_clic;this.date=new Date();var dateMs=0;var today=new Date();this.today_id=this.date_to_id(today);if($(retId)&&$(retId).value.length>0){var _date=$(retId).value.split(' ')[0];var _time=$(retId).value.split(' ')[1];var t_date=_date.split('/');if(_time&&this.timeFlag){var hour=parseFloat(_time.split(':')[0]);var minute=parseFloat(_time.split(':')[1]);}else{var hour=this.timeFlag?12:0;var minute=0;}
if(t_date.length==3){dateMs=new Date(t_date[2],t_date[1]-1,t_date[0],hour,minute).getTime();}else{dateMs=parseInt($(retId).value)*1000;}}
if(dateMs>0){this.date.setTime(dateMs);this.asked_id=this.date_to_id(this.date);}else{this.date.setSeconds(0);this.date.setMinutes(0);this.date.setMilliseconds(0);}
this.draw();},add:function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.MONTH:var newMonth=date.getMonth()+amount;var years=0;if(newMonth<0){while(newMonth<0){newMonth+=12;years-=1;}}else if(newMonth>11){while(newMonth>11){newMonth-=12;years+=1;}}
d.setMonth(newMonth);d.setFullYear(date.getFullYear()+years);break;case this.DAY:d.setDate(date.getDate()+amount);break;case this.YEAR:d.setFullYear(date.getFullYear()+amount);break;case this.WEEK:d.setDate(date.getDate()+(amount*7));break;}
return d;},subtract:function(date,field,amount){return this.add(date,field,(amount*-1));},monthStart:function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;},monthEnd:function(date){var start=this.monthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;},before:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()<ms){return true;}else{return false;}},after:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()>ms){return true;}else{return false;}},pad:function(nb){return(nb<10?'0':'')+nb;},format:function(date){var day=this.pad(date.getDate());var month=this.pad(date.getMonth()+1);var hour=this.pad(date.getHours());var minute=this.pad(date.getMinutes());if(this.timeFlag){return day+'/'+month+'/'+date.getFullYear()+' '+hour+':'+minute;}else{return day+'/'+month+'/'+date.getFullYear();}},date_to_id:function(date){return date.getDate()+'_'+date.getMonth()+'_'+date.getFullYear()+'_'+date.getDay();},monthName:function(date){switch(date.getMonth()){case 0:return lang('january');break;case 1:return lang('february');break;case 2:return lang('march');break;case 3:return lang('april');break;case 4:return lang('may');break;case 5:return lang('june');break;case 6:return lang('july');break;case 7:return lang('august');break;case 8:return lang('september');break;case 9:return lang('october');break;case 10:return lang('november');break;case 11:return lang('december');break;default:return date.getMonth();break;}},dayName:function(dayNum){switch(dayNum){case 0:return lang('monday');break;case 1:return lang('tuesday');break;case 2:return lang('wednesday');break;case 3:return lang('thursday');break;case 4:return lang('friday');break;case 5:return lang('saturday');break;case 6:return lang('sunday');break;default:break;}},returnDate:function(dateMs){if($(this.retId+'_show')){$(this.retId).value=dateMs.getTime()/1000;$(this.retId+'_show').value=this.format(dateMs);}else{$(this.retId).value=this.format(dateMs);$(this.retId).fireEvent('change');}},draw:function(dateMs){if(dateMs)this.date.setTime(dateMs);var html='';var start=this.monthStart(this.date);var end=this.monthEnd(this.date);var today=new Date();html+='<table border="0" style="" cellpadding="3" cellspacing="0">';html+='<tr>';html+='<td colspan="'+(this.noPopUp?'8':'7')+'" id="'+this.calId+'_title" align="center" style="'+(this.noPopUp?'':'cursor:move;')+'border-bottom:1px solid #CCC;font-weight:bold;padding-top:0px">'+this.monthName(start)+'&nbsp;'+start.getFullYear()+'</td>';if(!this.noPopUp)html+='<td id="'+this.calId+'_x" align="center" class="smallcal_clic" style="border-bottom:1px solid #CCC">x</td>';html+='</tr>';var radius='-moz-border-radius:6px;-webkit-border-radius:16px';html+='<tr>';html+='<td align="center" style="font-size:18px;'+radius+'" class="smallcal_clic">&laquo;</td>';html+='<td align="center" style="font-size:18px;'+radius+'" class="smallcal_clic">&lsaquo;</td>';html+='<td align="center" style="'+radius+'" class="smallcal_clic" colspan="4">'+lang('today')+'</td>';html+='<td align="center" style="font-size:18px;'+radius+'" class="smallcal_clic">&rsaquo;</td>';html+='<td align="center" style="font-size:18px;'+radius+'" class="smallcal_clic">&raquo;</td>';html+='</tr>';html+='<tr>';html+='<td style="background-color:#DDD;border-bottom:1px solid #999;border-right:1px solid #999">'+lang('week').substr(0,3)+'</td>';for(i=0;i<7;i++){html+='<td align="center" style="background-color:#DDD;border-bottom:1px solid #999">'+lang(this.dayName(i)).substr(0,3)+'</td>';}
html+='</tr>';html+='<tr>';var current=start;var wd=0;var weekDay=((start.getDay()>0?start.getDay()-1:6)%7);current=this.subtract(start,this.DAY,weekDay);end=this.add(end,this.DAY,7-end.getDay());while(!this.after(current,end)){if(wd==0){html+='<tr><td align="center" style="background-color:#DDD;border-right:1px solid #999">'+this.getWeek(current)+'</td>';}
html+='<td align="center" style="-moz-border-radius:0px" class="smallcal_clic" id="'+this.date_to_id(current)+'">'+current.getDate()+'</td>';current=this.add(current,this.DAY,1);if(wd==6)html+='</tr>';wd=(wd+1)%7;}
html+='</table>';if(this.timeFlag){html+='<table align="center" border="0" style="margin-top:4px;background-color:#EEE" cellpadding="3" cellspacing="0">';html+='<tr>';html+='<td align="center"><img id="'+this.calId+'_hour_up" class="smallcal_clic" src="/html/cm/img/up-small-grey.gif" alt="" /></td>';html+='<td id="'+this.calId+'_hour" rowspan="2" align="center" style="font-size:120%;font-weight:bold">'+this.pad(this.date.getHours())+'</td>';html+='<td rowspan="2" align="center" style="font-size:120%;font-weight:bold">:</td>';html+='<td id="'+this.calId+'_minute" rowspan="2" align="center" style="font-size:120%;font-weight:bold">'+this.pad(this.date.getMinutes())+'</td>';html+='<td align="center"><img id="'+this.calId+'_minute_up" class="smallcal_clic" src="/html/cm/img/up-small-grey.gif" alt="" /></td>';html+='</tr>';html+='<tr>';html+='<td align="center"><img id="'+this.calId+'_hour_down" class="smallcal_clic" src="/html/cm/img/down-small-grey.gif" alt="" /></td>';html+='<td align="center"><img id="'+this.calId+'_minute_down" class="smallcal_clic" src="/html/cm/img/down-small-grey.gif" alt="" /></td>';html+='</tr>';html+='</table>';}
if($(this.calId)){$(this.calId).update(html);}else{$('body').insert('<div id="'+this.calId+'">'+html+'</div>');}
if(!dateMs){$(this.calId).style.backgroundColor='#E6E6E6';$(this.calId).style.backgroundRepeat='repeat-x';$(this.calId).style.backgroundImage='url(/html/cm/img/bg30_white_grey.png)';$(this.calId).style.border='1px solid #CCC';$(this.calId).style.padding='6px';if(!this.noPopUp){$(this.calId).style.position='absolute';$(this.calId).style.zIndex='2000';var ref=$(this.retId+'_show')?this.retId+'_show':this.retId;var pos1=$(ref).cumulativeOffset();var pos2=$(ref).cumulativeScrollOffset();var left=pos1[0]-pos2[0];var top=pos1[1]-pos2[1];if(document.all){winW=document.documentElement.clientWidth;winH=document.documentElement.clientHeight;}else{winW=window.innerWidth+window.pageXOffset;winH=window.innerHeight+window.pageYOffset;}
if((top+$(ref).getHeight()+$(this.calId).getHeight())>winH){top=top-$(ref).getHeight()-$(this.calId).getHeight();}else{top=top+$(ref).getHeight()+2;if(this.retId=='cellValue')top+=40;}
if((left+$(this.calId).getWidth())>winW){left=winW-$(this.calId).getWidth()-20;}
if(top<0)top=0;$(this.calId).style.left=left+'px';$(this.calId).style.top=top+'px';}}
if(!this.noPopUp)new Draggable(this.calId,{handle:this.calId+'_title'});this.addObservers();},getWeek:function(cDate){return new Date(cDate).getWeek();},clic:function(e){switch(e.target.innerHTML){case'‹':this.draw(this.subtract(this.date,this.MONTH,1).getTime());break;case'›':this.draw(this.add(this.date,this.MONTH,1).getTime());break;case'«':this.draw(this.subtract(this.date,this.YEAR,1).getTime());break;case'»':this.draw(this.add(this.date,this.YEAR,1).getTime());break;case lang('today'):var today=new Date();today.setHours(this.date.getHours());today.setMinutes(this.date.getMinutes());today.setSeconds(0);today.setMilliseconds(0);this.draw(today.getTime());break;case'x':$(this.calId).remove();break;default:switch(e.target.id){case this.calId+'_hour_up':case this.calId+'_hour_down':var hour=parseFloat($(this.calId+'_hour').innerHTML)+(e.target.id==this.calId+'_hour_up'?1:-1);if(hour>23)hour=0;if(hour<0)hour=23;this.date.setHours(hour);if(!this.external_clic)$(this.calId+'_hour').update(this.pad(hour));break;case this.calId+'_minute_up':case this.calId+'_minute_down':var minute=parseFloat($(this.calId+'_minute').innerHTML)+(e.target.id==this.calId+'_minute_up'?5:-5);if(minute>59)minute=0;if(minute<0)minute=55;this.date.setMinutes(minute);if(!this.external_clic)$(this.calId+'_minute').update(this.pad(minute));break;default:if(this.external_clic){this.date=new Date(e.target.id.split('_')[2],e.target.id.split('_')[1],e.target.id.split('_')[0],this.date.getHours(),this.date.getMinutes());}else{this.returnDate(new Date(e.target.id.split('_')[2],e.target.id.split('_')[1],e.target.id.split('_')[0],this.date.getHours(),this.date.getMinutes()));}
if(!this.noPopUp)$(this.calId).remove();break;}
break;}
if(this.external_clic)this.external_clic(this.date.getTime());},mouseover:function(e){if(e.target.getStyle('background-color')=='rgb(255, 255, 170)'||e.target.getStyle('background-color')=='#ffa'){return;}else if(e.target.id==this.calId+'_x'){e.target.setStyle({backgroundColor:'#DDD'});}else{e.target.setStyle({backgroundColor:'#DDD',border:'1px solid #BBB'});}},mouseout:function(e){this.setStyle(e.target);},setStyle:function(obj){var info=obj.id.split('_');var border='1px solid ';if(obj.id.length>0&&obj.id==this.asked_id){var bg=bg_colors.orange;border+=border_colors.orange;}else if(obj.id==this.calId+'_x'){obj.setStyle({cursor:'default',backgroundColor:''});return;}else if(!info[3]){var bg='#E6E6E6';border+='#E6E6E6';}else if(info[3]==6||info[3]==0){var bg='#F6F6F6';border+='#F6F6F6';}else if(info[3]=='hour'||info[3]=='minute'){var bg='#EEE';border+='#EEE';}else{var bg='#FFF';border+='#FFF';}
if(info[1]&&info[1]!=this.date.getMonth()){var color='#999';}else{var color='#000';}
if(obj.id==this.today_id){border='1px solid '+border_colors.orange;}
if(obj.getStyle('background-color')=='rgb(255, 255, 170)'||obj.getStyle('background-color')=='#ffa'){obj.setStyle({cursor:'default',color:color,border:border});}else{obj.setStyle({cursor:'default',color:color,backgroundColor:bg,border:border});}},addObservers:function(){$$("#"+this.calId+" .smallcal_clic").each(function(obj){obj.observe('mouseover',this.mouseover.bindAsEventListener(this));obj.observe('mouseout',this.mouseout.bindAsEventListener(this));obj.observe('click',this.clic.bindAsEventListener(this));this.setStyle(obj);}.bind(this));}}
ORYANOO.calendarWidget=function(dateMs,retId){var ind=ORYANOO.calendars.length;ORYANOO.calendars[ind]=new ORYANOO.calendar(ind,dateMs,retId);return ORYANOO.calendars[ind].draw();}
ORYANOO.time=Class.create();ORYANOO.time.prototype={calId:'__smallcal',retId:null,hour:0,minute:0,initialize:function(retId){if(retId)this.retId=retId;if($(retId)&&$(retId).value.length>0){this.hour=parseFloat($(retId).value.split(':')[0]);this.minute=parseFloat($(retId).value.split(':')[1]);}
this.draw();},pad:function(nb){return(nb<10?'0':'')+nb;},returnDate:function(){$(this.retId).value=this.pad(this.hour)+':'+this.pad(this.minute);$(this.retId).fireEvent('change');},draw:function(dateMs){var html='';html+='<table align="center" border="0" style="margin-top:4px;background-color:#EEE" cellpadding="3" cellspacing="0">';html+='<tr>';html+='<td align="center"><img id="'+this.calId+'_hour_up" class="smallcal_clic" src="/html/cm/img/up-small-grey.gif" alt="" /></td>';html+='<td id="'+this.calId+'_hour" rowspan="2" align="center" style="font-size:120%;font-weight:bold">'+this.pad(this.hour)+'</td>';html+='<td rowspan="2" align="center" style="font-size:120%;font-weight:bold">:</td>';html+='<td id="'+this.calId+'_minute" rowspan="2" align="center" style="font-size:120%;font-weight:bold">'+this.pad(this.minute)+'</td>';html+='<td align="center"><img id="'+this.calId+'_minute_up" class="smallcal_clic" src="/html/cm/img/up-small-grey.gif" alt="" /></td>';html+='</tr>';html+='<tr>';html+='<td align="center"><img id="'+this.calId+'_hour_down" class="smallcal_clic" src="/html/cm/img/down-small-grey.gif" alt="" /></td>';html+='<td align="center"><img id="'+this.calId+'_minute_down" class="smallcal_clic" src="/html/cm/img/down-small-grey.gif" alt="" /></td>';html+='</tr>';html+='<tr>';html+='<td id="'+this.calId+'_ok" align="center" colspan="2" style="background-color:#EEE;border-bottom:1px solid #999" class="smallcal_clic">OK</td>';html+='<td></td>';html+='<td id="'+this.calId+'_close" align="center" colspan="2" style="background-color:#EEE;border-bottom:1px solid #999" class="smallcal_clic">X</td>';html+='</tr>';html+='</table>';if($(this.calId)){$(this.calId).update(html);}else{$('body').insert('<div id="'+this.calId+'">'+html+'</div>');}
if(!dateMs){$(this.calId).style.position='absolute';$(this.calId).style.zIndex='100';$(this.calId).style.backgroundColor='#EEE';$(this.calId).style.border='1px solid #999';$(this.calId).style.padding='6px';var ref=$(this.retId+'_show')?this.retId+'_show':this.retId;var pos1=$(ref).cumulativeOffset();var pos2=$(ref).cumulativeScrollOffset();var left=pos1[0]-pos2[0];var top=pos1[1]-pos2[1];if(document.all){winW=document.documentElement.clientWidth;winH=document.documentElement.clientHeight;}else{winW=window.innerWidth+window.pageXOffset;winH=window.innerHeight+window.pageYOffset;}
if((top+$(ref).getHeight()+$(this.calId).getHeight())>winH){top=top-$(ref).getHeight()-$(this.calId).getHeight();}else{top=top+$(ref).getHeight()+2;}
if((left+$(this.calId).getWidth())>winW){left=winW-$(this.calId).getWidth()-20;}
if(top<0)top=0;$(this.calId).style.left=left+'px';$(this.calId).style.top=top+'px';}
this.addObservers();},clic:function(e){switch(e.target.innerHTML){case'x':$(this.calId).remove();break;default:switch(e.target.id){case this.calId+'_hour_up':case this.calId+'_hour_down':var hour=parseFloat($(this.calId+'_hour').innerHTML)+(e.target.id==this.calId+'_hour_up'?1:-1);if(hour>23)hour=0;if(hour<0)hour=23;this.hour=hour;$(this.calId+'_hour').update(this.pad(hour));break;case this.calId+'_minute_up':case this.calId+'_minute_down':var minute=parseFloat($(this.calId+'_minute').innerHTML)+(e.target.id==this.calId+'_minute_up'?5:-5);if(minute>59)minute=0;if(minute<0)minute=55;this.minute=minute;$(this.calId+'_minute').update(this.pad(minute));break;case this.calId+'_ok':this.returnDate();$(this.calId).remove();break;default:$(this.calId).remove();break;}
break;}},mouseover:function(e){if(e.target.id==this.calId+'_x'){e.target.setStyle({backgroundColor:'#DDD'});}else{e.target.setStyle({backgroundColor:'#DDD',border:'1px solid #BBB'});}},mouseout:function(e){this.setStyle(e.target);},setStyle:function(obj){var border='1px solid #DDD';var color='#000';var bg='#EEE';obj.setStyle({cursor:'default',color:color,backgroundColor:bg,border:border});},addObservers:function(){$$("#"+this.calId+" .smallcal_clic").each(function(obj){obj.observe('mouseover',this.mouseover.bindAsEventListener(this));obj.observe('mouseout',this.mouseout.bindAsEventListener(this));obj.observe('click',this.clic.bindAsEventListener(this));this.setStyle(obj);}.bind(this));}}
ORYANOO.synthesis=function(){}
ORYANOO.synthesis.prototype={onfocus:function(obj){obj.style.opacity=1;},onblur:function(obj){if(obj.value.length==0)obj.style.opacity=0.4;}}
ORYANOO.crm=function(id,object){this.init(id,object);}
ORYANOO.crm.prototype={id:null,object:null,init:function(id,object){this.id=id;this.object=object;},history:function(start){var ghStart=start?start:0;var id=this.id;var object=this.object;var obj=this;new Ajax.Request(url='/intranet-e/contacts/ws_contacts.ies',{method:'post',parameters:{ieAction:'history',id:id,object:object,ghStart:ghStart},onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){obj.historyDraw(content.inProgress,'inProgress',ghStart);obj.historyDraw(content.history,'history',ghStart);}}});},historyDraw:function(data,ieAction,start){var ghStart=start;var html='';html+='<h1>'+lang(ieAction=='history'?'history':'in progress')+'</h1>';html+='<table width="100%" cellpadding="4" cellspacing="1" border="0">';html+='<tr>';html+='<td class="thead1">&nbsp;</td>';html+='<td class="thead1">'+lang('type')+'</td>';html+='<td class="thead1">'+lang('actor')+'</td>';html+='<td class="thead1">'+lang('subject')+'</td>';html+='<td class="thead1">'+lang('time')+'</td>';html+='</tr>';var day='';data.each(function(row){var link='';var tabId='';switch(row.object){case'calendar':link='/intranet-e/calendar/edit.ies?popup=1&cal_id='+row.id;tabId='cal_id_'+row.id;break;case'folder':link='/intranet-e/contacts/doc_edit.ies?popup=1&doc_id='+row.id;tabId='doc_id='+row.id;break;case'email':link='/intranet-e/email/index2.ies?popup=1&mail_id='+row.id;break;case'operation':link='/intranet-e/contacts/operation_edit.ies?popup=1&op_id='+row.id;tabId='op_id_'+row.id;break;case'quote':link='/intranet-e/gestion/quote.ies?ieAction=synthesis&qo_id='+row.id;tabId='quote';break;case'sales-order':link='/intranet-e/gestion/sales_order.ies?ieAction=synthesis&so_id='+row.id;tabId='sales_order';break;case'purchaseorder':link='/intranet-e/gestion/purchase_order.ies?ieAction=synthesis&po_id='+row.id;tabId='purchase_order';break;case'delivery':link='/intranet-e/gestion/delivery_order.ies?ieAction=synthesis&do_id='+row.id;tabId='delivery_order';break;case'invoice':link='/intranet-e/gestion/invoice.ies?ieAction=synthesis&inv_id='+row.id;tabId='invoice';break;default:break;}
if(!tabId)tabId='unik';if(row.date!=day){day=row.date;html+='<tr class="rowOff">';html+='<td colspan="5" style="font-weight:bold">'+day+'</td>';html+='</tr>';}
html+='<tr class="rowOn">';html+='<td valign="top" align="center"'+(ieAction=='inProgress'?(' style="border-right:4px solid '+bg_colors[row.color]+'"'):'')+(row.notes.length>0?' rowspan="2"':'')+'><img src="/html/cm/img/'+row.object+'.gif" alt="" /></td>';html+='<td valign="top">'+row.type+'</td>';html+='<td valign="top">'+row.create_by+'</td>';html+='<td valign="top"><a href="#" onclick="top.ies.window.tab.open(\''+link+'\',\''+tabId+'\');return false">'+(row.subject.length>0?row.subject:'[ '+lang('name')+' ]')+'</a></td>';html+='<td valign="top">'+row.time+'</td>';html+='</tr>';if(row.notes.length>0){html+='<tr class="rowOn">';html+='<td colspan="4">'+row.notes+'</td>';html+='</tr>';}});html+='</table>';if(ieAction=='history'){ghStart=parseInt(ghStart);if(ghStart>0)html+='&nbsp;&nbsp;<a href="#" onclick="new ORYANOO.crm(\''+this.id+'\',\''+this.object+'\').history(\''+(ghStart-100)+'\');return false">'+lang('previous')+'</a>';if(data.length>100)html+='&nbsp;&nbsp;<a href="#" onclick="new ORYANOO.crm(\''+this.id+'\',\''+this.object+'\').history(\''+(ghStart+100)+'\');return false">'+lang('next')+'</a>';}
$(ieAction+'Div').innerHTML=html;},write_letter:function(){var dialog=new ORYANOO.dialog('dialogDiv');dialog.title({value:lang('write a letter'),color:'grey'});dialog.text({id:'form_letterDiv',style:'overflow:auto;width:400px;height:200px;background-color:#FFF;border:1px solid #999;padding:4px'});dialog.draw();new Ajax.Request(url='/intranet-e/form_letter/index.ies',{method:'post',parameters:{ieAction:'ws_synthesis'},onCreate:function(){dialog.status(lang('please wait'),'orange');},onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){var html='<table border="0" cellspacing="1" width="100%" class="synthesis"><tr class="thead1"><td>'+lang('form letter')+'</td></tr>';var tr=new Template('<tr class="#{classe}"><td><a href="#" onclick="window.open(\'/intranet-e/form_letter/index.ies?ieAction=write&'+this.object+'_id='+this.id+'&fole_id=#{fole_id}\',\'\',\'width=500,height=700\');ORYANOO.dialog.release(\''+dialog.divId+'\');return false">#{fole_name}</td></tr>');var tr_class='rowOn';$H(content.data).each(function(fole){if(fole[1].fole_id){fole[1].classe=(tr_class=='rowOn'?'rowOff':'rowOn');tr_class=fole[1].classe;html+=tr.evaluate(fole[1]);}});html+='</table>';$('form_letterDiv').innerHTML=html;dialog.status();}else{dialog.status(content.status,'red');}}.bind(this)});},new_quote:function(go){var dialog=new ORYANOO.dialog('dialogDiv');if(go){var selected_quotes='';$$("#body .selected_quotes_cb").each(function(obj){if(obj.checked)selected_quotes+=(selected_quotes.length>0?',':'')+obj.value;});top.ies.window.tab.open('/intranet-e/gestion/quote.ies?ieAction=copy&'+this.object+'_id='+this.id+'&selected_quotes='+selected_quotes,'quote');}else{dialog.title({value:lang('new quote'),color:'grey'});dialog.text({id:'form_quoteDiv',style:'overflow:auto;width:400px;height:200px;background-color:#FFF;border:1px solid #999;padding:4px'});dialog.button({text:'OK',color:'green',link:"widgetMenu();crm.new_quote(true);ORYANOO.dialog.release('dialogDiv',"+dialog.removeOnRelease+");"});dialog.draw();new Ajax.Request(url='/intranet-e/gestion/quote.ies',{method:'post',parameters:{ieAction:'ws_model_synthesis'},onCreate:function(){dialog.status(lang('please wait'),'orange');},onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){var html='<table border="0" cellspacing="1" width="100%" class="synthesis"><tr class="thead1"><td></td><td>'+lang('quote')+'</td></tr>';var tr=new Template('<tr class="#{classe}"><td align="center"><input type="checkbox" value="#{qo_id}" class="selected_quotes_cb" /></td><td><a href="/intranet-e/gestion/quote.ies?ieAction=pdf&qo_id=#{qo_id}">#{qo_subject}</td></tr>');var tr_class='rowOn';$H(content.data).each(function(quote){if(quote[1].qo_id){quote[1].classe=(tr_class=='rowOn'?'rowOff':'rowOn');tr_class=quote[1].classe;html+=tr.evaluate(quote[1]);}});html+='</table>';$('form_quoteDiv').innerHTML=html;dialog.status();}else{dialog.status(content.status,'red');}}.bind(this)});}},get_email_addr:function(textarea_id){top.get_email_addr=function(ab_id){new Ajax.Request(url='/intranet-e/contacts/ws_contacts.ies',{method:'post',parameters:{ieAction:'ws_get_email_addr',ab_id:ab_id},onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){if(content.email.length>0)$(textarea_id).value+=content.email+",\n";}}});}
top.ies.window.tab.open('/intranet-e/contacts/contact_list.ies?choose=1&callbackFunction=get_email_addr','contacts');},calendar_exception_delete:function(cal_id,rpt_timestamp){if(confirm(lang('Are you sure you want to delete this entry'))){new Ajax.Request(url='/intranet-e/calendar/ws_exception.ies',{method:'post',parameters:{cal_id:cal_id,rpt_timestamp:rpt_timestamp},onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){$('calendar_exception_div_'+cal_id).update(content.html);}}});}},fieldlist_element_delete:function(field,id){var val='';$($(field).value.split(',')).each(function(v){if(v!=id){val+=(val.length>0?',':'')+v;}});$(field).value=val;$$('#body .fieldlist_'+field+'_'+id).each(function(obj){obj.fade({afterFinish:function(){obj.remove();}});});},fieldlist_element_add:function(field,id,type){var prefix=field.split('_')[0];switch(type){case'ab':var param={ieAction:'ws_get_fullname',ab_id:id};break;case'op':var param={ieAction:'ws_get_opname',op_id:id};break;default:break;}
new Ajax.Request(url='/intranet-e/contacts/ws_contacts.ies',{method:'post',parameters:param,onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){var name=content.fullname?content.fullname:content.name;$(field).value+=($(field).value.length>0?',':'')+id;var html='';html+='<div class="fieldlist_'+field+'_'+id+'" style="padding:4px 0px 4px 0px;float:left;width:85%">'+name+'</div>';html+='<div class="fieldlist_'+field+'_'+id+'" style="float:left;width:15%"><img src="/html/cm/img/delete.gif" border="0" style="cursor:pointer" onclick="new ORYANOO.crm().fieldlist_element_delete(\''+field+'\',\''+id+'\')" /></div>';$(field+'_container').innerHTML+=html;}}.bind(this)});}}
ORYANOO.screen=Class.create();ORYANOO.screen.prototype={initialize:function(){},waitOn:function(){if($('waitDiv')){$('waitDiv').appear();}else{$('body').insert('<div id="waitDiv" style="position:absolute;z-index:2000;width:100%;height:1px;left:0;top:0;background-color:rgba(0,0,0,0.2)"><div id="waitPopup"><img src="/html/cm/img/wait.gif" alt="" style="width:100%" /><div id="waitDivText" style="100%;padding-top:4px;text-align:center">'+lang('please wait')+'</div></div></div>');}
if(document.all){var winH=document.documentElement.clientHeight;}else{var winH=window.innerHeight+window.pageYOffset;}
$('waitDiv').setStyle({height:winH+'px'});$('waitPopup').Center();},waitOff:function(){if($('waitDiv')){$('waitDiv').fade();}},waitLoad:function(){if(!$('waitDiv')){$('body').insert('<div id="waitDiv" style="display:none;position:absolute;z-index:2000;width:100%;height:1px;left:0;top:0;background-color:rgba(0,0,0,0.2)"><div id="waitPopup"><img src="/html/cm/img/wait.gif" alt="" style="width:100%" /><div style="100%;padding-top:4px;text-align:center">'+lang('please wait')+'</div></div></div>');}}}
ORYANOO.handlerInit=function(){}
ORYANOO.keydown_manage=function(e){}
ORYANOO.mouseup_manage=function(e){}
ORYANOO.mousedown_manage=function(e){}
ORYANOO.mousemove_manage=function(e){}
ORYANOO.resize_info={};ORYANOO.resize_manage=function(){}
var bg_colors={yellow:'#FC0',orange:'#F90',red:'#C33',green:'#090',blue:'#36C',violet:'#C3F','grey':'#CCC','white':'#FFF','select':'#D8E7FC'};var border_colors={yellow:'#999',orange:'#F90',red:'#900',green:'#999',blue:'#999',violet:'#999','grey':'#999','white':'#999','select':'#999'};var text_colors={yellow:'#FFF',orange:'#FFF',red:'#FFF',green:'#FFF',blue:'#FFF',violet:'#FFF','grey':'#333','white':'#000','select':'#000'};var lastClick;var modified;var xMouse=0;var yMouse=0;var winH=0;var winW=0;var midnightStop=0;var synthesisAction;var synthesisUrl;var synthesisParam1;var cb_separator='|';var ies=new ORYANOO();var ORYANOOelementMethods={setColor:function(element,colorName){element=$(element);element.style.color=text_colors[colorName];element.style.backgroundColor=bg_colors[colorName];element.style.border='1px solid '+border_colors[colorName];return element;},Center:function(element){if(navigator.appName!="Microsoft Internet Explorer"){element.style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth/2-element.getWidth()/2)+'px';element.style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight/2-element.getHeight()/2)+'px';}else{element.style.left=(document.body.scrollLeft+document.body.clientWidth/2-element.getWidth()/2)+'px';element.style.top=(document.body.scrollTop+document.body.clientHeight/2-element.getHeight()/2)+'px';if(document.body.clientHeight==0){element.style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth/2-element.getWidth()/2)+'px';element.style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight/2-element.getHeight()/2)+'px';}}},print:function(element){var jsDate=new Date();var printIframe='printIframe'+jsDate.getMilliseconds();var w=window.open();var d=w.document;d.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');d.write('<html>');d.write('<body onload="self.print()">');d.write(element.innerHTML);d.write('</body>');d.write('</html>');d.close();},fireEvent:function(element,event){if(document.createEventObject){var evt=document.createEventObject();return element.fireEvent('on'+event,evt)}
else{var evt=document.createEvent("HTMLEvents");evt.initEvent(event,true,true);return!element.dispatchEvent(evt);}}};Element.addMethods(ORYANOOelementMethods);ORYANOO.evalJson=function(tab){out=[];$H(tab).each(function(row){out[$A(row)[0]]=$A(row)[1];});return out;}
Synthesis.selected=[];Synthesis.Check=function(id){if($(id).checked){Synthesis.selected=[Synthesis.selected,id.replace(id.split('_')[0]+'_','')].flatten();}else{Synthesis.selected=Synthesis.selected.without(id.replace(id.split('_')[0]+'_',''));}}
Synthesis.CheckAll=function(obj){var x=document.getElementsByTagName('*');var len=x.length;var classString=obj?obj.id:'SynCb';Synthesis.selected=[];for(var i=0;i<len;i++){if(x[i].id&&x[i].id.substring(0,classString.length+1)==classString+'_'){if($(classString).checked){Synthesis.selected=[Synthesis.selected,x[i].id.replace(classString+'_','')].flatten();$(x[i].id).checked=true;}else{$(x[i].id).checked=false;}}}}
function navigator_support(){alert(navigator.appName);alert(navigator.appVersion);alert(navigator.propriete);}
function tinymce_set_height(h){if($('text2edit_ifr')){$('text2edit_ifr').style.height=h+'px';}else{setTimeout("tinymce_set_height("+h+")",100);}}
function tinymce_update(){tinyMCE.get('text2edit').setContent(tinyMCE.activeEditor.getContent());}
function tinymce_submit(){tinymce_update();document.outputForm.submit();}
function portal_to_tinymce(data_id){if(!top.ies.tinymceDialog)return false;if(top.ies.tinymceDialog.document.getElementById('href')){var f_url='/intranet-e/portal/download.ies?data_id='+data_id;var tinymceDialog=top.ies.tinymceDialog;new Ajax.Request(url='/intranet-e/portal/index.ies',{method:'post',parameters:{ieAction:'get_public_url',data_id:data_id},onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){if(content.url){tinymceDialog.setFormValue('href',content.url);}else{alert(lang('error not public folder'));}
delete top.ies.tinymceDialog;}}.bind(this)});}else{new Ajax.Request(url='/intranet-e/portal/index.ies',{method:'post',parameters:{ieAction:'get_public_url',data_id:data_id},onSuccess:function(xhr){content=xhr.responseText.evalJSON();if(content.status=='ok'){if(content.url){var f_url=content.url;}else{var f_url='/intranet-e/portal/image_view.ies?data_id='+data_id;}
top.ies.tinymceDialog.document.getElementById('src').value=f_url;top.ies.tinymceDialog.ImageDialog.showPreviewImage(f_url);delete top.ies.tinymceDialog;}}.bind(this)});}}
function rgba(red,green,blue,opacity){if(!red)return'';if(navigator.appName=='Microsoft Internet Explorer'){var version=parseInt(navigator.appVersion.split('MSIE ')[1].split(';')[0]);var rgba=(version>=9)?true:false;}else{var rgba=true;}
if(typeof opacity=='undefined'){var r=bg_colors[red][1]+bg_colors[red][1];var g=bg_colors[red][2]+bg_colors[red][2];var b=bg_colors[red][3]+bg_colors[red][3];opacity=green;if(rgba){return'rgba('+parseInt(r,16)+','+parseInt(g,16)+','+parseInt(b,16)+','+opacity+')';}else{return opacity==1?'rgb('+parseInt(r,16)+','+parseInt(g,16)+','+parseInt(b,16)+')':'';}}else{if(rgba){return'rgba('+parseInt(red)+','+parseInt(green)+','+parseInt(blue)+','+opacity+')';}else{return'rgb('+parseInt(red)+','+parseInt(green)+','+parseInt(blue)+')';}}}
function open_ab(ab_id){top.ies.window.tab.open('/intranet-e/contacts/contact_view.ies?object=ab&ab_id='+ab_id,'ab_id_'+ab_id);}
function open_company(company_id){top.ies.window.tab.open('/intranet-e/contacts/contact_view.ies?object=company&company_id='+company_id,'company_id_'+company_id);}
function open_op(op_id){top.ies.window.tab.open('/intranet-e/contacts/operation_edit.ies?op_id='+op_id,'op_id_'+op_id);}
function dial(transport,phone,options){switch(transport){case'sip':var num1='sip:';break;case'skype':case'skypeout':case'callto':var num1='callto://';break;default:alert(lang('automatic dialing is inactive'));}
if(transport!='skype'){var num2=phone.replace(new RegExp("[^(0-9+)]","g"),'');}else{var num2=phone;}
if(options['remove_first_digit']&&num2.length==10){num2=num2.substr(1);}
if(options['country_code']){num2='+'+options['country_code']+num2;}
if(num2.length>0)location=num1+num2;return false;}
function mapOpen(id,field){if(!id||!field)return false;window.open('/intranet-e/contacts/map_open.ies?id='+id+'&field='+field,'','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes');}
function On(iobject){if($(iobject)){$(iobject).style.visibility='visible';}else{top.ie_main.document.getElementById(iobject).style.visibility='visible';}}
function Off(iobject){if($(iobject)){$(iobject).style.visibility='hidden';}else if(top.ie_main&&top.ie_main.document.getElementById(iobject)){top.ie_main.document.getElementById(iobject).style.visibility='hidden';}}
function OnOff(iobject){if(document.getElementById(iobject)){var o=document.getElementById(iobject);}else{var o=top.ie_main.document.getElementById(iobject);}
if(o.style.visibility=='visible')o.style.visibility='hidden';else o.style.visibility='visible';}
function Status(text){window.status=text;}
function WaitOff(){}
function WaitOn(){}
function close_if_not_main(param){if(self.name!='ie_main'){if(top.window.opener){if(top.window.opener.closeWindowHandler){top.window.opener.closeWindowHandler(param);}}
window.close();}}
function submitFormAjax(f){if(!$('ajaxIframe')){$('body').insert('<iframe id="ajaxIframe" name="ajaxIframe" src="" onload="submitHandler()" style="display:none"></iframe>');}
document.outputForm.target='ajaxIframe';document.outputForm.submit();submitHandler=f;}
function getRequestContent(){var d='';if($('ajaxIframe')){var i=$('ajaxIframe');if(i.contentDocument){d=i.contentDocument;}else if(i.contentWindow){d=i.contentWindow.document;}else{d=window.frames["messageIframe"].document;}}
return d.body.innerHTML.evalJSON();}
function iesHandler(){if($('mainDiv')){var height=0;if($('ie_main')){height=$('ie_main').getHeight();}else if(top.$('ie_main')){height=top.$('ie_main').getHeight();}else if(document.all){height=document.documentElement.clientHeight;if(height<=0)height=document.body.clientHeight+document.body.scrollTop;}else{height=window.innerHeight+window.pageYOffset;}
$('mainDiv').show();$('mainDiv').style.visibility='visible';$('mainDiv').style.height=(height-50)+'px';}
if(top.ies&&top.ies.window){if(typeof dochistory!='undefined'){top.ies.window.set_tab_label(dochistory.label,dochistory.object);top.ies.window.history.add(dochistory.url,dochistory.label,dochistory.object,dochistory.image);}else{top.ies.window.set_tab_label(doctitle);}}
if($('m2tWidget2'))widget2top('m2tWidget2','widget2');if($('m2tWidget3'))widget2top('m2tWidget3','widget3');if(typeof iesStatus!="undefined"&&iesStatus.length>0){new ORYANOO.dialog().popup_status(iesStatus);iesStatus='';}
if(ORYANOO.my_resize_manage)ORYANOO.my_resize_manage();Event.observe(window,'resize',iesHandler);if(top.ies&&top.ies.window){Event.observe(document,'mousemove',top.ies.window.mousemove_manage);}
return true;}
function validate_and_submit(direct,nextStep,cmFrm){if(typeof local_check=='function'){if(!local_check()){return false;}}
var error=false;function radio_check(name){var checked=false;$$('.mandatoryField').each(function(obj){if(obj.name==name&&obj.checked)checked=true;});return checked;}
var errColor='#FCC';var okColor='#FFF';$$('.mandatoryField').each(function(obj){switch(obj.type){case'radio':var checked=radio_check(obj.name);if(!checked)error=true;obj.ancestors()[0].setStyle({backgroundColor:checked?okColor:errColor});break;case'hidden':if(obj.value.length==0)error=true;obj.ancestors()[0].setStyle({backgroundColor:(obj.value.length==0?errColor:okColor)});break;default:if(obj.value.length==0)error=true;obj.ancestors()[0].setStyle({backgroundColor:obj.value.length==0?errColor:okColor});obj.setStyle({backgroundColor:obj.value.length==0?errColor:okColor});break;}});if(error){alert(lang('highlighted_fields_are_mandatory'));return false;}
document.outputForm.nextStep.value=nextStep;document.outputForm.ieAction.value='save';document.outputForm.submit();return true;}
function validate_cb(special){var str='';var x=document.getElementsByTagName('*');var i;for(i=0;i<x.length;i++){if(x[i].id&&x[i].id.split(':')[1]==special&&x[i].checked){str+=(str.length>0?' '+cb_separator+' ':'')+x[i].value;}}
$(special).value=str;if(form_updated)form_updated();}
function form_updated(){if(top.ie_top){top.modified=true;}else{modified=true;}}
function status_display(str,img){if($('status')){$('status').update(str);}}
function onreturn(e,submitfunction){if(navigator.appName=='Netscape'){if(e.keyCode==13){eval(submitfunction.replace('top.ie_main.',''));return true;}else{return false;}}else if(window.event){if(window.event.type=="keypress"&window.event.keyCode==13){eval(submitfunction.replace('top.ie_main.',''));}
return!(window.event.type=="keypress"&window.event.keyCode==13);}}
function label(str){if($('label')){if(str){$('label').innerHTML=str;$('label').style.left=(xMouse-10)+'px';$('label').style.top=(yMouse+30)+'px';$('label').style.display='block';}else{$('label').innerHTML='';$('label').style.display='none';}}else{document.getElementById('status').innerHTML=str;}
return;if(top.ie_top){top.ie_top.document.getElementById('status').innerHTML=str;}else{document.getElementById('status').innerHTML=str;}}
function mouselabel(e){return true
if(navigator.appName=='Microsoft Internet Explorer'){posX=event.clientX;posY=event.clientY;}else{posX=e.pageX;posY=e.pageY;}
posY=posY-getHeight('label')-30;if(posX>document.body.clientWidth/2){if(posX>document.body.clientWidth){posX=posX-top.ie_main.document.getElementById('label').offsetWidth-20;}else{posX=posX-top.ie_main.document.getElementById('label').offsetWidth;}}
if(posX<0){posX=0;}
if(posY<0){posY=0;}
top.ie_main.document.getElementById('label').style.left=posX+'px';top.ie_main.document.getElementById('label').style.top=posY+'px';return true}
function bodywidth(){return document.body.clientWidth;}
function rollover(img,src){document.images[img].src=src;}
function getClientHeight(){if(self.innerHeight){return self.innerHeight;}else{return document.body.clientHeight;}}
function getHeight(obj){if(document.getElementById(obj)){if(document.getElementById(obj).offsetHeight){return document.getElementById(obj).offsetHeight;}else{return document.getElementById(obj).style.height;}}else{if(top.ie_main.document.getElementById(obj).offsetHeight){return top.ie_main.document.getElementById(obj).offsetHeight;}else{return top.ie_main.document.getElementById(obj).style.height;}}}
function setHeight(obj,val){top.ie_main.document.getElementById(obj).style.height=val;}
function getX(obj){return top.ie_main.document.getElementById(obj).style.left;}
function HideSelect(){if(navigator.appName=='Microsoft Internet Explorer'){oSelects=document.getElementsByTagName('SELECT');if(oSelects.length>0){for(i=0;i<oSelects.length;i++){oSelects[i].style.visibility='hidden';}}}}
function ShowSelect(){if(navigator.appName=='Microsoft Internet Explorer'){oSelects=document.getElementsByTagName('SELECT');if(oSelects.length>0){for(i=0;i<oSelects.length;i++){oSelects[i].style.visibility='visible';}}}}
function m1(obj){if(!lastClick){cls=obj.className.replace('over','');cls=cls.replace('click','');obj.className=cls;}}
function m2(obj){if(!lastClick){cls=obj.className.replace('over','');cls=cls.replace('click','');obj.className=cls+'over';obj.style.textDecoration='none';}}
function m3(obj){cls=obj.className.replace('over','');cls=cls.replace('click','');lastClick=cls;obj.className=cls+'click';obj.blur();setTimeout("lastClick='';","1000");}
function autoTarget(target,url,what,formName){switch(what){case'javascript':url=url.replace('top.ie_main.','');eval(url);break;case'location':location=url;break;case'submit':if(top.ie_main){if(formName=='_editor'){top.ie_main.formSubmit();}else{if(top.ie_main.document.forms[formName]){top.ie_main.document.forms[formName].target=target;top.ie_main.document.forms[formName].action=url;top.ie_main.document.forms[formName].method='POST';top.ie_main.document.forms[formName].submit();}else{document.forms[formName].action=url;document.forms[formName].method='POST';document.forms[formName].submit();}}}else{if(formName=='_editor'){formSubmit();}else{if(top.ie_main||(target&&target!='ie_main')){document.forms[formName].target=target;}
document.forms[formName].action=url;document.forms[formName].method='POST';document.forms[formName].submit();}}
break;default:}}
function widget2top(src,dst){$(dst).innerHTML=$(src).innerHTML;return true;}
function widgetReset(widget){if(!widget)widget='widget2';if(typeof top.topLoaded!="undefined"){top.ie_top.document.getElementById(widget).innerHTML='';}else if(!top.ie_main){if(document.getElementById(widget)){document.getElementById(widget).innerHTML='';}}}
function attachButton(str1,str2,formName,goFlag){if(!formName)formName='outputForm';bId=document.getElementById('attachButton');if(bId.style.display=='inline'){bId.style.display='none';}else{bId.innerHTML='<input type="file" name="uploadfile" onchange="upload_validate(\''+str1+'\',\''+str2+'\',\''+formName+'\')" />';bId.style.display='inline';}}
function upload_validate(str1,str2,formName){bId=document.getElementById('attachButton');if(!document.forms[formName].uploadfile.value)return false;text=str1+' :\n\n'+document.forms[formName].uploadfile.value+'\n\n'+str2;result=confirm(text);if(result==true){document.forms[formName].ieAction.value='attach';if(typeof(formSubmit)=='function'){formSubmit();}else{document.forms[formName].submit();}
bId.innerHTML='<img src="/html/cm/img/wait.gif" style="vertical-align: -20%" height="16" alt=""/>';return true;}else{bId.style.display='none';document.forms[formName].reset();return false;}}
function synthesis_widget(what,url,param1){synthesisAction=what;synthesisUrl=url;synthesisParam1=param1;}
function searchRun(reset){if(reset){$('synthesisQuery').value='';$$("#body .multiquery").each(function(obj){obj.value='';});}
synthesis_widget1('submit');}
function searchOption(optionId){if(document.getElementById(optionId).style.fontWeight=='bold'){document.searchForm.synthesis_query_option.value=document.searchForm.synthesis_query_option.value.replace(optionId.replace('sopt','')+':','');document.getElementById(optionId).style.fontWeight='normal';}else{document.searchForm.synthesis_query_option.value+=optionId.replace('sopt','')+':';document.getElementById(optionId).style.fontWeight='bold';}}
function synthesis_search(what,url,param1){if(document.getElementById('searchDiv').style.display=='block'){document.getElementById('searchDiv').style.display='none';}else{widgetMenu();if(self.name=='ie_main'){document.getElementById('searchDiv').style.top='1px';}else{document.getElementById('searchDiv').style.top='31px';}
document.getElementById('searchDiv').style.left=document.searchForm.synthesis_div_left.value+'px';var x=document.getElementsByTagName('*');var i;for(i=0;i<x.length;i++){if(x[i].id){what=x[i].id.substring(0,4);switch(what){case'sopt':if(document.searchForm.synthesis_query_option.value.indexOf(x[i].id.replace('sopt',''))>=0){document.getElementById(x[i].id).style.fontWeight='bold';}
break;default:}}}
document.getElementById('searchDiv').style.display='block';}
return true;}
function synthesis_widget1(what,url,param1){if(!url)url='';if(!param1)param1='';synthesis_widget2(what,url,param1);}
function synthesis_widget2(what,url,param1){if(!url)url='';if(!param1)param1='';var t_multiquery=[];switch(what){case'submit':if(self.name=='ie_top'){top.ie_main.$$("#body .multiquery").each(function(obj){var key=obj.id;var val=obj.value;t_multiquery[t_multiquery.length]=$H({key:key,val:val});});top.ie_main.document.searchForm.synthesis_multiquery.value=Object.toJSON(t_multiquery);top.ie_main.document.searchForm.synthesis_query.value=document.getElementById('synthesisQuery').value;top.ie_main.document.searchForm.row_count.value=document.getElementById('rowCount').value;top.ie_main.document.searchForm.synthesis_action.value=param1;var x=top.ie_main.document.getElementsByTagName('*');var i;for(i=0;i<x.length;i++){if(x[i].id){what=x[i].id.substring(0,6);switch(what){case'filter':top.ie_main.document.getElementById('synthesis_'+x[i].id).value=document.getElementById(x[i].id).value;default:}}}
top.ie_main.document.searchForm.submit();}else{$$("#body .multiquery").each(function(obj){var key=obj.id;var val=obj.value;t_multiquery[t_multiquery.length]=$H({key:key,val:val});});document.searchForm.synthesis_multiquery.value=Object.toJSON(t_multiquery);document.searchForm.synthesis_query.value=document.getElementById('synthesisQuery').value;document.searchForm.row_count.value=document.getElementById('rowCount').value;document.searchForm.synthesis_action.value=param1;var x=document.getElementsByTagName('*');var i;for(i=0;i<x.length;i++){if(x[i].id){what=x[i].id.substring(0,6);switch(what){case'filter':document.getElementById('synthesis_'+x[i].id).value=document.getElementById(x[i].id).value;default:}}}
document.searchForm.submit();}
break;case'pagecurrent':current=document.getElementById('pagecurrent').value-1;autoTarget('ie_main',url+(param1*current),'location','');break;default:}}
function widgetMenu(id,leftPos){var x=document.getElementsByTagName('*');var i;for(i=0;i<x.length;i++){if(x[i].id){what=x[i].id.substring(0,7);switch(what){case'MenuDiv':case'searchD':document.getElementById(x[i].id).style.display='none';break;default:}}}
if(id){var obj=$('MenuDiv'+id);if(top.ie_main){obj.style.top='1px';}else{obj.style.top='31px';}
if(document.all){winH=document.documentElement.clientHeight;}else{winH=window.innerHeight+window.pageYOffset;}
winH-=60;if(obj.getHeight()>winH){obj.style.height=winH+'px';}
obj.style.left=leftPos+'px';if(obj.style.display=='block'){obj.style.display='none';}else{obj.style.display='block';}}
return true;}
function logout(){top.location='/intranet-e/logout.ies';}
function opacitySet(obj,val){if(document.all){}else{obj.style.MozOpacity=val;}}
function dialer_run(text,phone){if(confirm(text)){extra='directories=no,menubar=no,toolbar=no,scrollbars=no,resizable=no,width=500,height=250';window.open('cti.ies?phone='+phone,'dialer',extra);}
return false;}
if(typeof(Effect)!='undefined'){Effect.Scroll=Class.create();Object.extend(Object.extend(Effect.Scroll.prototype,Effect.Base.prototype),{initialize:function(element){this.element=$(element);var options=Object.extend({x:0,y:0,mode:'absolute'},arguments[1]||{});this.start(options);},setup:function(){if(this.options.continuous&&!this.element._ext){this.element.cleanWhitespace();this.element._ext=true;this.element.appendChild(this.element.firstChild);}
this.originalLeft=this.element.scrollLeft;this.originalTop=this.element.scrollTop;if(this.options.mode=='absolute'){this.options.x-=this.originalLeft;this.options.y-=this.originalTop;}},update:function(position){this.element.scrollLeft=this.options.x*position+this.originalLeft;this.element.scrollTop=this.options.y*position+this.originalTop;}});}
function divScrollTo(container,element,param){if(!param)param={};if(param.effect){Position.prepare();container_y=Position.cumulativeOffset($(container))[1]+(param.middle?$(container).getHeight()/2:0);element_y=Position.cumulativeOffset($(element))[1];new Effect.Scroll(container,{x:0,y:(element_y-container_y)});return false;}else{container=$(container);element=$(element);var posDiv=Position.cumulativeOffset(container);var posTo=Position.cumulativeOffset(element);container.scrollTop=posTo[1]-posDiv[1];}}
function iesTabSelect(button){$$("#body .tab_content").each(function(obj){obj.hide();if($(obj.id.replace("tab_content_","tab_button_print_")))$(obj.id.replace("tab_content_","tab_button_print_")).hide();$(obj.id.replace("tab_content_","tab_button_")).className='tab_button2';});$(button.id.replace("tab_button_","tab_content_")).show();if($(button.id.replace("tab_button_","tab_button_print_")))$(button.id.replace("tab_button_","tab_button_print_")).show();$(button.id).className='tab_button2_selected';}
function makeRequest(url,data,onreadyFunction,onreadyArg){var http_request=false;if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/xml');}}else if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(!http_request){alert('Giving up :( Cannot create an XMLHTTP instance');return false;}
if(onreadyArg){eval('http_request.onreadystatechange = function() { '+onreadyFunction+'(http_request,\''+onreadyArg+'\'); };');}else{eval('http_request.onreadystatechange = function() { '+onreadyFunction+'(http_request); };');}
http_request.open('POST',url,true);http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');http_request.send(data);}
function drgImg(content){if($('drgImg'))$('drgImg').remove();if(content){$('body').insert('<div id="drgImg">'+content+'</div>');}}
var uploadQueueComplete=function(){};var uploader='';function uploadDialog(params){var html='';var title=params.params.title?params.params.title:lang('attach files');html+='<div id="uploadDialog">'
+' <div id="uploadLabel">'+title+'</div>'
+' <div id="uploadTools">'
+'  <div id="uploadButtonClose" onclick="uploader._handler.cancelAll();$(\'uploadDialog\').fade()"></div>'
+'  <div id="uploadButton"></div>'
+' </div>'
+' <div id="uploadDialogList"></div>'
+'</div>';$('uploadDialogDiv').innerHTML=html;$('uploadDialog').style.left=((winW-$('uploadDialog').getWidth())/2)+'px';$('uploadDialog').style.top=((winH-$('uploadDialog').getHeight())/2)+'px';$('uploadButtonClose').absolutize();params.element=$('uploadButton');params.listElement=$('uploadDialogList');uploader=new qq.FileUploader(params);}
function trim(s){while(s.substring(0,1)==' '){s=s.substring(1,s.length);}
while(s.substring(s.length-1,s.length)==' '){s=s.substring(0,s.length-1);}
return s;}
function mimeImage(fname){return'<img src="/html/cm/img/mime_'+mimeType(fname)+'" border="0" />';}
function mimeType(fname){var suffix=suffixGet(fname);switch(suffix){case'odb':case'odf':case'odg':case'odm':case'odp':case'ods':case'odt':case'otg':case'oth':case'otp':case'ots':case'ott':return suffix+'.png';break;case'doc':return'doc.gif';break;case'gif':case'png':return'gif.gif';break;case'jpg':case'jpeg':return'jpg.gif';break;case'pdf':return'pdf.gif';break;case'xls':return'xls.gif';break;case'zip':return'zip.gif';break;case'sxw':case'sxi':case'sxc':case'sxd':return'ooo';break;case'ppt':return'ppt.gif';break;case'psd':return'psd.gif';break;break;case'ai':return'ai.gif';break;case'avi':return'avi.gif';break;default:return'unknown.gif';break;}}
function suffixGet(fname){var tfname=fname.split('.');return trim(tfname[tfname.length-1].toLowerCase());}
function classEdit(classname,attribute,value){var i=0;var sts=0;var done=false;if(!document.styleSheets)return;var regles=new Array();for(sts=0;sts<document.styleSheets.length;sts++){if(document.styleSheets[sts].cssRules){regles=document.styleSheets[sts].cssRules}else if(document.styleSheets[sts].rules){regles=document.styleSheets[sts].rules}
for(i=0;i<regles.length;i++){if(regles[i].selectorText==classname){str='regles['+i+'].'+attribute+"='"+value+"';";eval(str);done=true;break;}}
if(done==true)break;}}
function setCookie(name,value,expires,path,domain,secure)
{document.cookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");}
function getCookie(name)
{var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else{begin+=2;}
var end=document.cookie.indexOf(";",begin);if(end==-1){end=dc.length;}
return unescape(dc.substring(begin+prefix.length,end));}
function deleteCookie(name,path,domain)
{if(getCookie(name)){document.cookie=name+"="+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}
function lang(txt){if(tlang[txt]){return tlang[txt];}else{return txt;}}
function _input(type,param){var out='<input type="'+type+'"';$H(param).each(function(val){out+=' '+val[0]+'="'+val[1]+'"';if(val[0]=='id')out+=' name="'+val[1]+'"';});out+=' />';return out;}
function input(param){return _input('text',param);}
function hidden(param){return _input('hidden',param);}
function button(param){return _input('button',param);}
function checkbox(param){return _input('checkbox',param);}
function select(param){var out='<select';if(param.id)out+=' id="'+param.id+'" name="'+param.id+'"';out+='>';param.values.each(function(v){out+='<option value="'+v.key+'"'+(param.selected&&param.selected==v.key?' selected="selected"':'')+'>'+v.val+'</option>';});out+='</select>';return out;}
function debug(str,reset){var jsDate=new Date();var H=jsDate.getHours();var i=jsDate.getMinutes();var s=jsDate.getSeconds();H=(H<10?'0':'')+H;i=(i<10?'0':'')+i;s=(s<10?'0':'')+s;str=H+':'+i+':'+s+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+str;if(!window.top.$('debugDiv')){var top=50;var left=200;var width=600;var height=45;window.top.$('body').insert('<div id="debugDiv" style="position:absolute;z-index:2000;top:'+top+'px;left:'+left+'px;width:'+width+'px;height:'+height+'px;opacity:0.9;background-color:#EEE;border:1px solid #666;overflow:auto"></div>');}
if(reset){window.top.$('debugDiv').update(str);}else{window.top.$('debugDiv').update(str+'<br/>'+window.top.$('debugDiv').innerHTML);}}
function getWinW(){if(document.all){return document.documentElement.clientWidth;}else{return window.innerWidth+window.pageXOffset;}}
function getWinH(){if(document.all){return document.documentElement.clientHeight;}else{return window.innerHeight+window.pageYOffset;}}
function tab_print(id,label){var i=$(id);w=open('','popup','toolbar=yes,scrollbars=yes,resizable=yes');w.document.write('<html>');w.document.write('<head>');w.document.write('<style type="text/css">');w.document.write('table { font-size: 12px; font-family: Arial,Trebuchet MS,Verdana }');w.document.write('div { padding: 10px; margin-bottom:10px; background-color:#EEE;border:1px solid #999; -moz-border-radius:8px; font-size: 12px; font-family: Arial,Trebuchet MS,Verdana }');w.document.write('.colR { border-bottom:1px solid #999 }');w.document.write('.colL { border-bottom:1px solid #999; font-weight:bold }');w.document.write('</style>');w.document.write('</head>');w.document.write('<body>');w.document.write('<div><h1>'+$('page_title').innerHTML+'</h1>'+label+'</div>');w.document.write('<table cellpadding="4" cellspacing="0" border="0" width="100%" align="center">');w.document.write($(id).innerHTML);w.document.write('</table>');w.document.write('<script>self.print()</script>');w.document.write('</body>');w.document.write('</html>');w.document.close();}
function js_filter(txt){return txt.replace(/'/g,"\\'");}
function radio_value(radio_class){var retval='';$$("#body ."+radio_class).each(function(obj){if(obj.checked)retval=obj.value;});return retval;}
function calendar_rpt_edit_target(){if($('cal_start_date_show')&&radio_value('rpt_edit_target')!='all'){$('cal_start_date_show').value=$('rpt_start_of_day_show').value;$('cal_start_date').value=$('rpt_start_of_day').value;}}
Date.prototype.getWeek=function(){var determinedate=new Date();determinedate.setFullYear(this.getFullYear(),this.getMonth(),this.getDate());var D=determinedate.getDay();if(D==0)D=7;determinedate.setDate(determinedate.getDate()+(4-D));var YN=determinedate.getFullYear();var ZBDoCY=Math.floor((determinedate.getTime()-new Date(YN,0,1,-6))/86400000);var WN=1+Math.floor(ZBDoCY/7);return WN;}
var Resizeable=Class.create();Resizeable.prototype={initialize:function(element){var options=Object.extend({top:6,bottom:6,left:6,right:6,minHeight:0,minWidth:0,zindex:1000,resize:null},arguments[1]||{});this.element=$(element);this.handle=this.element;Element.makePositioned(this.element);this.options=options;this.active=false;this.resizing=false;this.currentDirection='';this.eventMouseDown=this.startResize.bindAsEventListener(this);this.eventMouseUp=this.endResize.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.eventCursorCheck=this.cursor.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);this.registerEvents();},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);this.unregisterEvents();},registerEvents:function(){Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress);Event.observe(this.handle,"mousedown",this.eventMouseDown);Event.observe(this.element,"mousemove",this.eventCursorCheck);},unregisterEvents:function(){},startResize:function(event){if(Event.isLeftClick(event)){var src=Event.element(event);if(src.tagName&&(src.tagName=='INPUT'||src.tagName=='SELECT'||src.tagName=='BUTTON'||src.tagName=='TEXTAREA'))return;var dir=this.directions(event);if(dir.length>0){this.active=true;var offsets=Position.cumulativeOffset(this.element);this.startTop=offsets[1];this.startLeft=offsets[0];this.startWidth=parseInt(Element.getStyle(this.element,'width'));this.startHeight=parseInt(Element.getStyle(this.element,'height'));this.startX=event.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;this.startY=event.clientY+document.body.scrollTop+document.documentElement.scrollTop;this.currentDirection=dir;Event.stop(event);}}},finishResize:function(event,success){this.active=false;this.resizing=false;if(this.options.zindex)
this.element.style.zIndex=this.originalZ;if(this.options.resize){this.options.resize(this.element);}},keyPress:function(event){if(this.active){if(event.keyCode==Event.KEY_ESC){this.finishResize(event,false);Event.stop(event);}}},endResize:function(event){if(this.active&&this.resizing){this.finishResize(event,true);Event.stop(event);}
this.active=false;this.resizing=false;},draw:function(event){var pointer=[Event.pointerX(event),Event.pointerY(event)];var style=this.element.style;if(this.currentDirection.indexOf('n')!=-1){var pointerMoved=this.startY-pointer[1];var margin=Element.getStyle(this.element,'margin-top')||"0";var newHeight=this.startHeight+pointerMoved;if(newHeight>this.options.minHeight){style.height=newHeight+"px";style.top=(this.startTop-pointerMoved-parseInt(margin))+"px";}}
if(this.currentDirection.indexOf('w')!=-1){var pointerMoved=this.startX-pointer[0];var margin=Element.getStyle(this.element,'margin-left')||"0";var newWidth=this.startWidth+pointerMoved;if(newWidth>this.options.minWidth){style.left=(this.startLeft-pointerMoved-parseInt(margin))+"px";style.width=newWidth+"px";}}
if(this.currentDirection.indexOf('s')!=-1){var newHeight=this.startHeight+pointer[1]-this.startY;if(newHeight>this.options.minHeight){style.height=newHeight+"px";}}
if(this.currentDirection.indexOf('e')!=-1){var newWidth=this.startWidth+pointer[0]-this.startX;if(newWidth>this.options.minWidth){style.width=newWidth+"px";}}
if(style.visibility=="hidden")style.visibility="";},between:function(val,low,high){return(val>=low&&val<high);},directions:function(event){var pointer=[Event.pointerX(event),Event.pointerY(event)];var offsets=Position.cumulativeOffset(this.element);var cursor='';if(this.between(pointer[1]-offsets[1],0,this.options.top))cursor+='n';if(this.between((offsets[1]+this.element.offsetHeight)-pointer[1],0,this.options.bottom))cursor+='s';if(this.between(pointer[0]-offsets[0],0,this.options.left))cursor+='w';if(this.between((offsets[0]+this.element.offsetWidth)-pointer[0],0,this.options.right))cursor+='e';return cursor;},cursor:function(event){var cursor=this.directions(event);if(cursor.length>0){cursor+='-resize';}else{cursor='';}
this.element.style.cursor=cursor;},update:function(event){if(this.active){if(!this.resizing){var style=this.element.style;this.resizing=true;if(Element.getStyle(this.element,'position')=='')
style.position="relative";if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,'z-index')||0);style.zIndex=this.options.zindex;}}
this.draw(event);if(navigator.appVersion.indexOf('AppleWebKit')>0)window.scrollBy(0,0);Event.stop(event);return false;}}}
