podsvetka = 0;
function timer(which2){
if (podsvetka == 0 || !podsvetka){
high(which2);
podsvetka = 1;
}
else if (podsvetka == 1) { low(which2); podsvetka = 0; }
}

function high(which2) {
theobject=which2;
highlighting=setInterval("highlightit(theobject)",10);
}

function low(which2){
if (podsvetka == 1){
clearInterval(highlighting);}
//which2.filters.alpha.opacity=40
which2.style.width = 150;
which2.style.height = 65;
which2.style.marginLeft = -150;
which2.style.zIndex=0;
podsvetka = 0;
}
function highlightit(cur2){
if (parseInt(cur2.style.width)<350){
//cur2.filters.alpha.opacity+=10
cur2.style.width = parseInt(cur2.style.width)+20;
cur2.style.height = parseInt(cur2.style.height)+20;
cur2.style.marginLeft = parseInt(cur2.style.marginLeft)-20;
cur2.style.zIndex=100;
//margin-left: -150; margin-top: -65; width: 150; height: 65;
}
else if (window.highlighting)
clearInterval(highlighting)
//podsvetka = 1;
}

//просмотр фото в новом окне
function baza(clipart, ww) {
if (screen.height < 730){
if (!ww || ww < 600) { ww = 600; }
	windop = window.open("foto.php?src="+clipart+"","foto","width="+ww+",scrollbars=1,resizable=1,top=30,left=30");
	windop.focus();
	  }
else {
if (!ww || ww < 600) { ww = 600; } else { ww = ww+60; }
windop = window.open("foto.php?src="+clipart+"","foto","height=550,width="+ww+",top=30,left=30,scrollbars=1,resizable=1");
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"; }
function menuout(obj)
{ }
function menuclick(obj)
{ window.location.href=obj.all.tags('A').item(0).href; }

//скрыть-показать
function showDiv(div_id){
div = document.getElementById(div_id);
div.style.display = (div.style.display == 'none') ? 'block' : 'none';
}
function showDiv2(div_id){
div = document.getElementById(div_id);
div.style.display = (div.style.display == 'none') ? '' : 'none';
}
function show(div_id){
div_i = document.getElementById(div_id);
div_i.style.display = 'block';
}
function hide(div_id){
div_i = document.getElementById(div_id);
div_i.style.display = 'none';
}

function show123(div_id){
div_i = document.getElementById(div_id);
div_i.style.display = 'block';
}
function hide123(div_id){
div_i = document.getElementById(div_id);
div_i.style.display = 'none';
}

function hide_all(pref){
	for(i = 0; i < 1000; i++){
		obj = document.getElementById(pref+i);
		if(!obj) continue;
		obj.style.display = 'none';
	}
}
//скрыть-показать картинку
function showImg(id, srс1, src2){
obj = document.getElementById(id);
obj.src = (obj.src.indexOf(srс1) != -1)? src2: srс1;
}

function showTitle(id, title1, title2){
obj = document.getElementById(id);
obj.title = (obj.title == title1)? title2: title1;
}

function showBackground(id, bg1, bg2){
obj = document.getElementById(id);
obj.style.background = (obj.style.background == bg1)? bg2: bg1;
}

//установка куки
function setCookie(name, value){
	document.cookie = name+"="+escape(value)+";path=/";
}

//открыть новое окно
function winimage(w){
	windop = window.open("","uvelich","scrollbars=1,resizable=1,menubar=1");
	windop.document.write("<image src='" + w + "'>");
	windop.focus();
}


function insimg2(){
	imgw=window.open('editor/dlg_image_upload2.php','IMG','scrollbars=0,resizable=0,width=400,height=260, left=550, top=30');
	imgw.focus();
}

var addImageInd = "";
function AddImage2(imagePath){		
	document.getElementById('fotoform'+addImageInd).value = imagePath;
	document.getElementById('fotoimg'+addImageInd).src = imagePath? imagePath: 'images/spacer.gif';
	document.getElementById('fotoprew'+addImageInd).src = imagePath? imagePath: 'images/spacer.gif';
	imgw.close();		
}

function cs(id, theClass){
obj = document.getElementById(id);
if(obj)
obj.className = theClass;
}

function cs2(id, theClass1, theClass2){
obj = document.getElementById(id);
if(obj)
obj.className = (obj.className == theClass2)? theClass1: theClass2;
}

function showDiv(div_id){
div = document.getElementById(div_id);
div.style.display = (div.style.display == 'none') ? 'block' : 'none';
}

function cs_all(pref, clname){
		for(i = 0; i < 1000; i++){
		obj = document.getElementById(pref+i);
		if(!obj) continue;
		obj.className = clname;
		}
}


//показывает див по центру экрана (с черной, полупрозрачной подложкой на весь экран)
function show_dlg_window(div_id, glass_id)
{
var skroll_height = document.body.scrollHeight;
		
var out = {
	banner: document.getElementById(div_id),
	glass: document.getElementById(glass_id),
	body: document.getElementsByTagName('body')[0]
    };

	with(out.glass.style){
		display = 'block';
		top = "0px";
		left = "0px";
        height = skroll_height > out.body.clientHeight ? parseInt(skroll_height)+'px' : parseInt(out.body.clientHeight)+'px';
	}
	with(out.banner.style){
		display = 'block';
		margin = (((((out.body.scrollHeight)? out.body.scrollHeight: out.body.clientHeight)+out.body.scrollTop)/2)-out.banner.offsetHeight/2)+'px 0 0 '+((out.glass.offsetWidth/2)-(out.banner.offsetWidth/2))+'px';
	}
}
