var form_position = "open";
var id_form = "krek_login";
var height_form = "krek_form";
var h_form = 34;
var shag_move = 1;
var move = -34;

function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",80)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=40
}
function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

// Функции таймера и передвижения формы
function FormMove(id_ico, id_form, height_form){
obj = document.getElementById(id_ico);
if (form_position != "open") { 
form_position = "open"; 
obj.src = "../templates/template_1/images/log_"+form_position+".gif"; 
chek_timer(id_form, height_form);
}
else { 
form_position = "close"; 
obj.src = "../templates/template_1/images/log_"+form_position+".gif"; 
chek_timer(id_form, height_form);
}
}

function chek_timer(id_form, height_form){
if (form_position != "open") shag_move=1; else shag_move=-1;
object_move_id = id_form;
timer_form_interval=setInterval("move_form(object_move_id, height_form, shag_move)",1);
}

function move_form(object_id, height_form, shag_move){

object_move_id = object_id;
h_form = document.getElementById(height_form).offsetHeight;
	
if ((shag_move>0 && move<0) || (shag_move<0 && move>h_form*-1)) {
move+=shag_move; 
form_obj_put = document.getElementById(object_id);
form_obj_put.style.top = move+"px";
}
else if (window.timer_form_interval) clearInterval(timer_form_interval);
}





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 ch_class(id, cl_name)
{
document.getElementById(id).className = cl_name;
}

//скрыть-показать див
function showHideDiv(div_id){
div = document.getElementById(div_id);
div.style.display = (div.style.display == 'none') ? 'block' : 'none';
}
//скрыть див
function hideDiv(div_id){
document.getElementById(div_id).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 vkl_zel(id, kv1){
document.getElementById(id).className = kv1;
}	

function vkl_grey(id, grey){
document.getElementById(id).className = grey;
}	

function display(id){
obj = document.getElementById(id);
if(obj)
obj.style.display = "block";
}

function hide(id){
obj = document.getElementById(id);
if(obj)
obj.style.display = "none";
}

function cs(id, theClass){
obj = document.getElementById(id);
if(obj)
obj.className = theClass;
}

//установка куки
function setCookie(name, value){
	document.cookie = name+"="+escape(value)+";path=/";
}

