﻿// Copyright (c) 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.
{
preload_img2 = new Image();
preload_img2.src = 'http://mnib.info/image/nexth.gif';
preload_img3 = new Image();
preload_img3.src = 'http://mnib.info/image/prevh.gif';
preload_imgt3 = new Image();
preload_imgt3.src = 'http://mnib.info/image/talkh.gif';
preload_logo01 = new Image();
preload_logo01.src = 'http://mnib.info/image/mnib_logo.gif';
preload_hide01 = new Image();
preload_hide01.src = 'http://mnib.info/image/hide_txt.gif';
}

function img_apper() {
	    setTimeout('img_settime()',100);
}

function img_settime() {
//		new Rico.Effect.FadeTo("load",0,10,3);
	    new Rico.Effect.FadeTo("img01",1.0,70,5);
}

function setCookie (name, value, expires, path, domain, secure) {
    var curCookie = name + "=" + escape(value) + (expires ? "; expires=" + expires : "") +
        (path ? "; path=" + path : "") + (domain ? "; domain=" + domain : "") + (secure ? "secure" : "");
    document.cookie = curCookie;
}

function getCookie (name) {
    var prefix = name + '=';
    var c = document.cookie;
    var nullstring = '';
    var cookieStartIndex = c.indexOf(prefix);
    if (cookieStartIndex == -1)
        return nullstring;
    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
    if (cookieEndIndex == -1)
        cookieEndIndex = c.length;
    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function deleteCookie (name, path, domain) {
    if (getCookie(name))
        document.cookie = name + "=" + ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function fixDate (date) {
    var base = new Date(0);
    var skew = base.getTime();
    if (skew > 0)
        date.setTime(date.getTime() - skew);
}

function rememberMe (f) {
    var now = new Date();
    fixDate(now);
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
    now = now.toGMTString();
    if (f.author != undefined)
       setCookie('mtcmtauth', f.author.value, now, '/', '', '');
    if (f.email != undefined)
       setCookie('mtcmtmail', f.email.value, now, '/', '', '');
    if (f.url != undefined)
       setCookie('mtcmthome', f.url.value, now, '/', '', '');
}

function forgetMe (f) {
    deleteCookie('mtcmtmail', '/', '');
    deleteCookie('mtcmthome', '/', '');
    deleteCookie('mtcmtauth', '/', '');
    f.email.value = '';
    f.author.value = '';
    f.url.value = '';
}

function hideDocumentElement(id) {
    var el = document.getElementById(id);
    if (el) el.style.display = 'none';
}

function showDocumentElement(id) {
    var el = document.getElementById(id);
    if (el) el.style.display = 'block';
}

var commenter_name;

function individualArchivesOnLoad(commenter_name) {




    if (document.comments_form) {
        if (document.comments_form.email != undefined &&
            (mtcmtmail = getCookie("mtcmtmail")))
            document.comments_form.email.value = mtcmtmail;
        if (document.comments_form.author != undefined &&
            (mtcmtauth = getCookie("mtcmtauth")))
            document.comments_form.author.value = mtcmtauth;
        if (document.comments_form.url != undefined && 
            (mtcmthome = getCookie("mtcmthome")))
            document.comments_form.url.value = mtcmthome;
        if (mtcmtauth || mtcmthome) {
            document.comments_form.bakecookie.checked = true;
        } else {
            document.comments_form.bakecookie.checked = false;
        }
    }
}

function writeTypeKeyGreeting(commenter_name, entry_id) {

}

function wawiting(){ }

function menushow2(menu){
    var menu2ID=document.getElementById('menu2'+menu);
    var sub2ID=document.getElementById('sub2'+menu);
    if(menu2ID.className=='0'){
    new Rico.Effect.FadeTo("TALKBG",0,40,4);
		setTimeout('waiting()', 500);
		sub2ID.style.display='none';
      	menu2ID.className='1';
		document.logo01.src = 'http://mnib.info/image/mnib_logoB.gif';
		document.hide01.src = 'http://mnib.info/image/unhide_txt.gif';
	  
    }else{
      	sub2ID.style.display='block';
      	menu2ID.className='0';
    new Rico.Effect.FadeTo("TALKBG",0.85,50,4);
	  	document.logo01.src = 'http://mnib.info/image/mnib_logo.gif';
	  	document.hide01.src = 'http://mnib.info/image/hide_txt.gif';
    }
}

function menushow(menu){
    var menuID=document.getElementById('menu'+menu);
    var subID=document.getElementById('sub'+menu);
    if(menuID.className=='0'){
      	subID.style.display='none';
      	menuID.className='1';
 
    }else{
      	subID.style.display='block';
      	menuID.className='0';

    }
}

function getWHeight() {
  if (window.innerHeight) { return window.innerHeight; }
  if (document.body) { return document.body.clientHeight; }
}
function getWWidth() {
  if (window.innerWidth) { return window.innerWidth; }
  if (document.body) { return document.body.clientWidth; }
}

function change(num) {
  if (num==0) {
  document.img01.width = getWWidth();
  document.img01.height = 0.75*getWWidth();
  document.img01.style.visibility="visible";
//  document.swc01.style.visibility="visible";
  if (document.all) {                     // for Internet Explorer
    img01.style.position = "absolute";
    img01.style.posTop = (document.body.clientHeight - 0.75*document.body.clientWidth) / 2;
    //img01.style.posLeft = (document.body.clientWidth - img01.width) / 2;
  }
  else if (document.layers) {             // for Netscape Communicator 4.*
    img01 = document.layers["img1"].document.images["img01"];
    document.layers["img1"].top = (window.innerHeight - 0.75*window.innerWidth) / 2;
    //document.layers["img1"].left = (window.innerWidth - img01.width) / 2;
  }
  else if (document.getElementById) {     // for Netscape 6.*
    img01 = document.getElementById("img01");
    img01.style.position = "absolute";
    img01.style.top = (window.innerHeight - 0.75*window.innerWidth) / 2;
    //img01.style.left = (window.innerWidth - img01.width) / 2;  
  }
  } else if (num==1) {
  document.img01.width = getWWidth();
  document.img01.height = 0.75*getWWidth();
  if (document.all) {                     // for Internet Explorer
    img01.style.position = "absolute";
    img01.style.posTop = (document.body.clientHeight - 0.75*document.body.clientWidth) / 2;
    //img01.style.posLeft = (document.body.clientWidth - img01.width) / 2;
  }
  else if (document.layers) {             // for Netscape Communicator 4.*
    img01 = document.layers["img1"].document.images["img01"];
    document.layers["img1"].top = (window.innerHeight - 0.75*window.innerWidth) / 2;
    //document.layers["img1"].left = (window.innerWidth - img01.width) / 2;
  }
  else if (document.getElementById) {     // for Netscape 6.*
    img01 = document.getElementById("img01");
    img01.style.position = "absolute";
    img01.style.top = (window.innerHeight - 0.75*window.innerWidth) / 2;
    //img01.style.left = (window.innerWidth - img01.width) / 2;  
  }

  }
  }
  
  
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; }
}

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;
}
