function change_header_color(id,color1,bottom){get(id).style.color='#'+color1;if(bottom==true){get(id).style.borderBottom='4px solid #'+color1;}else{get(id).style.borderTop='4px solid #'+color1;}}
function showHintMessage(e){var activeElement=Event.element(e);var filed_id=activeElement.id
var close_str='<br /><center><a href="javascript:void(0);" onClick="$(\'description_tip\').hide();">close</a></center>';var html;var i;for(i=0;i<hints.length;i++){if(hints[i].field==filed_id){html=hints[i].hint;break;}}
$('description_tip').innerHTML=html+close_str;var windowSize=getClientWindowSize();var windowScrollSize=getScrollXY();var elementSize={height:$('description_tip').getHeight(),width:$('description_tip').getWidth()};var pointY=Event.pointerY(e);var pointX=Event.pointerX(e);if(Event.pointerY(e)-windowScrollSize.height>windowSize.height-elementSize.height-30){pointY=pointY-elementSize.height;}
if(Event.pointerX(e)-windowScrollSize.width>windowSize.width-elementSize.width-30){pointX=pointX-elementSize.width;}
$('description_tip').setStyle({top:pointY+'px',left:pointX+'px',display:'block'});}
function getClientWindowSize(){var myWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;}
return{width:myWidth,height:myHeight};}
function getScrollXY(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
return{width:scrOfX,height:scrOfY};}
function startObserveringHints(){var els=document.getElementsByClassName('a_hint');for(var i=0;i<els.length;i++){Event.observe(els[i],'click',showHintMessage);}
if($('description_tip')){Event.observe(document,'click',function(e){var activeElement=Event.element(e);if(!(activeElement.id&&activeElement.id=='description_tip')&&!activeElement.hasClassName('a_hint')){$('description_tip').setStyle({display:'none'});}});Event.observe('description_tip','mouseout',function(e){window.description_tip_timeout=window.setTimeout(function(){$('description_tip').setStyle({display:'none'});},2000);});Event.observe('description_tip','mouseover',function(e){window.clearTimeout(window.description_tip_timeout);});}}
function get(id){return document.getElementById(id);}
function addCSS(filename){var adder=document.createElement('link');adder.href=filename;adder.rel="stylesheet";adder.type='text/css';document.getElementsByTagName('head').item(0).appendChild(adder);}
function addJS(filename){var adder=document.createElement('script');adder.src=filename;adder.type='text/javascript';document.getElementsByTagName('head').item(0).appendChild(adder);}
function redirect(seconds,url){var sec=seconds*1000;var func="doRedir('"+url+"')";setTimeout(func,sec);}
function doRedir(url){window.location=url;}
function showHelp(what){var width=700;var height=400;var wleft=(screen.width-width)/2;var wtop=(screen.height-height)/2;if(wleft<0){width=screen.width;wleft=0;}
if(wtop<0){height=screen.height;wtop=0;}
var neg_win;neg_win=window.open("index.php?p=h&topic="+what,"neg_help","status = 1, height = "+height+", width = "+width+", resizable = 0, scrollbars = 1");neg_win.moveTo(wleft,wtop);neg_win.moveTo(10,10);neg_win.focus();}
function onClickFirstLevelLink(e){var action_element=Event.element(e);if(action_element.tagName=='A'){action_element=action_element.up('div');}
var first_level_links=$('main_menu').getElementsByClassName('menu_1st_adiv');for(var i=0;i<first_level_links.length;i++){first_level_links[i].removeClassName('menu_1st_adiv_active');}
action_element.addClassName('menu_1st_adiv_hover');action_element.addClassName('menu_1st_adiv_active');var link_tag=action_element.down('A');if(link_tag&&link_tag.href&&/^https?:\/\//.test(link_tag.href)&&action_element.id!="link1_sup"){document.location.href=link_tag.href;}
var second_level_links=document.getElementsByClassName('menu_2nd_div');for(var i=0;i<second_level_links.length;i++){$(second_level_links[i]).addClassName('hide');}
var id_match=action_element.id.match(/link1_(.+)/);if(id_match){var needed_submenu=$('menu2_'+id_match[1]);if(needed_submenu){needed_submenu.removeClassName('hide');}}}
function onMouseOverFirstLevelLink(e){var action_element=Event.element(e);if(action_element.tagName=='A'){action_element=action_element.up('div');}
action_element.addClassName('menu_1st_adiv_hover');action_element.down('a').addClassName('menu_1st_a_hover');}
function onMouseOutFirstLevelLink(e){var action_element=Event.element(e);if(action_element.tagName=='A'){action_element=action_element.up('div');}
action_element.removeClassName('menu_1st_adiv_hover');action_element.down('a').removeClassName('menu_1st_a_hover');}
function onMouseOverSecondLevelLink(e){var action_element=Event.element(e);if(action_element.tagName=='A'){action_element=action_element.up('div');}
var needed_submenu=action_element.next('div');if(needed_submenu){if(__glob.hide_third_menu_timeout&&!needed_submenu.hasClassName('hide')){window.clearTimeout(__glob.hide_third_menu_timeout);}
needed_submenu.removeClassName('hide');}}
function onMouseOutSecondLevelLink(e){var action_element=Event.element(e);if(action_element.tagName=='A'){action_element=action_element.up('div');}
var needed_submenu=action_element.next('div');if(needed_submenu){__glob.hide_third_menu_timeout=window.setTimeout(function(){needed_submenu.addClassName('hide');},100);}}
function onMouseOverThirdLevelMenu(e){if(__glob.hide_third_menu_timeout){window.clearTimeout(__glob.hide_third_menu_timeout);}}
function onMouseOutThirdLevelMenu(e){var action_element=Event.element(e);if(action_element.tagName=='A'){action_element=action_element.up('div');}
if(action_element.hasClassName('menu_3rd_div')){var needed_div=action_element;}else{var needed_div=action_element.up('div');}
if(needed_div){__glob.hide_third_menu_timeout=window.setTimeout(function(){needed_div.addClassName('hide');},100);}}
var __glob={};__glob.hide_third_menu_timeout=null;Event.observe(window,'load',function(){var main_menu=$('main_menu');if(main_menu){var first_level_links=main_menu.getElementsByClassName('menu_1st_adiv');for(var i=0;i<first_level_links.length;i++){Event.observe(first_level_links[i],'click',onClickFirstLevelLink);Event.observe(first_level_links[i],'mouseover',onMouseOverFirstLevelLink);Event.observe(first_level_links[i],'mouseout',onMouseOutFirstLevelLink);}
var second_level_links=main_menu.getElementsByClassName('menu_2nd_divlink');for(var i=0;i<second_level_links.length;i++){Event.observe(second_level_links[i],'mouseover',onMouseOverSecondLevelLink);Event.observe(second_level_links[i],'mouseout',onMouseOutSecondLevelLink);}
var third_level_menus=main_menu.getElementsByClassName('menu_3rd_div');for(var i=0;i<third_level_menus.length;i++){Event.observe(third_level_menus[i],'mouseout',onMouseOutThirdLevelMenu);Event.observe(third_level_menus[i],'mouseover',onMouseOverThirdLevelMenu);}}
var els=document.getElementsByClassName('a_hint');for(var i=0;i<els.length;i++){Event.observe(els[i],'click',showHintMessage);}
if($('description_tip')){Event.observe(document,'click',function(e){var activeElement=Event.element(e);if(!(activeElement.id&&activeElement.id=='description_tip')&&!activeElement.hasClassName('a_hint')){$('description_tip').setStyle({display:'none'});}});Event.observe('description_tip','mouseout',function(e){window.description_tip_timeout=window.setTimeout(function(){$('description_tip').setStyle({display:'none'});},2000);});Event.observe('description_tip','mouseover',function(e){window.clearTimeout(window.description_tip_timeout);});}
var highlight_areas=document.getElementsByClassName('highlight_area');for(var i=0;i<highlight_areas.length;i++){Event.observe(highlight_areas[i],'mouseover',function(){var highlight_elements=this.getElementsByClassName('highlight_element');for(var i=0;i<highlight_elements.length;i++){highlight_elements[i].style.borderBottomColor='#00AA00';highlight_elements[i].style.color='#00AA00';}});Event.observe(highlight_areas[i],'mouseout',function(){var highlight_elements=this.getElementsByClassName('highlight_element');for(var i=0;i<highlight_elements.length;i++){highlight_elements[i].style.borderBottomColor='#EEEEEE';highlight_elements[i].style.color='#EEEEEE';}});}});var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(input){var output="";var chr1,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;input=Base64._utf8_encode(input);while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;}
output=output+
this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+
this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);}
return output;},decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<input.length){enc1=this._keyStr.indexOf(input.charAt(i++));enc2=this._keyStr.indexOf(input.charAt(i++));enc3=this._keyStr.indexOf(input.charAt(i++));enc4=this._keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);}
if(enc4!=64){output=output+String.fromCharCode(chr3);}}
output=Base64._utf8_decode(output);return output;},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}
else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}
else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}
return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}
else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}
else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return string;}}