system_path="";var head=document.getElementsByTagName("head")[0];var scripts=head.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){if((scripts[i].src!=undefined)&&(scripts[i].src.search(new RegExp("core/penat_core.js","gi"))!=-1)){system_path=scripts[i].src.substring(0,scripts[i].src.search(new RegExp("core/penat_core.js","gi")))}}if(system_path.search(new RegExp("http://","gi"))!=-1){var t=system_path.substring(7,system_path.length);var domain2=t.substring(0,t.search(new RegExp("/","gi")));var domain3=t.substring(t.search(new RegExp("/","gi")),t.length);if(document.domain!=domain2){system_path="http://"+document.domain+domain3}}server="";DataSplitSymbol="<@>";FieldSplitSymbol="<¤>";RowSplitSymbol="<•>";var CurrentLng="ru";var type_server=0;Function.prototype.bind=function(object){var method=this;return function(){return method.apply(object,arguments)}};function change_server(t_server){switch(t_server){case 0:server="core/php/server.php";break;case 1:server="core/asp/server.asp";break}server=system_path+server;type_server=t_server}change_server(type_server);function addEventOnLoadDOM(f){var root=window.addEventListener||window.attachEvent?window:document.addEventListener?document:null;if(root){if(root.addEventListener){root.addEventListener("load",f,false)}else{if(root.attachEvent){root.attachEvent("onload",f)}}}else{if(typeof window.onload=="function"){var existing=window.onload;window.onload=function(){existing();f()}}else{window.onload=f}}}function load_library(name_src){var head=document.getElementsByTagName("head")[0];var loading=false;for(var i=0;i<head.childNodes.length;i++){if(head.childNodes[i].nodeName=="SCRIPT"){if(head.childNodes[i].attributes.getNamedItem("src")!=null){if(head.childNodes[i].attributes.getNamedItem("src").nodeValue==name_src){loading=true}}}}if(loading==false){var js=document.createElement("script");js.src=name_src;head.appendChild(js)}}function load_css(name_src){var head=document.getElementsByTagName("head")[0];var loading=false;for(var i=0;i<head.childNodes.length;i++){if(head.childNodes[i].nodeName=="LINK"){if(head.childNodes[i].attributes.getNamedItem("href")!=null){if(head.childNodes[i].attributes.getNamedItem("href").nodeValue==name_src){loading=true}}}}if(loading==false){var css=document.createElement("link");css.href=name_src;css.type="text/css";css.rel="stylesheet";head.appendChild(css)}}function createRequest(){var tmp_request=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
  try 
  {
    tmp_request = new ActiveXObject("Msxml2.XMLHTTP");
  } 
  catch (e) 
  {
    try 
    {
       tmp_request = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    catch (e2) 
    {
      tmp_request = false;
    }
  }
  @end @*/
if(!tmp_request&&typeof XMLHttpRequest!="undefined"){tmp_request=new XMLHttpRequest()}if(!tmp_request){alert("Error initializing XMLHttpRequest!")}return(tmp_request)}function load_object(path,object,lng){var Request=createRequest();var params="function=load_object";params+="&object="+object;params+="&lng="+lng;params+="&system_path="+path;params+="&random_nocache="+(new Date()).getTime();Request.open("POST",server,false);Request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");Request.send(params);if((Request.readyState==4)&&(Request.status==200)){var txt=Request.responseText}if(txt!="<error load object>"){var tmp_result=txt.split(DataSplitSymbol);var head=document.getElementsByTagName("head")[0];var js=document.createElement("script");js.type="text/javascript";js.text=tmp_result[2];head.appendChild(js);return(tmp_result[0]+DataSplitSymbol+tmp_result[1])}else{return(-1)}}function load_objects(path,objects,lng,callback){var Request=createRequest();var params="function=load_objects";params+="&objects="+objects.join(",");params+="&lng="+lng;params+="&system_path="+path;params+="&random_nocache="+(new Date()).getTime();function LoadCSSStyles(versions,styles){for(var i=0;i<objects.length;i++){var inex_obj=FindObject(objects[i]);if(versions[i]!=-1){LoadedObjects[inex_obj].version=versions[i];if(styles[i]==1){load_css(path+objects[i]+"/css/"+objects[i]+".css")}}}}var ProcessServerResult=function(){if((Request.readyState==4)&&(Request.status==200)){var txt=Request.responseText;if(txt!="<error load object>"){var tmp_result=txt.split(DataSplitSymbol);var head=document.getElementsByTagName("head")[0];var js=document.createElement("script");js.type="text/javascript";js.text=tmp_result[2];head.appendChild(js);LoadCSSStyles(tmp_result[0].split(","),tmp_result[1].split(","));if(callback!=null){callback()}return(tmp_result[0]+DataSplitSymbol+tmp_result[1])}else{return(-1)}}};if(typeof(callback)=="undefined"){Request.open("POST",server,false);Request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");Request.send(params);if((Request.readyState==4)&&(Request.status==200)){var txt=Request.responseText}if(txt!="<error load object>"){var tmp_result=txt.split(DataSplitSymbol);var head=document.getElementsByTagName("head")[0];var js=document.createElement("script");js.type="text/javascript";js.text=tmp_result[2];head.appendChild(js);LoadCSSStyles(tmp_result[0].split(","),tmp_result[1].split(","));return(tmp_result[0]+DataSplitSymbol+tmp_result[1])}else{return(-1)}}else{Request.open("POST",server,true);Request.onreadystatechange=ProcessServerResult.bind(this);Request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");Request.send(params)}}var LoadedObjects=new Array();function FindObject(name){for(var i=0;i<LoadedObjects.length;i++){if(LoadedObjects[i].name.toUpperCase()==name.toUpperCase()){return(i)}}return(-1)}function GetObject(name){var inex=FindObject(name);if(inex>-1){return LoadedObjects[FindObject(name)]}else{return(-1)}}function LoadPenatObjectAbsolute(path,object,lng,style_name){if(lng==undefined){var lng="ru"}if(lng==""){lng="ru"}CurrentLng=lng;if(FindObject(object)==-1){var tmp_obj=new Object();tmp_obj.name=object;tmp_obj.version=-1;tmp_obj.lng=lng;tmp_obj.path=path;LoadedObjects.push(tmp_obj);var result_load_obj=load_object(path,object,lng);if(result_load_obj!=-1){result_load_obj=result_load_obj.split(DataSplitSymbol);tmp_obj.version=result_load_obj[0];if((style_name!=undefined)&&(style_name!="")){load_css(path+object+"/css/"+style_name+".css")}else{if(result_load_obj[1]==1){load_css(path+object+"/css/"+object+".css")}}return(true)}else{return(false)}}}function LoadPenatObjectsAbsolute(path,objects,lng,callback){if(lng==undefined){var lng="eng"}if(lng==""){lng="eng"}CurrentLng=lng;var objects_for_loading=new Array();for(var j=0;j<objects.length;j++){if(FindObject(objects[j])==-1){objects_for_loading.push(objects[j])}}if(objects_for_loading.length>0){for(var i=0;i<objects_for_loading.length;i++){var tmp_obj=new Object();tmp_obj.name=objects_for_loading[i];tmp_obj.version=-1;tmp_obj.lng=lng;tmp_obj.path=path;LoadedObjects.push(tmp_obj)}function LoadCSSStyles(){for(var i=0;i<objects_for_loading.length;i++){var inex_obj=FindObject(objects_for_loading[i]);if(versions[i]!=-1){LoadedObjects[inex_obj].version=versions[i];if(styles[i]==1){load_css(path+objects_for_loading[i]+"/css/"+objects_for_loading[i]+".css")}}}}if(typeof(callback)=="undefined"){var tmp_result=load_objects(path,objects_for_loading,lng);tmp_result=tmp_result.split(DataSplitSymbol);var versions=tmp_result[0].split(",");var styles=tmp_result[1].split(",")}else{function callback_server(){}load_objects(path,objects_for_loading,lng,callback)}}}function LoadPenatObject(object,lng,style_name){LoadPenatObjectAbsolute(system_path+"objects/",object,lng,style_name)}function LoadPenatObjects(objects,lng,callback){LoadPenatObjectsAbsolute(system_path+"objects/",objects,lng,callback)}function reloadObjectStyle(object_name,styleName,new_styleName){var object=GetObject(object_name);if(object!=-1){var head=document.getElementsByTagName("head")[0];for(var i=0;i<head.childNodes.length;i++){if((head.childNodes[i].nodeName=="LINK")&&(head.childNodes[i].attributes.getNamedItem("type").nodeValue=="text/css")&&(head.childNodes[i].attributes.getNamedItem("rel").nodeValue=="stylesheet")&&(head.childNodes[i].attributes.getNamedItem("href").nodeValue==object.path+object.name+"/css/"+styleName+".css")){var css=document.createElement("link");css.href=object.path+object.name+"/css/"+new_styleName+".css";css.type="text/css";css.rel="alternate stylesheet";css.disabled=true;head.appendChild(css);head.childNodes[i].disabled=true;head.childNodes[i].rel="alternate stylesheet";css.rel="stylesheet";css.disabled=false}}}}function LoadObjectsList(){var Request=createRequest();var params="function=load_objects_list";params+="&system_path="+system_path+"/penat/objects";Request.open("POST",server,false);Request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");Request.send(params);if(Request.status==200){var txt=Request.responseText}return(txt.split(","))}function StyleSheetInsertRule(rule,index){if(rule.match(/^([^{]+)\{(.*)\}\s*$/)){this.addRule(RegExp.$1,RegExp.$2,index);return index}throw"Syntax error in CSS rule to be added"}function StyleSheetMakeCompatible(style){try{style.cssRules}catch(e){return style}if((typeof(style.cssRules)=="undefined")&&(typeof(style.rules)!="undefined")){style.cssRules=style.rules}if((typeof(style.insertRule)=="undefined")&&(typeof(style.addRule)!="undefined")){style.insertRule=StyleSheetInsertRule}if((typeof(style.deleteRule)=="undefined")&&(typeof(style.removeRule)!="undefined")){style.deleteRule=style.removeRule}if((typeof(style.cssRules)=="undefined")||(typeof(style.insertRule)=="undefined")||(typeof(style.deleteRule)=="undefined")){return null}else{return style}}function getStyleSheet(index){if(typeof(index)=="undefined"){index=0}if(index<0){index=document.styleSheets.length+index}if((typeof(document.styleSheets)=="undefined")||(index<0)||(index>=document.styleSheets.length)){return(null)}var style=document.styleSheets[index];return StyleSheetMakeCompatible(style)}function addStyleSheet(url){var style;if(typeof(url)=="undefined"){style=document.createElement("style")}else{style=document.createElement("link");style.rel="stylesheet";style.type="text/css";style.href=url}document.getElementsByTagName("head")[0].appendChild(style);style=document.styleSheets[document.styleSheets.length-1];return StyleSheetMakeCompatible(style)}function getStyleSheetByName(name){var StyleIndex=-1;var head=document.getElementsByTagName("head")[0];for(var i=0;i<head.childNodes.length;i++){if((head.childNodes[i].nodeName.search(new RegExp("link","ig"))!=-1)||(head.childNodes[i].nodeName.search(new RegExp("style","ig"))!=-1)){StyleIndex++;if((head.childNodes[i].attributes.getNamedItem("type").nodeValue.search(new RegExp("text/css","ig"))!=-1)&&(head.childNodes[i].attributes.getNamedItem("rel").nodeValue.search(new RegExp("stylesheet","ig"))!=-1)&&(head.childNodes[i].attributes.getNamedItem("href").nodeValue.search(new RegExp(name,"ig"))!=-1)){return(getStyleSheet(StyleIndex))}}}return(null)}function getStyleByName(name){for(var i=0;i<document.styleSheets.length;i++){for(var j=0;j<getStyleSheet(i).cssRules.length;j++){var StyleSheet=getStyleSheet(i);if(StyleSheet.cssRules[j].selectorText.search(new RegExp(name,"ig"))!=-1){return(StyleSheet.cssRules[j].style)}}}return(null)}load_css(system_path+"core/css/penat_core.css");