var typesb = '';
var langsb = '';
var setmenu = 0;
function bi (el) {
	return document.getElementById(el);
}

function av (this_) {
	if (this_.style.background.indexOf('mtopa.jpg') == -1) {
		this_.style.background = 'url(i/mtopa.jpg) no-repeat';
		var elements = this_.childNodes;
		var len = elements.length
		for(var i=0; i<len; i++) {
			if (elements[i] != null) {
				if (elements[i].className == 'btnbottom' || elements[i].className == 'btnbottoma') {
					elements[i].style.background = 'url(i/mbottoma.jpg) no-repeat bottom';
				}
			}
		}
	}
}
function dv (this_) {
	if (this_.style.background.indexOf('mtop.jpg') == -1) {
		this_.style.background = 'url(i/mtop.jpg) no-repeat';
		var elements = this_.childNodes;
		var len = elements.length
		for(var i=0; i<len; i++) {
			if (elements[i] != null) {
				if (elements[i].className == 'btnbottom' || elements[i].className == 'btnbottoma') {
					elements[i].style.background = 'url(i/mbottom.jpg) no-repeat bottom';
				}
			}
		}
	}
}
function deactivedivm () {
	for(var i=0; i<=menu_al.length; i++) {
		if (document.getElementById('sm'+menu_al[i]) != null ) {		
			nonediv('sm'+menu_al[i]);
		}
	}
	nonediv('selmnth');
	nonediv('selyear');
}
function avs (this_, id) {
 	for(var i=0; i<=menu_al.length; i++) {
		if (document.getElementById('sm'+menu_al[i]) != null ) {		
			nonediv('sm'+menu_al[i]);
		}
	}
	setmenu = id;
	if (id != 0) {
		blockdiv('sm'+id);
		blockdiv('submenu');
	}
	if (this_.style.background.indexOf('mtopa.jpg') == -1) {
		this_.style.background = 'url(i/mtopa.jpg) no-repeat';
		var elements = this_.childNodes;
		var len = elements.length
		for(var i=0; i<len; i++) {
			if (elements[i] != null) {
				if (elements[i].className == 'btnbottom') {
					elements[i].style.background = 'url(i/mbottoma.jpg) no-repeat bottom';
				}
			}
		}
	}
}
function dvs (this_) {
	if (this_.style.background.indexOf('mtop.jpg') == -1) {
		this_.style.background = 'url(i/mtop.jpg) no-repeat';
		var elements = this_.childNodes;
		var len = elements.length
		for(var i=0; i<len; i++) {
			if (elements[i] != null) {
				if (elements[i].className == 'btnbottom') {
					elements[i].style.background = 'url(i/mbottom.jpg) no-repeat bottom';
				}
			}
		}
	}
}
function blockdiv (this_) {
	if (document.getElementById(this_) != null ) {		
		document.getElementById(this_).style.display = 'block';
	}
}
function nonediv (this_) {
	if (document.getElementById(this_) != null ) {		
		document.getElementById(this_).style.display = 'none';
	}
}
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 isValidEmail(email) {
    re = /^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i;
    return re.test(email);
}
        
function makeCheck(address) {
	if (isValidEmail(address)) { return true; } else { return false; }
	return false;
}

function ShowS (types, langs) {
	typesb = types;
	langsb = langs;
	blockdiv('subscriber');
}

function SubScriber (lang) {
	var email = bi('subemail').value;	
	if (isValidEmail(email)) { 
//		alert('submail.php?lang='+lang+'&subemail='+email+'&types='+typesb);
		myAjax('submail.php?lang='+lang+'&subemail='+email+'&types='+typesb, 'subscribers');
		bi('subemail').value = '';	
		nonediv('subscriber');
	} else { 
		alert('E-mail');
		return false; 
	}
}
function setnulltext(this_, mess, typ) {
	if (typ == 0) {
		if (this_.value == mess) {this_.value = ""};
	} else {
		if (this_.value == "") {this_.value = mess};
	}
}