//js for chenching color's on mouse over

var newcolor=new Array("ff0000","ff3300",
"ff3300","ff6600","ff6600","ff9900",
"ff9900","ffcc00","000000","cc0000",
"cc0000","000000","ccff00","99ff00",
"99ff00","00ff00","00ff00","00cc00",
"00cc00","00cc99","00cc99","00ccff",
"00ccff","0099ff","0099ff","0066ff",
"0066ff","0033ff","0033ff","9900cc",
"9900cc","9933cc","9933cc","cc33cc",
"cc33cc","ff00cc","ff33cc","ff0066",
"ff0066","ff0000")
// speed of animation. Smaller means faster
var pause=50
// Do not edit the values below
var timer
var animation_on=true
var thislink
var i_color=0
function startanimation(newlink) {
if (document.all) {
animation_on=true
thislink=eval("document.all."+newlink+".style")
changecolors()
}
}

function changecolors() {
if (animation_on) 
{ 
if (i_color>=newcolor.length-1) 
	{
	i_color=0
	}
thislink.color=newcolor[i_color]
i_color++
timer=setTimeout("changecolors()",pause)
}else {
clearTimeout(timer)
}
} 
function stopanimation() { 
if (document.all) {
animation_on=false
}
} 




//wright colon adds
function cel(){
document.write("<a href='http://www.rambaminrussian.org/' target='_blank'><img src='/Templates/i/rambam_na_ruskom.gif'  alt='Rambam  In Russian' width='82' height='31' border='0' ='top'></a><br /><br /><a href='http://mesivta.ru' target='_blank'><img src='/Templates/i/mesivtaru.gif' alt='Mesivta.RU' width='83' height='31' border='0'></a><br /><br /><a href='http://russianjewry.com/' target='_blank'><img src='/Templates/i/free.jpg' alt='F.R.E.E' width='83' height='31' border='0'></a><br /><br /><a href='http://jewish.ru/' target='_blank'><img src='/Templates/i/jewishru.jpg' alt='Jewish.ru' width='82' height='31' border='0' style='border: 1px solid gray;'></a><br /><br /><a href='http://chassidus.ru' target='_blank'><img src='/Templates/i/chasidus.gif' width='82' height='31' border='0' alt='Chasidus.ru' style='border: 1px solid gray;' ></a><br /><br /><a href='http://www.mignews.com' target='_blank'><img src='/Templates/i/mignews.gif' width='82' height='31' border='0' alt='Mignews.com'></a><br /><br /><a href='http://www.sedmoycanal.com/' target='_blank'><img src='/Templates/i/7kanal.jpg' width='83' height='31' border='0' alt='sedmoycanal.com'></a><br /><br /><a href='http://www.cool.ru/' target='_blank'><img src='/Templates/i/coolru.gif' width='83' height='31' border='0' alt='Cool.ru'></a><br /><br /><a href='http://www.evrey.com/' target='_blank'><img src='/Templates/i/evrey.jpg' width='83' height='31' border='0' alt='Evrey.com' style='border: 1px solid gray;'></a><br />")
};



// for menu to change images
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 MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}




//image swep also for menu i think i'm not shore.
function MM_preloadImages() { //v3.0
  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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
};







/*
originally written by paul sowden <paul@idontsmoke.co.uk> | http://idontsmoke.co.uk
modified and localized by alexander shurkayev <alshur@narod.ru> | http://htmlcoder.visions.ru
tuning by alexey zemskov
*/
function fi (el) { el.style.background = '#FFFFDF'; }
function bi (el) { el.style.background = '#FFFFFF'; }
function sm (targ, ins) {
	trg = document.getElementById(targ);
	trg.value = trg.value + ' '+ ins + ' ';
	trg.focus();
}
function SpamNotSend(ml) { return 'to:'+ ml + '@'; }
function SendSpamToHell(ml) { return ml + '@'; }

window.onerror = null;
var tooltip_attr_name = "tooltip";
//var comment = 

window.onload = function(e){
if (document.createElement) tooltip.d();

var lS = '';var e;e = document.getElementsByTagName("iframe");
function clx(){
	window.focus();if (window.status&&(window.status!=lS)){lS=window.status;ads=new Image();
	ads.src = '/al/?hr=' + escape(document.location.href.replace(/http:\/\//ig, ""))
			+ '&st=' + escape(window.status);
}}
for (var i=0;i<e.length;i++){if(e[i].src.indexOf('go'+'oglesyndication.'+'com')>-1){
if (document.layers){e[i].captureEvents(Events.ONFOCUS);} e[i].onfocus = clx;}}

}

tooltip = 
{
  t: document.createElement("DIV"),
  c: null,
  c2: null,
  g: false,
  comment:new Array(),

  m: function(e)
  {
    if (tooltip.g)
    {
      oCanvas = document.
          getElementsByTagName((document.compatMode && 
              document.compatMode == "CSS1Compat") ? "HTML" : "BODY")[0];

      x = window.event ? event.clientX + oCanvas.scrollLeft : e.pageX;
      y = window.event ? event.clientY + oCanvas.scrollTop : e.pageY;
      
      tooltip.a(x, y);
    }
  },

  d: function()
  {
//    return;
    tooltip.t.setAttribute("id", "tooltip");
//    tooltip.t.style.filter = "alpha(opacity=65)"; // buggy in ie5.0
    document.body.appendChild(tooltip.t);
    a = document.all ? document.all : document.getElementsByTagName("*");
    aLength = a.length;
    for (var i = 0; i < aLength; i++)
    {
      if (a[i].getAttribute("title") )
		if ((a[i].getAttribute("href") && a[i].getAttribute("href").indexOf('googlesyndication.com')==-1) || !a[i].getAttribute("href"))
      {
        a[i].setAttribute(tooltip_attr_name, a[i].getAttribute("title"));
        if (a[i].getAttribute(tooltip_attr_name)){
          a[i].removeAttribute("title");
          if (a[i].getAttribute("alt") && a[i].complete) a[i].removeAttribute("alt");
          tooltip.l(a[i], "mouseover", tooltip.s);
          tooltip.l(a[i], "mouseout", tooltip.h);
        }
      }
      else if (a[i].getAttribute("alt") && a[i].complete)
      {
        a[i].setAttribute(tooltip_attr_name, a[i].getAttribute("alt"));
        if (a[i].getAttribute(tooltip_attr_name))
        {
          a[i].removeAttribute("alt");
          tooltip.l(a[i], "mouseover", tooltip.s);
          tooltip.l(a[i], "mouseout", tooltip.h);
        }
      }
    }
    document.onmousemove = tooltip.m;
    window.onscroll = tooltip.h;
  },

  s: function(e){
    d = window.event ? window.event.srcElement : e.currentTarget;
    if (!d.getAttribute(tooltip_attr_name)) return;
    if (tooltip.t.firstChild) tooltip.t.removeChild(tooltip.t.firstChild);
    tooltip.t.appendChild(document.createTextNode(d.getAttribute(tooltip_attr_name)));
    s = d.getAttribute(tooltip_attr_name);
	if (s.substring(0,1) == "#")
	{
/*
		var foo = new Object(), k;
		if (typeof foo.bar != "undefined") {
		    k = foo.bar
		    } else {
		    k = undefined
		    }
		alert(k);
*/      ncom = parseInt(s.substring(1));
//		var comment = new Array();
//		alert(comment);
		if (typeof(tooltip.comment[ncom]) == "undefined")
		{
		    tooltip.t.innerHTML = "??????????? ????????? ???????????...";
//			var comment = '';
			var jsel = document.createElement('SCRIPT');
			jsel.type = 'text/javascript';
			jsel.onload = function() { tooltip.t.innerHTML = tooltip.comment[ncom].replace(/  /i, "<br />"); return true; }
			jsel.src = 'comments'+parseInt(ncom)+'.js';
//			alert(jsel.src);
			document.body.appendChild (jsel);
//			eval('var tmp = comment'+s.substring(1)+';');
//			if (tmp == undefined)
//		    tooltip.c2 = setTimeout("eval('tooltip.t.innerHTML = tooltip.comment[ncom].replace(/  /i, \"<br />\");');", 1000);
		}
		else
		{
	        tooltip.t.innerHTML = tooltip.comment[ncom].replace(/  /i, "<br />");
		}
	}
	else
	{
    re = /  /i;
	while (s != s.replace(re, "<br>")) s = s.replace(re, "<br>")
    tooltip.t.innerHTML = s;
	}
    tooltip.c = setTimeout("tooltip.t.style.visibility = 'visible';", 1);
    tooltip.g = true;
  },

  h: function(e){
    tooltip.t.style.visibility = "hidden";
    // thanks to Alexander Shurkayev for helping me optimise this line :-)
    if (tooltip.t.firstChild) 
      tooltip.t.removeChild(tooltip.t.firstChild);
    clearTimeout(tooltip.c);
    tooltip.g = false;
    tooltip.a(-99, -99);
  },

  l: function(o, e, a){
    if (o.addEventListener) o.addEventListener(e, a, false); // was true--Opera7b workaround!
    else if (o.attachEvent) o.attachEvent("on" + e, a);
      else return null;
  },

  a: function(x, y)
  {
    oCanvas = document.getElementsByTagName(
          (document.compatMode && document.compatMode == "CSS1Compat") ? "HTML" : "BODY")[0];

    w_width = window.innerWidth ? window.innerWidth + window.pageXOffset : oCanvas.clientWidth + oCanvas.scrollLeft;
    w_height = window.innerHeight ? window.innerHeight + window.pageYOffset : oCanvas.clientHeight + oCanvas.scrollTop;

    t_width = window.event ? tooltip.t.clientWidth : tooltip.t.offsetWidth;
    t_height = window.event ? tooltip.t.clientHeight : tooltip.t.offsetHeight;

    t_extra_width = 7; // CSS padding + borderWidth;
    t_extra_height = 5; // CSS padding + borderHeight;

    tooltip.t.style.left = x + 8 + "px";
    tooltip.t.style.top = y + 8 + "px";

    while (x + t_width + t_extra_width > w_width)
    {
      x -= x + t_width + t_extra_width - w_width;
      tooltip.t.style.left = x + "px";
      t_width = window.event ? tooltip.t.clientWidth : tooltip.t.offsetWidth;
    }

    while (y + t_height + t_extra_height > w_height)
    {
      y -= y + t_height + t_extra_height - w_height;
      tooltip.t.style.top = y + "px";
      t_height = window.event ? tooltip.t.clientHeight : tooltip.t.offsetHeight;
    }
  }
}

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 MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
