function GetWidth() {
	if (self.innerWidth) {
		return self.innerWidth;
	} else
	if (document.documentElement && document.documentElement.clientHeight) {
		return document.documentElement.clientWidth;
	} else
	if (document.body) {
		return document.body.clientWidth;
	}
}

function ShowHide(id){
if (id != '') {
	var itm = null;
	var pitm= null;
	if (document.getElementById) { 
  		itm = document.getElementById(id); 
	} else if (document.all) { 
		itm = document.all[id]; 
	} else if (document.layers) { 
		itm = document.layers[id]; 
	}
   	if (!itm) { /* do nothing */ 
	} else if (itm.style) {
   		if (itm.style.display == "none") { 
			itm.style.display = "block"; 
		} else { 
			itm.style.display = "none";
		}
    } else { itm.visibility = "show"; }
 }
}
function blockdiv (this_) {
	document.getElementById(this_).style.display = 'block';
}
function nonediv (this_) {
	document.getElementById(this_).style.display = 'none';
}
function ShowHideM(id){
	if (document.getElementById('dropmenu'+id).style.display == 'none') {
		for(var i=0; i<menu_al.length; i++) {
			nonediv('dropmenu'+menu_al[i]);
		}
	}
	blockdiv('dropmenu'+id);
	HideTop();
}
function ShowHideMB(id){
	if (document.getElementById('dropmenub'+id).style.display == 'none') {
		for(var i=0; i<menu_al.length; i++) {
			nonediv('dropmenub'+menu_al[i]);
		}
	}
	blockdiv('dropmenub'+id);
	HideTop();
}
function ShowHideTM(id){
	if (document.getElementById('topdropmenu'+id).style.display == 'none') {
		for(var i=0; i<menu_al_top.length; i++) {
			nonediv('topdropmenu'+menu_al_top[i]);
		}
	}
	blockdiv('topdropmenu'+id);
	ShowHideHH();
}
function ShowHideTMS(id, this_){
	if (document.getElementById('topdropmenu'+id).style.display == 'none') {
		for(var i=0; i<menu_al_top_sub.length; i++) {
			//nonediv('menu'+menu_al[i]);
			nonediv('topdropmenu'+menu_al_top_sub[i]);
		}
	}
	activedivsub(this_);
	blockdiv('topdropmenu'+id);
}

function ShowHideLM(id){
	for(var i=0; i<menu_left.length; i++) {
		blockdiv('leftmenu'+menu_left[i]);
		nonediv('leftsubmenu'+menu_left[i]);
	}
	nonediv('leftmenu'+id);
	blockdiv('leftsubmenu'+id);
}

function ShowHideHH(){
	for(var i=0; i<menu_al.length; i++) {
		if (document.getElementById('dropmenu'+menu_al[i]) != null ) {
			if (document.getElementById('dropmenu'+menu_al[i]).style.display == 'block') {
				nonediv('dropmenu'+menu_al[i]);
			}
		}
	}
	ShowHideHHB();
}
function ShowHideHHB(){
	for(var i=0; i<menu_al.length; i++) {
		if (document.getElementById('dropmenub'+menu_al[i]) != null) {
			if (document.getElementById('dropmenub'+menu_al[i]).style.display == 'block') {
				nonediv('dropmenub'+menu_al[i]);
			}
		}
	}
}
function ShowHideH(i){
}

function HideTop() {
	for(var i=0; i<menu_al_top.length; i++) {
		nonediv('topdropmenu'+menu_al_top[i]);
	}
}
function ShowHideHB(i){
}
function ShowHideTH(i){
}

function ShowHideLH(){
	for(var i=0; i<menu_left.length; i++) {
		blockdiv('leftmenu'+menu_left[i]);
		nonediv('leftsubmenu'+menu_left[i]);
	}
}

function activediv (this_) {
	if (this_.style.background.indexOf('dropmenuactivsub.png') == -1) {
		this_.style.background = 'url(images/dropmenuactiv.png) repeat-y';
		if (this_.style.color == "#32ccff") {
			this_.style.color = "#32ccff";
		} else {
			this_.style.color = "#33ccff";
		}
	}
}

function activedivsub (this_) {
	for(var i=0; i<menu_al_top_sub.length; i++) {
		bi('subb'+menu_al_top_sub[i]).style.background = 'url(images/dropmenudeactiv.png) repeat-y';
	}	
	this_.style.background = 'url(image/dropmenuactivsub.png) repeat-y';
	if (this_.style.color == "#32ccff") {
		this_.style.color = "#32ccff";
	} else {
		this_.style.color = "#33ccff";
	}
}

function deactivdiv (this_) {
//	alert(this_.style.background.indexOf('dropmenuactivsub.png'));
	if (this_.style.background.indexOf('dropmenuactivsub.png') == -1) {
		this_.style.background = 'url(images/dropmenudeactiv.png) repeat-y';
		if (this_.style.color == "#32ccff") {
			this_.style.color = "#32ccff";
		} else {
			this_.style.color = "#2a86cc";
		}
	}
/*	this_.style.color = "#2a86cc"; */
}
function activediv1 (this_) {
	this_.style.background = 'url(images/dropmenuactiv1.png) repeat-y';
	this_.style.color = "#33ccff";
	this_.style.width = "255px";
}
function deactivdiv1 (this_) {
	this_.style.background = 'url(images/dropmenudeactiv1.png) repeat-y';
	this_.style.color = "#2a86cc";
	this_.style.width = "255px";
}

function onfocusbody() {
	nonediv('dropfil');
	ShowHideH();
}
function setnulltext(this_, mess, typ) {
	if (typ == 0) {
		if (this_.value == mess) {this_.value = ""};
	} else {
		if (this_.value == "") {this_.value = mess};
	}
}
function transparent(im) {
   if (!im.transparented && (/\.png/.test(im.src))) {
      im.transparented = 1;
      var picture = im.src; var w = im.width; var h = im.height;
      im.src = "./images/no.gif";
      im.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod='scale', src='"+picture+"');";
    //  im.width = w; im.height = h;
   }
   return "transparent";
}

function bi (el) {
	return document.getElementById(el);
}

function Resize() {
    bi('ajaxcontent').style.left = Math.round((GetWidth()-371)/2);
    bi('journalcontent').style.left = Math.round((GetWidth()-690)/2);
    bi('informcontent').style.left = Math.round((GetWidth()-500)/2);
}

function FeedBackFf() {
	var name = bi('name').value;
	var message = bi('message').value;
	var email = bi('email').value;
	var lang = bi('lang').value;
	message = message.replace(/\n/, "<br>");
	var _error_ = 0;

	if (name == '') 		{bi('name').style.backgroundColor = '#FFAAAA'; 			_error_ = 1;} else {bi('name').style.backgroundColor = '#FFFFFF';}
	if (message == '') 		{bi('message').style.backgroundColor = '#FFAAAA'; 		_error_ = 1;} else {bi('message').style.backgroundColor = '#FFFFFF';}
	if (email == '')	 	{bi('email').style.backgroundColor = '#FFAAAA';			_error_ = 1;} else {bi('email').style.backgroundColor = '#FFFFFF';}
	if (_error_ == 0) {
        return true;
	} else {
		alert('Заполните поля указаные поля');
        return false;
	}
}
function FeedBack() {
	var name = bi('name').value;
	var message = bi('message').value;
	var email = bi('email').value;
	var lang = bi('lang').value;
	message = message.replace(/\n/, "<br>");
	var _error_ = 0;

	if (name == '') 		{bi('name').style.backgroundColor = '#FFAAAA'; 			_error_ = 1;} else {bi('name').style.backgroundColor = '#FFFFFF';}
	if (message == '') 		{bi('message').style.backgroundColor = '#FFAAAA'; 		_error_ = 1;} else {bi('message').style.backgroundColor = '#FFFFFF';}
	if (email == '')	 	{bi('email').style.backgroundColor = '#FFAAAA';			_error_ = 1;} else {bi('email').style.backgroundColor = '#FFFFFF';}
	if (_error_ == 0) {
		myAjax('feedback.php?name='+name+'&message='+message+'&email='+email+'&ok=1&lang='+lang+'&act=send_email', 'ajaxcontent');
	} else {
		alert('Заполните поля указаные поля');
	}
}
function FeedBackFAQ() {
	var name = bi('name').value;
	var message = bi('message').value;
	var email = bi('email').value;
	var lang = bi('lang').value;
	message = message.replace(/\n/, "<br>");
	var _error_ = 0;

	if (name == '') 		{bi('name').style.backgroundColor = '#FFAAAA'; 			_error_ = 1;} else {bi('name').style.backgroundColor = '#FFFFFF';}
	if (message == '') 		{bi('message').style.backgroundColor = '#FFAAAA'; 		_error_ = 1;} else {bi('message').style.backgroundColor = '#FFFFFF';}
	if (email == '')	 	{bi('email').style.backgroundColor = '#FFAAAA';			_error_ = 1;} else {bi('email').style.backgroundColor = '#FFFFFF';}
	if (_error_ == 0) {
		myAjax('faq.php?name='+name+'&message='+message+'&email='+email+'&ok=1&lang='+lang+'&act=send_email', 'faqform');
	} else {
		alert('Заполните поля указаные поля');
	}
}