var num_small_menu = 5;
var ne_ma_zanimavai = '';
stringz = new Array(2);
css_namez = new Array(2);

function change_active_uni(who_id, where, content)
{
if (who_id != undefined && where != undefined)
 {
	var numr=eval(who_id.substr(9, who_id.length-9));
	numr=numr-1;

	if (where=='top')
	{
		stringz[0] = 'top_menu_';
		stringz[1] = 'top_menu_';
		stringz[2] = 'top_menu_';
		clearz('big');
		css_namez[0] = 'left_pap_active';
		css_namez[1] = 'center_pap_active';
		css_namez[2] = 'right_pap_active';
		document.getElementById('sub_nav').innerHTML = content;

	}
	else if (where=='small')
	{
		stringz[0] = 'sml_menu_';
		stringz[1] = 'sml_menu_';
		stringz[2] = 'sml_menu_';
		clearz('small');
		css_namez[0] = 'left_pap_small';
		css_namez[1] = 'center_pap_small';
		css_namez[2] = 'right_pap_small';
	}
	for( var n = 0; n <= 2; n++ ) {
		stringz[n] = stringz[n] + numr;
		document.getElementById(stringz[n]).className = css_namez[n];
		numr=numr+1;
	}
	on_content = "1";
 }
}


function returnflash(flash_content)
{
	if (on_content == "1")
	{
		document.getElementById('sub_nav').innerHTML=flash_content;
		on_content = "2";
	}

}


function clearz(who){
 if (who != undefined)
 {
	var strgz;
	var numbz = 0;
	var namez;

	if (who=='small')
	{
		broi_where = num_small_menu;
		strgz = 'sml_menu_';
		css_namez[0] = 'left_pap_small_unactiv';
		css_namez[1] = 'center_pap_small_unactiv';
		css_namez[2] = 'right_pap_small_unactiv';
	}
	else if (who=='big')
	{
		broi_where = num_big_menu;
		strgz = 'top_menu_';
		css_namez[0] = 'left_pap';
		css_namez[1] = 'center_pap';
		css_namez[2] = 'right_pap';
	}

	for( var i = 1; i <= broi_where; i++ ) {
		for( var nz = 0; nz <= 2; nz++ ) {
			numbz=numbz+1;
			namez = strgz+numbz;
			document.getElementById(namez).className = css_namez[nz];
		}
	}
 }
}



var pic_broi = 4;
var strgz = 'dv_';

function next_pic(num){
	stringz = 'dv_'+num;
	for( var i = 1; i <= pic_broi; i++ ) {
			namez = strgz+i;
			document.getElementById(namez).className = 'dv_hidden';
	}
	document.getElementById(stringz).className = 'dv';
}


//workaround for on mouse leave events
function containsDOM (container, containee) {
  var isParent = false;
  do {
    if ((isParent = container == containee))
      break;
    containee = containee.parentNode;
  }
  while (containee != null);
  return isParent;
}


function checkMouseLeave (element, evt) {
  if (element.contains && evt.toElement) {
    return !element.contains(evt.toElement);
  }
  else if (evt.relatedTarget) {
    return !containsDOM(element, evt.relatedTarget);
  }
}
