function getBrowserInfo() {
 var t,v = undefined;
 if (window.opera) t = 'Opera';
 else if (document.all) {
  t = 'IE';
  var nv = navigator.appVersion;
  var s = nv.indexOf('MSIE')+5;
  v = nv.substring(s,s+1);
 }
 else if (navigator.appName) t = 'Netscape';
 return {type:t,version:v};
}
 

function high(which2){
theobject=which2
alfa_op=40; 
highlighting=setInterval("highlightit(theobject)",40)
}


function low(which2){ 
clearInterval(highlighting)
alfa_op=40; 
alfa_op_op = alfa_op/100;

var b = getBrowserInfo();
if (b.type == 'IE' && b.version >= 4) { which2.filters.alpha.opacity=alfa_op; }
else { which2.style.opacity=alfa_op_op; which2.style.KhtmlOpacity=alfa_op_op; which2.style.MozOpacity=alfa_op_op; }

}


function highlightit(cur2){
	
if (alfa_op<100) {
alfa_op+=10; 
alfa_op_op = alfa_op/100;

var b = getBrowserInfo();
if (b.type == 'IE' && b.version >= 4) { cur2.filters.alpha.opacity=alfa_op; }
else { cur2.style.opacity=alfa_op_op; cur2.style.KhtmlOpacity=alfa_op_op; cur2.style.MozOpacity=alfa_op_op; }
}
else if (window.highlighting) clearInterval(highlighting)

}


function baza(clipart) {
if (screen.height < 730){
	windop = window.open("foto.html?"+clipart+"","foto","width=600,scrollbars=1,resizable=1");
	windop.focus();
	  }
else {
windop = window.open("foto.html?"+clipart+"","foto","height=550,width=600");
windop.focus();
}
}
function prew_pic(clipart) {
	windop = window.open("foto.html?"+clipart+"","uvelich","scrollbars=1,resizable=1,menubar=1");
	windop.focus();
}
function Help(name) {
	windop = window.open("help/"+name+".php","help","height=270,width=350,scrollbars=1,resizable=1");
		windop.focus();
}

function novost(fail,papka,h,w) {
if (screen.height < 730){
	windop = window.open(""+papka+"/"+fail+".html","news","width=400,scrollbars=1,resizable=1,menubar=1");
	windop.focus();
	  }
else {
windop = window.open(""+papka+"/"+fail+".html","news","height=300,width=400,scrollbars=1,resizable=1,menubar=1");
windop.focus();
}
}

function menuover(obj)
{
obj.style.cursor="hand";
//obj.className="menuover";
//obj.all.tags('A').item(0).style.color="#522020";
}

function photoover(obj)
{
//alert(obj);
var TABLE = document.getElementById(obj);
TABLE.getAttributeNode('bgcolor').value = "";
//obj.style.cursor="hand";
//obj.className="photoover";
//obj.all.tags('A').item(0).style.color="#522020";
}

function menuout(obj)
{
obj.className="menuout";
//obj.all.tags('A').item(0).style.color="#1E6A54";
}

function menuclick(obj)
{
window.location.href=obj.all.tags('A').item(0).href;
}


//скрыть-показать див
function showHideDiv(id1,id2){
document.getElementById(id1).style.display = 'block';
document.getElementById(id2).style.display = 'none';
}

//показать класс
function showClass(id, theClass){
document.getElementById(id).className = theClass;
}

//скрыть класс
function hideClass(id, theClass){
document.getElementById(id).className = 'none';
}

//поменять картинку
function showImg(id, srс1, src2){
obj = document.getElementById(id);
obj.src = (obj.src.indexOf(srс1) != -1)? src2: srс1;
}


function vkl_reder(ind, red1, red2, red3){
document.getElementById('par'+ind+'_1').className = red1;
document.getElementById('par'+ind+'_2').className = red2;
document.getElementById('par'+ind+'_3').className = red3;
}	


function ch_class(id, clas){
document.getElementById(id).className = clas;
}	


function display(id){
obj = document.getElementById(id);
if(obj)
obj.style.visibility = "visible";
}

function hidden(id){
obj = document.getElementById(id);
if(obj)
obj.style.visibility = "hidden";
}

function cs(id, theClass){
obj = document.getElementById(id);
if(obj)
obj.className = theClass;
}


function show(id, path)
{
    if (obj = document.getElementById('pic')) {
        obj.style.background = "url('"+path+"')";
		}
} 


function hide_banner_all()
{
	for(i = 0; i < 1000; i++){
		obj1 = document.getElementById('banner_'+i);
		obj2 = document.getElementById('glass');
		if(obj1) {obj1.style.display = "none";}
		if(obj2) {obj2.style.display = "none";}
	}
}





function display_menu(ind)
{
	for(i = 0; i < 20; i++){
		obj = document.getElementById('m'+ind+'_'+i);
		if(obj) {obj.style.visibility = "visible";}
    }
}


function hide_menu(ind)
{
	for(i = 0; i < 20; i++){
		obj = document.getElementById('m'+ind+'_'+i);
		if(obj) {obj.style.visibility = "hidden";}
    }
}


function change_all(ind)
{
 hide_all(); hiding('pr'+ind+'_1'); displaing('pr'+ind+'_2');
}


function hide_all()
{
	for(i = 0; i < 1000; i++){
		obj1 = document.getElementById('pr'+i+'_1');
		obj2 = document.getElementById('pr'+i+'_2');
		if(obj1) {obj1.style.display = "block";}
		if(obj2) {obj2.style.display = "none";}
	}
}


function displaing(id){
obj = document.getElementById(id);
if(obj)
obj.style.display = "block";
}

function hiding(id){
obj = document.getElementById(id);
if(obj)
obj.style.display = "none";
}


function change_page()
{
	for(i = 0; i < 1000; i++){
		obj = document.getElementById('af_'+i+'_');
		if(obj) {obj.style.display = "none";}
	}
}


//SELECT
var nohide = 0;
function select_this(id, val){
form_obj = document.getElementById(id);
form_obj.value = val;
}
function view_this(id, val){
form_obj = document.getElementById(id);
textNode = form_obj.firstChild;
textNode.nodeValue = val;
}

function hide(id){
obj = document.getElementById(id);
if(!nohide){
obj.style.display = 'none';
window.status = nohide;
}
else
nohide = 0;
}

function show(id){
obj = document.getElementById(id);
obj.style.display = 'block';
}
function show_hide(id){
obj = document.getElementById(id);
obj.style.display = (obj.style.display == 'none')? 'block': 'none';
nohide=1;
}

//сохранять позицию экрана при переходе на следующею страницу
function save_screen_pos(){
if(navigator.userAgent.indexOf("MSIE") != -1) popravka = 141; else popravka = 0;
setCookie("screen_pos", document.body.scrollTop-popravka);
}

//установка куки
function setCookie(name, value){
	document.cookie = name+"="+escape(value)+";path=/";
}
