function menu_levels(root, parent_tag, item_tag, menu_item_class, here_class){
this.root = root;
this.root._openers = [];
this.parent_tag = parent_tag.toUpperCase();
this.item_tag = item_tag.toUpperCase();
this.menu_item_class = menu_item_class;
this.here_class = here_class ? here_class : "here";
this.here_items = [];
this.levels = [[this.root]];
this.root.level_index = 0;
this.root.item_index = 0;

this.recurssionLevel = 0;
this.each_level(this.root);
}
menu_levels.prototype.each_level = function(item, iterator){
item.level = this.recurssionLevel;
this.recurssionLevel ++;
item._active_items = [];
item._items = [];
var parent = $T(this.parent_tag, item)[0];
item.menu_elem = parent;
var children = $A(parent.childNodes);
var item_count = 0;
children.each(function(child){
if(child.nodeType == 3){
parent.removeChild(child);
throw $continue;
}
if(child.nodeName.toUpperCase() == this.item_tag){
child.number = item_count;
child.link = $T("A", child)[0];
child.parent_item = item;
child._width = child.link.offsetWidth;
child._height = child.offsetHeight;
if(child.className.indexOf(this.here_class) != -1){
this.here_items.push(child);
}
item._items.push(child);
item_count ++;
var kids = $A(child.childNodes);
kids.each(function(kid){
if(kid.nodeType == 1){
if(kid.className.indexOf(this.menu_item_class) != -1){
if(typeof this.levels[this.recurssionLevel] == 'undefined'){
this.levels.push([]);
}
this.levels[this.recurssionLevel].push(kid);
item._active_items.push(child);
child.menu_item = kid;
kid._opener = child;
kid._openers= [];
item._openers.each(function(op){
kid._openers.push(op);
});
kid.level_index = this.recurssionLevel;
kid.item_index = this.levels[this.recurssionLevel].length - 1;
//					kid._openers.concat(item._openers);
kid._openers.push(child);
kid.parent_level = item;
this.each_level(kid);
}
}
}.bind(this));
}
}.bind(this));
this.recurssionLevel --;
}
menu_levels.prototype.get_depth = function(){
return this.levels.length;
}
menu_levels.prototype.get_level = function(level){
if(level >= this.levels.length){
return false
}
return this.levels[level];
}
function Menu1(root, track, move_item, menu_root, parent_tag, item_tag, menu_item_class, timer){
this.root = root;
this.track = track;
this.move_item = move_item;
this.menu_root = menu_root;
this.paddingRightValue = 30;
this.paddingLeftValue = 20;
this.marginValue = 30;
this.speed = 15;
this.Levels = new menu_levels(menu_root, parent_tag, item_tag, menu_item_class);
this.temp_div = document.createElement("DIV");
this.distances = [];
this.back_button_style = Menu1.back_button_style;
this.next_button_style = Menu1.next_button_style;
this.track_min_width = -1;
this.min_width_initialized = false;
this.track_width = 0;
this.track_height = 0;
this.onafterinit = new DOMEvent();
this.onmenushow = new DOMEvent();
this._back_items = [];
this.Timer = timer ? timer : 50;
this.createMovement();
this.clearMoveItem();
this.iterator = function(){
print("hello");
}
}
Menu1.prototype.setBackButtonStyle = function(objStyle){
for(var i in objStyle){
this.back_button_style[i] = objStyle[i];
}
}
Menu1.prototype.setNextButtonStyle = function(objStyle){
for(var i in objStyle){
this.next_button_style[i] = objStyle[i];
}
}
Menu1.prototype.clearMoveItem = function(){
var children = $A(this.move_item.childNodes);
children.each(function(child){
if(child.nodeType == 3){
child.parentNode.removeChild(child);
}
})
}
Menu1.prototype.init = function(){
this.setStyle();
this.initLevels();
this.setTrack();
this.setVisibility();
this.onafterinit.fire();
}
Menu1.prototype.setStyle = function(){
Style.setElementStyle(this.track, Menu1.track_style, null, true);
Style.setElementStyle(this.move_item, Menu1.move_item_style, null, true);
}
Menu1.prototype.initActiveItems = function(item, index){
item._active_items.each(function(_opener){
var btn = Menu1.createNextButton(_opener, this.paddingRightValue);
btn.level = index;
}.bind(this))
}
Menu1.prototype.appendLevels = function(item, index){
if(index == 0){
return;
}
this.move_item.appendChild(item);
item.style.position = "absolute";
}
Menu1.prototype.getItemWidth = function(item){
item._width = Menu1.get_width(item, this.Levels.item_tag) + this.paddingRightValue;	
item._height = item.offsetHeight;
}
Menu1.prototype.positionItem = function(item, index){
if(index == 0)		
return;
var my_left = item.parent_level._width + (item.parent_level._left ? item.parent_level._left : 0);
item.style.left = my_left + "px";
item.style.top = "0";
item._left = my_left;
}
Menu1.prototype.initBackItems = function(item, index){
if(index == 0){
return;
}
Menu1.createBackItems(item, this);
}
Menu1.prototype.initNextButton = function(item){
item._active_items.each(function(_act_itm){
_act_itm.next_button.onclick = function(itm, act_item, btn){
this.previous_width = this.track_width;
this.previous_height = this.track_height;
this.track_height = act_item.menu_item._height;
var left;
if(this.track_min_width > -1){
this.min_width_initialized = true;
this.track_width = (act_item.menu_item._width > this.track_min_width) ? act_item.menu_item._width : this.track_min_width;
left = act_item.menu_item._left;
var cur_left = itm._left ? itm._left : 0;
if(left - cur_left < this.track_min_width){
left = cur_left + this.track_min_width;
act_item.menu_item._left = left;
act_item.menu_item.style.left = left + "px";
}
}else{
this.track_width = act_item.menu_item._width;
left = act_item.menu_item._left;
}
this.move_item.appendChild(act_item.menu_item);
this.Mov.moveTo(-left, 0, this.speed);
}.bindAvoidingEvent(this, item, _act_itm, _act_itm.next_button);
}.bind(this));
}
Menu1.prototype.initBackButton = function(item, index){
if(index == 0){
return;
}
item.back_items.each(function(itm){
itm.back_button.onclick = function(btn, cur_level){
this.previous_width = this.track_width;
this.previous_height = this.track_height;
var left = btn.target._left ? btn.target._left : 0;
this.track_height = btn.target._height;
if(this.track_min_width > -1){
this.track_width = (btn.target._width > this.track_min_width) ? btn.target._width : this.track_min_width;
}else{
this.track_width = btn.target._width;
}
this.Mov.onstop.register("stop", function(bt){
this.Levels.levels.each(function(lev, ind){
if(ind <= bt.level){
throw $continue;
}
lev.each(function(lev_item){
this.temp_div.appendChild(lev_item);
}.bind(this));
}.bind(this));
}.bind(this, btn), 1);
this.Mov.moveTo(-left, 0, this.speed);
}.bindAvoidingEvent(this, itm.back_button, item);
}.bind(this))
}
Menu1.prototype.initLevels = function(){
this.Levels.levels.each(function(level, index){
level.each(function(item){
this.initActiveItems(item, index);
this.initBackItems(item, index);
this.appendLevels(item, index);
}.bind(this))
}.bind(this));
this.Levels.levels.each(function(level, index){
level.each(function(item){
this.getItemWidth(item);
this.positionItem(item, index);
this.initNextButton(item);
this.initBackButton(item, index);
}.bind(this))
}.bind(this));
}
Menu1.prototype.createMovement = function(){
this.Mov = new Movement(this.move_item, this.Timer);
this.onmovestop = DOMEvent.cloneEvent(this.Mov.onstop);
}
Menu1.prototype.setTrack = function(){
this.track_width = this.menu_root._width > this.track_min_width ? this.menu_root._width : this.track_min_width;
this.track.style.width = this.track_width + "px";
this.track_height = this.menu_root._height;
this.track.style.height = this.track_height + 40 + "px";
}
Menu1.prototype.setVisibility = function(){
this.Levels.levels.each(function(lev, ind){
if(ind == 0){
throw $continue;
}
lev.each(function(lev_item){
this.temp_div.appendChild(lev_item);
}.bind(this))
}.bind(this));
}
Menu1.prototype.showLevelItem = function(level_index, item_index){
var level = this.Levels.levels[level_index];
var item = level[item_index];
var left = item._left ? item._left : 0;
var width;
if(this.track_min_width > -1){
width = (item._width > this.track_min_width) ? item._width : this.track_min_width;
}else{
width = item._width;
}
this.track_width = width;
this.track_height = item._height;
this.track.style.width = width + "px";
this.track.style.height = item._height + "px";
this.move_item.style.left = -left + "px";
this.Mov.Moveable.left = - left;
this.Levels.levels.each(function(level, index){
if(index != level_index){
level.each(function(itm, ind){
this.temp_div.appendChild(itm);
}.bind(this));
}else{
level.each(function(item, ind){
if(ind == item_index){
this.move_item.appendChild(item);
item._openers.each(function(op){
this.move_item.appendChild(op.parent_item);
}.bind(this))
}else{
if(item.parentNode == this.move_item){
this.temp_div.appendChild(item);
}
}
}.bind(this))	
}
}.bind(this));
this.onmenushow.fire();
return item;
}
Menu1.prototype.get_item = function(level_index, item_index, number){
return this.Levels.levels[level_index][item_index]._items[number];
}
Menu1.prototype._each_level = function(){
var _args = $A(arguments);
this.Levels.levels.each(function(level, index){
level.each(function(item){
_args.each(function(arg){
arg(item, index);
}.bind(this))
}.bind(this))
}.bind(this))
}
Menu1.createNextButton = function(item, padVal){
var button = document.createElement('DIV');
button.className = Menu1.NEXT_BUTTON_CLASSNAME;
Style.setElementStyle(button, Menu1.next_button_style, null, true);
item.next_button = button;
item.appendChild(button);
item.style.position = "relative";
item.style.paddingRight = padVal + 'px';
item.onmouseover = function(){
this.next_button.style.display = 'block';
}
item.onmouseout = function(){
this.next_button.style.display = 'none';
}
button.style.left = item.link.offsetWidth + 6 + "px";
return button;
}
Menu1.createBackItems = function(item, oThis){
item.back_items = [];
item._openers.each(function(op, index){
var back_item = Menu1.createBackItem(item, op);
back_item.style.position = "relative";
back_item.style.marginLeft = oThis.marginValue * index + "px";
//print(this, console);
back_item.style.paddingLeft = oThis.paddingLeftValue + "px";
back_item.back_button.level = index;
back_item.back_button.target = op.parent_item;
item.back_items.push(back_item);
oThis._back_items.push(back_item);
});
item.menu_elem.style.paddingLeft = oThis.marginValue * item._openers.length + Math.round(oThis.back_button_style.width / 2) + "px";
}
Menu1.createBackItem = function(item, op){
var div = document.createElement('DIV');
div.className = Menu1.BACK_ITEM_CLASSNAME;
var button = Menu1.createBackButton();
div.appendChild(button);
var lnk = $T('A', op)[0].cloneNode(true);
div.appendChild(lnk);
div.back_button = button;
div.opener = op;
div.link = lnk;
item.insertBefore(div, item.menu_elem);
return div;
}
Menu1.createBackButton = function(){
var btn = document.createElement('DIV');
btn.className = Menu1.BACK_BUTTON_CLASSNAME;
Style.setElementStyle(btn, Menu1.back_button_style, null, true);
return btn;
}
Menu1.get_width = function(item, tag){
var children = $A(item.menu_elem.childNodes);
var max_width = 0;
children.each(function(child){
if(child.nodeName.toUpperCase() == tag){
var lnk = $T('A', child)[0];
if(lnk.offsetWidth > max_width){
max_width = lnk.offsetWidth;
}
}
});
var i_pos = Style.getElementStyle(item, 'position');
if(i_pos == 'absolute'){
max_width = item.offsetWidth;
}
return max_width;
}
Menu1.track_style = {
position: 'relative',
overflow: 'hidden',
height: '300'
}
Menu1.move_item_style = {
position: 'absolute'
}
Menu1.next_button_style = {
/*	width: 15, 
height: 15,
position: 'absolute',
top: 0,
background: 'url(arrow.gif) no-repeat',
display: 'none'*/
}
Menu1.back_button_style = {
/*	width: 15, 
height: 15,
position: 'absolute',
top: 0,
background: 'url(arrow2.gif) no-repeat'*/
}
Menu1.NEXT_BUTTON_CLASSNAME = "button-next";
Menu1.BACK_BUTTON_CLASSNAME = "button-back";
Menu1.BACK_ITEM_CLASSNAME = "back-item";

Menu1.prototype.toString = function(){
var str = "object Menu1\n";
return str;
}

function resizeable(elem){
this.elem = elem;
this.onresize = new DOMEvent();
this.onafterresize = new DOMEvent();
this.onzerowidth = new DOMEvent();
this.onzeroheight = new DOMEvent();
this.errX = 0;
this.errY = 0;
this.resizedX = 0;
this.resizedY = 0;
this.resX = 0;
this.resY = 0;
this.errHeight = 0;
this.init();
}
resizeable.prototype.init = function(){
this.width = parseInt(Style.getElementStyle(this.elem, 'width'));
this.height = parseInt(Style.getElementStyle(this.elem, 'height'));
if(isNaN(this.width)){
this.width = this.elem.offsetWidth;
}
if(isNaN(this.height)){
this.height = this.elem.offsetHeight;
}
}
resizeable.prototype.resize = function(){
if(this.width < 0){
this.width = 0;
this.onzerowidth.fire();
}
if(this.height < 0){
this.height = 0;
this.onzeroheight.fire();
}
this.elem.style.width = this.width + "px";
this.elem.style.height = this.height + "px";
this.onafterresize.fire();
}
resizeable.prototype.resizeTo = function(w, h){
var wVal = w - this.width;
var hVal = h - this.height;
this.resizeBy(wVal, hVal);
}
resizeable.prototype.resizeBy = function(w, h){
this.resX = Math.floor(Math.abs(w)) * w.signOf();
this.resY = Math.floor(Math.abs(h)) * h.signOf();
this.errX += (Math.abs(w) - Math.floor(Math.abs(w))) * w.signOf();

this.errY += (Math.abs(h) - Math.floor(Math.abs(h))) * h.signOf();
if(Math.abs(this.errX) >= 1){
this.resX += w.signOf();
this.errX -= w.signOf();
}
if(Math.abs(this.errY) >= 1){
this.resY += h.signOf();
this.errY -= h.signOf();
}
this.width += this.resX;
this.height += this.resY;

this.onresize.fire();
this.resize();
}
function Grow(elem, timer){
this.elem = elem;
if(typeof timer == "number"){
this.hasOwnTimer = true;
this.Timer = new Timer(timer)

}else if(typeof timer == "object" && timer instanceof Timer){
this.hasOwnTimer = false;
this.Timer = timer;
}else{
this.Timer = new Timer(100);
this.hasOwnTimer = true;
}
this.resizeable = new resizeable(this.elem)
this.interval = null;
this.grownX = 0;
this.grownY = 0;
this.steps = 10;
this.stepX = 0;
this.stepY = 0;
this.desctinationX = 0;
this.desctinationY = 0;
this.ongrown = new DOMEvent();
this.ongrow = new DOMEvent();
this.ongrown.register('correction', function(){
if(this.resizeable.height != this.destinationY){
this.resizeable.height = this.destinationY;
}
if(this.resizeable.width != this.destinationX){
this.resizeable.width = this.destinationX;
}
this.resizeable.resize();
}.bind(this));
this.isGrowing = false;
this._init();

}
Grow.prototype._init = function(){
if(this.hasOwnTimer){
this.Timer.registerEvent({
name: "Grow",
func: this.growFunc,
oThis: this,
args: []
});
}else{
if(this.Timer.GROW_INITIALIZED){
this.Timer.registerGrow(this)
}else{
Grow.handleMutualTimer(this.Timer);
this.Timer.registerGrow(this)
}
}
}
Grow.prototype.grow = function(x, y){
this.stepX = x / this.steps;
this.stepY = y / this.steps;
this.destinationX = this.resizeable.width + x;
this.destinationY = this.resizeable.height + y;
this.count = 0;
this.interval = setInterval(this.growFunc.bind(this), 30);
this.isGrowing = true;
}
Grow.prototype.growFunc = function(){
this.resizeable.resizeBy(this.stepX, this.stepY);
this.count ++ ;
this.ongrow.fire();
if(this.count == this.steps){
this.resizeable.resizeTo(this.destinationX, this.destinationY);
clearInterval(this.interval);
this.isGrowing = false;
this.ongrown.fire();
}
}
Grow.handleMutualTimer = function(oTimer){
oTimer.grows = [];
oTimer.registerGrow = function(oGrow){
this.grows.push(oGrow);
}
oTimer.registerEvent({
name: "Grow",
func: function(){
this.grows.each(function(grow){
if(grow.isGrowing){
grow.growFunc();
}
})
},
oThis: oTimer,
args: []
})
oTimer.GROW_INITIALIZED = true;
}
function SetHistoryCookie( historyStr ) {

document.cookie = 'history='+escape(historyStr)+'; path=/';

}

function GetHistoryCookie( ) {
var hCookie = document.cookie.split('; ');

var fl=false;
for( var z=0; z<hCookie.length; z++ ) {
var t = hCookie[z].split('=');
if( t[0] == 'history' ){
fl=true;
break;
}
}

var historyStr = unescape( hCookie[z] );	
return historyStr;
}

var load = {
includedFiles : new Array( ),
thisObject : this,
request : null
};

load.getXMLHttpObject= function( ) {

var result = false;
var i;
var XMLHttpObjects = [
function( ) { return new XMLHttpRequest( ) },
function( ) { return new ActiveXObject( 'Msxml2.XMLHTTP' ) },
function( ) { return new ActiveXObject( 'Microsoft.XMLHTTP' ) }
];

for( i=0; i<XMLHttpObjects.length; i++ ) {
try{
result = XMLHttpObjects[i]( );
break;
} catch ( e ) { }
}

return result;

}

load.include = function( urlFile, callBackFunctionStart, callBackFunctionEnd ) {
callBackFunctionStart( );

if ( this.includedFiles[urlFile] ) {
callBackFunctionEnd( this.includedFiles[urlFile] );
}
else {

var context = this;

var TempFunction = function( ) {

if ( context.request.readyState == 4 ) {
if ( context.request.status == 200 ) {
context.includedFiles[urlFile] = context.request.responseText;
callBackFunctionEnd( context.includedFiles[urlFile] );
return true;
}
if ( context.request.status == 404 ) {
context.includedFiles[urlFile] = false;
callBackFunctionEnd( context.includedFiles[urlFile] );
return true;
}
}
}

this.load( urlFile, TempFunction );

}
}

load.load = function( urlFile, callBackFunction ) {

this.request = this.getXMLHttpObject( );

this.request.onreadystatechange = callBackFunction;

subURL = '';

reg = /ajax/g;
regQuestion = /\?/g;

if ( !urlFile.match( reg ) ) {
if ( urlFile.match( regQuestion ) ) {
subURL = '&ajax=1';
}
else {
subURL = '?ajax=1';
}
}

this.request.open( 'GET', urlFile+subURL, true );
this.request.send( null );
return false;

}

function ajaxRequest(link, params, method, elem)
{
var XMLHttpObjects = [
function( ) { return new XMLHttpRequest( ) },
function( ) { return new ActiveXObject( 'Msxml2.XMLHTTP' ) },
function( ) { return new ActiveXObject( 'Microsoft.XMLHTTP' ) }
];

for( i=0; i<XMLHttpObjects.length; i++ ) {
try{
var ajaxObj = XMLHttpObjects[i]( );
break;
} catch ( e ) { }
}

if (!ajaxObj) return;

if (elem) sync = true; else sync = false;

ajaxObj.onreadystatechange = function()
{
if (ajaxObj.readyState == 4){
if (ajaxObj.status == 200){
try
{
var d = $(elem);
d.innerHTML = ajaxObj.responseText;
}
catch (e){}
}
}
}

if (method != 'post' && method != 'get') method = 'get';

query = null;

ajaxObj.open(method, link, sync);
if (method == 'post')
{
ajaxObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
query = params;
}

ajaxObj.send(query);

if (!sync)
{
if (ajaxObj.readyState == 4){
if (ajaxObj.status == 200){
try
{
return ajaxObj.responseText;
}
catch (e){}
}
}
}
}

function createIframe(frameId, secureUri)
{
if(window.ActiveXObject){
var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');

if(typeof secureUri == 'boolean'){
io.src = 'javascript:false';
}
else if(typeof secureURI == 'string'){
io.src = secureUri;
}
}
else{
var io = document.createElement('iframe');
io.id = frameId;
io.name = frameId;
}

io.style.position = 'absolute';
io.style.top = '-1000px';
io.style.left = '-1000px';

document.body.appendChild(io);

return io;
}

function uploadFilesFunc()
{

}

var BackButton = {}
BackButton.isIE = !window.getComputedStyle;
BackButton.frame_src = "iframe.html";
BackButton.Event = {
name: 'AnchorChange',
previousLocation: document.location.href,
getAnchor: function(locationString){
var anch = '';
var locationSplitted = locationString.split("#");
if(locationSplitted.length > 1){
anch = locationSplitted[1];
}
return anch;						
},
func: function(){
var previousAnchor = this.getAnchor(this.previousLocation);
var currentAnchor = this.getAnchor(document.location.href);
this.previousLocation = document.location.href;
if(previousAnchor == currentAnchor){
return false;
}else{
return currentAnchor;
}
},
args: []
}
BackButton.Event.oThis = BackButton.Event;
BackButton.Listener = {
name: "AnchorChange",
func: function(val){	
if(this.usingHistory){
this.onhistorychange.fire(val);
}else{
this.usingHistory = true;
}
},
oThis: BackButton
}
BackButton.createFrame = function(){
this.iframe = document.createElement("IFRAME");
this.iframe.src = BackButton.frame_src + "?main";
this.iframe.width = 0;
this.iframe.height = 0;
document.body.appendChild(this.iframe);
}
BackButton.create = function(oTimer, t_frequency){
if(this.isIE){
this.createFrame();
}
this.timer = !oTimer ? new Timer(100) : oTimer instanceof Timer ? oTimer : new Timer(oTimer);
this.Event.freq = t_frequency || 1;
this.timer.registerEvent(this.Event)
this.timer.registerEventListener(this.Listener)
}
BackButton.usingHistory = true;
BackButton.onhistorychange = new DOMEvent();
if(window.opera){
document.addEventListener("mousemove", function __move(){return true}, false);
document.addEventListener("keyup", function __up(){return true}, false);
}
BackButton.Go = function(href){
if(this.isIE){
this.iframe.src = this.frame_src + "?" + href;
return false;
}else{
location.hash = "#" + href;
return false;
}
}

var historyArray = [];
historyArray.startCalled = false;
historyArray._find = function(link_href){
var object = null;
this.each(function(obj){
if(obj && obj.href.indexOf(link_href) != -1){
object = obj;
throw $break;
}
});
return object;
}
historyArray._insert = function(link){
if(!this._find(link.href)){
this.push({link: link, href: link.href, func: link.onclick, toString: function(){return this.href}});
}
}


Function.prototype.ajaxbind = function( object ) {

var method = this;

return function ( ) {
return method.apply( object, arguments );
}

}

AttachEvent = function( objectTarget, eventType, funcionHandler ) {

if ( objectTarget.addEventListener ) { 
objectTarget.addEventListener( eventType, funcionHandler, false );
}
else if ( objectTarget.attachEvent ) { 
objectTarget.attachEvent('on' + eventType, funcionHandler );
}
else { 
objectTarget['on' + eventType] = funcionHandler;
}

}

DetachEvent = function( objectTarget, eventType, funcionHandler ) {

if ( objectTarget.addEventListener ) { //for DOM-compliant browsers
objectTarget.removeEventListener( eventType, funcionHandler, false );
}
else if ( objectTarget.attachEvent ) { //for IE
objectTarget.detachEvent('on' + eventType, funcionHandler );
}
else { 
objectTarget['on' + eventType] = '';
}

}
IsGecko = function ( ) {

return !document.attachEvent && document.addEventListener;

}

CancelEventBubble = function ( event ) {

if ( !IsGecko( ) ) {
window.event.cancelBubble = true;
window.event.returnValue = false;
}
else {
event.preventDefault( );
}

}
var global_domain = URLroot;
function AjaxLoader( objectInnerContent, domain ) {

this.blockerDivName = 'ajaxBackgroud';
var objectInnerContent = objectInnerContent;
var domain = domain;
var txtTitle = document.getElementById('main-header');
var linksHref = new Array();

this.MakeLinks = function ( objectReplaceLinks ) {

var allLinks = $T("A", objectReplaceLinks);
allLinks.each(function(link){
if ( link.href != domain && link.href.match( domain ) && !link.href.match( '#' ) && !link.href.match("download_files")) {

var context = this;
if(link.href.indexOf(global_here) != -1 && link.href.match(/\.html$/)){
link.onclick = function(){
BackButton.usingHistory = false;
menu_load(this);
return false;
}
}else{
if(link.href.match(/\.html$/)){
var menu_href = link.href.substr(0, link.href.lastIndexOf("\/") + 1);
var menu_link = find_link(menu_href);
link.Proto = menu_link.onclick;
link.onclick = function(){
menu_rebuild(this.Proto.bound[0], this.Proto.bound[1]);
BackButton.usingHistory = false;
menu_load(this);
return false;
}
}else{
var menu_link = find_link(link.href);
if(menu_link){
link.onclick = menu_link.onclick;
}else{
}
}
}

}
else {
throw $continue;				
}		
});
init_num_inputs(objectReplaceLinks, "numInput");

}

this.AjaxClick = function ( link ) {

var linkLoad = link.href;

var href = linkLoad.split( domain );
historyPage.GoTo( href[1] );
return false;

}

this.LoadPage = function ( linkLoad ) {
linkLoad = linkLoad.replace(global_domain, "");
if ( linkLoad == 'main' ) {
objectInnerContent.innerHTML = '';
return false;
}
var context = this;

var callBackFunctionStart = function ( ) {
}

var callBackFunctionEnd = function ( htmlCode ) {
if ( htmlCode ) {
var scripts = findScripts(htmlCode);
htmlCode += "<div class=\"clr\">&nbsp;</div>";
objectInnerContent.innerHTML = htmlCode;
this.ChangeTxtTitle();
this.ChangeHtmlTitle();
context.MakeLinks ( objectInnerContent );
scripts.each(function(s){
try{
var scr = document.createElement("SCRIPT");
scr.type = "text\/javascript";
var src_match = s.match(/src=\".*\"/);
scr.src = src_match.toString().replace("src=\"", "").replace(/\"$/, "");
objectInnerContent.appendChild(scr);
}catch(e){
}
})
ShowHeader();
Zebra();
}
else {
alert('Запрашиваемая страница не найдена');
ShowHeader();

}
//context.DisplayBlockerDiv( 'none' );
}.bind(this)

load.include( domain+linkLoad, callBackFunctionStart, callBackFunctionEnd );
return false;

}


this.DisplayBlockerDiv = function ( display ) {

var blockerDivObj = document.getElementById( this.blockerDivName );

blockerDivObj.style.display = display;

return true;

}


this.ChangeTxtTitle = function ( ) {

var newTxtTitle = document.getElementById('main-header-content');
txtTitle.innerHTML = newTxtTitle.innerHTML;
newTxtTitle.parentNode.removeChild(newTxtTitle);

}

this.ChangeHtmlTitle = function ( ) {

var newHtmlTitle = $('html_title');
document.title = newHtmlTitle.innerHTML;
newHtmlTitle.parentNode.removeChild(newHtmlTitle);

}

}
function findScripts(str){
var arr_scripts = [];
var temp_div = document.createElement("DIV");
while(str.indexOf("<script") != -1){
var start = str.indexOf("<script");
var end = str.indexOf("</script>") + 9;
var _substr = str.substring(start, end);
arr_scripts.push(_substr);
str = str.replace(_substr, "");
}
return arr_scripts;
}
function Random( val ) {
var rand = Math.round(Math.random() * val - val / 2);
return rand != 0 ? rand : Random(val);
}

function ChangeTxtTitle( ) {

var txtTitle = $('main-header');	
txtTitle.style.visibility = 'visible';

}


function Zebra( ) {

var even = false;
var row = 0;
var tables = $C('tbl', document.body, "TABLE");
if(!tables){
return false;
}

tables.each( function(table) {
var trs = $T("TR", table);
trs.each( function(tr) {
var tds = $T("TD", tr);
var frow = tds[0];
tds.each( function(td) {
var regexp = new RegExp("\\d+");
var resultArray = frow.innerHTML.match(regexp);
if ( resultArray ) {
isNumber = "true";
} else {
isNumber = "false";
}
if ( isNumber == 'true' && row != 0 ) {
td.className += ' tBrd'; 
}
td.className += even ? ' greyTblTd' : '';
})
even = !even;
row++;
})
})

}

function ShowHeader ( ) {
main_header.style.visibility = "visible";
main_zaglushka.style.display = "none";
}

function JQuery ( objLink ) {

historyArray._insert(objLink);
if(!historyArray.startCalled){
ret = BackButton.Go( objLink.href.replace(URLroot, "") );
}
objAjax.LoadPage( objLink.href );
}

function SubmitForm( link_converter ) {

var res = function ( text ) {

if ( text ) {
document.getElementById( 'resultBlock' ).style.visibility = 'visible';
document.getElementById( 'resultSum' ).innerHTML = text;
}
else {
document.getElementById( 'resultBlock' ).style.visibility = 'hidden';
}
}

var nullFunc = function (  ) { }

var convertFrom = document.getElementById( 'convertFrom' ).value;
var convertTo = document.getElementById( 'convertTo' ).value;
var convertSum = document.getElementById( 'convertSum' ).value;

if (!convertSum) return;

load.include( link_converter + '?action=convert&convertFrom=' + convertFrom + '&convertTo=' + convertTo + '&convertSum=' + convertSum + '&convertSubmit=1', nullFunc, res );

}

function SubmitForm2( link_converter ) {

var res = function ( text ) {

if ( text ) {
document.getElementById( 'resultBlock' ).style.visibility = 'visible';
document.getElementById( 'resultSum' ).innerHTML = text;
}
else {
document.getElementById( 'resultBlock' ).style.visibility = 'hidden';
}
}

var nullFunc = function (  ) { }

var convertFrom = document.getElementById( 'convertFrom' ).value;
var convertTo = document.getElementById( 'convertTo' ).value;
var convertSum = document.getElementById( 'convertSum' ).value;

if (!convertSum) return;

load.include( link_converter + '?action=convert&convertFrom=' + convertFrom + '&convertTo=' + convertTo + '&convertSum=' + convertSum + '&convertSubmit=1', nullFunc, res );

}

function SubmitFAQForm( form ) {

inputArray = new Array();
inputArray = form.elements;

inputValue = new Array();

for(var i=0; i<inputArray.length;i++) {
if (((inputArray[i].type != 'checkbox') && (inputArray[i].type != 'radio')) || (inputArray[i].checked)) {
inputValue.push(encodeURIComponent(inputArray[i].name)+'='+encodeURIComponent(inputArray[i].value));
}
}

var query = inputValue.join("&");

ajaxRequest(form.action, query, form.method, 'faqQuestionForm');

return false;

}

