var cook  = new Array();
var cook_num;

function SubmitControl(tocheack){
 if (document.all || document.getElementById){
     for (i=0; i < tocheack.length;i++){
          if(tocheack.elements[i].type.toLowerCase()=="submit"||tocheack.elements[i].type.toLowerCase()=="reset") {
             tocheack.elements[i].disabled = true
            }
         }
    }
}

function MM_jumpMenu(targ,selObj,restore){ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function ch_size(x)
{
document.all("ch").outerHTML= "<font  id=\"ch\" size="+x+">" +document.all("ch").innerHTML+"</font>";
var COOKIE;
 COOKIE ="textsize="+x+"; expires= Mon, 04-Jan-2010 00:00:00 GMT; path=/";
 document.cookie = COOKIE;
}


function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function ch_head(x)
{
document.all("white").outerHTML= "<font class = \"white\" id=\"white\" size=2>" +x+"</font>";
}

var mLeft = -197;
var tPause = 10;
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function ch_top()
{
var h1 = document.body.clientHeight;
var p1 = document.body.scrollTop+Math.round(h1/2)-cook_num*20;
var p2 = document.getElementById("Layer1").style.pixelTop;

var p3 = Math.round((p1-p2)/5);
if (p3>30) {p3=30;}
if (p3<-30) {p3=-30;}

document.getElementById("Layer1").style.pixelTop = p2+p3;
document.getElementById("Layer3").style.pixelTop = p2+p3-10;
if (document.getElementById("Layer3").style.pixelTop<0){document.getElementById("Layer3").style.pixelTop =0; document.getElementById("Layer1").style.pixelTop =10;}
if (tPause>0)
{tPause=tPause-1}else{document.getElementById("Layer3").style.pixelLeft = document.getElementById("Layer3").style.pixelLeft + Math.round((mLeft -document.getElementById("Layer3").style.pixelLeft)/4);}

}
function settimer(){
isMSIE=document.all && document.all.item;
if (isMSIE)
{
timer = window.setInterval("ch_top()",30);
readC();
readSize();
scrollW(window.location.href);
} else
{
document.getElementById("Layer3").innerHTML = '';
document.getElementById("Layer1").innerHTML = '';
}


//MM_preloadImages('http://www.hesse.ru/images/bio.jpg','http://www.hesse.ru/images/hesse.ru.jpg','http://www.hesse.ru/images/grad1.jpg','http://www.hesse.ru/images/articles.jpg','http://www.hesse.ru/images/art.jpg','http://www.hesse.ru/images/photo.jpg','http://www.hesse.ru/images/ar3.gif','http://www.hesse.ru/images/ar4.gif');
}
function over()
{
	tPause=0;mLeft=0;
}
function out()
{
	tPause=10;
	mLeft=-197;
	//alert(coord.style.pixelLeft);
}

function keyP()
{
//if (event.keyCode = 13)writeC();

}


function scrollW(s)
{
if  (s.indexOf("scroll")!=-1)
		{
			 s1 = s.substring(s.indexOf("scroll")+7,s.length);
			window.scroll(0,s1)			;
	     }

}

function  delsub(s,sc)
{
var s1;
if (s.indexOf("?")!=-1)
{
		if  (s.indexOf("scroll")!=-1)
		{
			 s1 = s.substring(0,s.indexOf("scroll"));
			 s1+="scroll="+sc;
	     }
		 else s1= s+"&scroll="+sc;
}
else 
{
s1= s+"?scroll="+sc; 
}

return s1;
}

function writeC()
{
var COOKIE;
 COOKIE ="hesse"+escape("~$|*")+escape(inp1.value+"~$|*")+ "="  +escape(inp1.value+"~$|*") + escape(delsub(window.location.href,document.body.scrollTop))+"; expires= Mon, 04-Jan-2010 00:00:00 GMT; path=/";
 document.cookie = COOKIE;
  readC();
}

function delC(cookId)
{
var COOKIE;
cookId;
 COOKIE ="hesse"+escape("~$|*")+escape(cook[cookId]+"~$|*")+ "="  +escape(cook[cookId]+"~$|*") + escape(delsub(window.location.href,document.body.scrollTop))+"; expires= Mon, 04-Jan-2001 00:00:00 GMT; path=/";
 document.cookie = COOKIE;
 readC();
 }


function linka(inner)
{

//  document.all("link1").outerHTML= "<font id=\"link1\">"+inner+"</font>";
alert(window.location.href.split("")[0]);
}

function jump(link1)
{
//alert(scroll1);
window.navigate(link1);

//window.scroll(0,scroll1+100);

}
function scrl(s)
{
window.scroll(0,s);

}

function readC()
{
  if (document.cookie) 
  {
  		var strings = new Array(); 
	    var temp = new Array();
        var temp3 = new Array();
        var inner ="" ; 

inner+="<table width = 100%  class=mnu border=0 cellpadding=0 cellspacing=0><tr><td nowrap><a class=DHTMLmnu href=\"http://www.hesse.ru\">&nbsp;&nbsp; Главная &nbsp;&nbsp;</a></td><td width=1 align=\"right\"></td></tr></table><table width = 100%  class=mnu border=0 cellpadding=0 cellspacing=0><tr><td nowrap><a class=DHTMLmnu href=\"http://www.hesse.ru/forum/\">&nbsp;&nbsp; Форум &nbsp;&nbsp;</a></td><td width=1 align=\"right\"></td></tr></table>";

//  	for (var j=0;j<cook.length;j++)cook[j]="";
	cook.length =1;
	cook_num= 0;
           strings = document.cookie.split(";");
                      for (var i=0; i<strings.length; i++) 
					  {
			                     temp = strings[i].split("=");
								                                if (temp[0].indexOf("hesse")!=-1)
                                {
										
                                           temp3 = unescape(temp[1]).split("~$|*");
										   	cook[i] =unescape(temp3[0]);cook_num++;
                                            inner+="<table width = 100%  class=mnu border=0 cellpadding=0 cellspacing=0><tr><td nowrap><a class=DHTMLmnu href="+temp3[1]+">&nbsp;&nbsp;"+unescape(temp3[0])+"</a></td><td width=1 align=\"right\"><input class=\"btnClass\" type=\"button\" name=\"del\" value=\"Del\"  onClick=delC("+i+");></td></tr></table>";                           
								}
                      }
//			    inner+="</table>";
			  document.all("link1").outerHTML= "<font id=\"link1\">"+inner+"</font>";
  } else  document.all("link1").outerHTML= "<font id=\"link1\"></font>";
}

function readSize()
{
  if (document.cookie) 
  {
       var strings = new Array(); 
        var temp = new Array();
        strings = document.cookie.split(";");
                      for (var i=0; i<strings.length; i++) 
			   {
			                     temp = strings[i].split("=");
					     if (temp[0].indexOf("textsize")!=-1)
					     {
						   if(document.all("menu1"))
						         {
							 ch_size(temp[1]);
						         menu1.selectedIndex =temp[1]-2;
					                 }
               				      }
			    }
                            
  } 
}


