function on(id)
{
	document.getElementById('sub'+id).style.display = 'block';
	
	if (id != 0) {
		document.getElementById('sub0').style.display = 'none';
	}
	
	if (id != 1) {
		document.getElementById('sub1').style.display = 'none';
	}
	
	if (id != 2) {
		document.getElementById('sub2').style.display = 'none';
	}
	
	if (id != 3) {
		document.getElementById('sub3').style.display = 'none';
	}
	
	if (id != 4) {
		document.getElementById('sub4').style.display = 'none';
	}
	
}

function off()
{
  document.getElementById('sub0').style.display = 'none';
  document.getElementById('sub1').style.display = 'none';
	document.getElementById('sub2').style.display = 'none';
	document.getElementById('sub3').style.display = 'none';
	document.getElementById('sub4').style.display = 'none';
  document.getElementById('searchform').setAttribute('autocomplete', 'off');
}



function views(url,name)
{
	foto=window.open('/view.php?foto='+url+'&name='+name,'foto','width=300,height=300');
	foto.focus();
}

function views1(url)
{
	ffoto=window.open(url,'ffoto','width=800,height=700,scrollbars');
	ffoto.focus();
}

function flashVersion() {
      // Отдельно определяем Internet Explorer
      var ua = navigator.userAgent.toLowerCase();
      var isIE = (ua.indexOf("msie") != -1 && ua.indexOf("opera") == -1 && ua.indexOf("webtv") == -1);
      // Стартовые переменные
      var version = 0;
      var lastVersion = 12; // На момент 2007 года с запасом
      var i;
      if (isIE) { // browser == IE
            try {
                  for (i = 3; i <= lastVersion; i++) {
                        if (eval('new ActiveXObject("ShockwaveFlash.ShockwaveFlash.'+i+'")')) {
                              version = i;
                        }
                  }
            } catch(e) {}
      } else { // browser != IE
            for (i = 0; i < navigator.plugins.length; i++) {
                  if (navigator.plugins[i].name.indexOf('Flash') > -1) {
                        version = (parseInt(navigator.plugins[i].description.charAt(16)) > version) ? parseInt(navigator.plugins[i].description.charAt(16)) : version;
                  }
            }
      }
      return version;
}

function xget(id) {
	if (document.getElementById) return document.getElementById(id);
	if (document.all) return document.all[id];
	return null;
}
