var cLang = "";

function toggleSpacers(onOff, obj, spacers) {
	spacers = spacers.split(",");
	var className;
  //debug('On/off: '+onOff+' #'+obj+' spacers: '+spacers+' (length: '+spacers.length+')'); //
	onClass   = 'item_on';
	offClass  = 'item_off';
	onSpacer  = 'menu_item_spacer_on';
	offSpacer = 'menu_item_spacer';

	if (obj == 6) { onClass = 'contact_on'; offClass = 'contact_off'; }
	if (obj > 6) { onClass = 'left_on'; offClass = 'left_off'; onSpacer = 'menu_left_spacer_on'; offSpacer = 'menu_left_spacer'; }

	if (obj != PageID) {
		if ((onOff == 1 && gid('item_'+obj).className == offClass) || (onOff == 0 && gid('item_'+obj).className == onClass)) {
			if (onOff) { gid('item_'+obj).className = onClass; }
			else { gid('item_'+obj).className = offClass; }

			if (spacers[0].length>0 && obj <= 6) {
				for (i=0;i<spacers.length;i++) {
					className = gid('spacer'+spacers[i]).className;
					if (onOff) { gid('spacer'+spacers[i]).className = onSpacer; }
					else { gid('spacer'+spacers[i]).className = offSpacer;}
				}
			}
		}
	}
}

function debug(s) { gid('debug').innerHTML = s+'<br /><br />'+gid('debug').innerHTML; }

function gid(id) { return document.getElementById(id); }

function toggleLanguages(s) {
	gid('lng_'+cLang).style.display = 'none';
	gid('lng_'+s).style.display = 'block';
	gid('lng_mnu_'+cLang).style.fontWeight = 'normal';
	gid('lng_mnu_'+s).style.fontWeight = 'bold';
	cLang = s;
}
