function go_crazy(e,mesg,c){
  m=document.getElementById?document.getElementById(e):document.all?document.all[e]:document.layers[e]
  m.filters[0].enabled = true;
  m.filters[0].Apply();
  m.filters[0].Play();
  mtype3(e,mesg,c);
  if(m.style.visibility=='visible') m.style.visibility='hidden'
  else m.style.visibility='visible';
}
function s_h(e,n){
  o=document.getElementById?document.getElementById(e).style:document.all?document.all[e].style:document.layers[e]
  if(n) o.visibility='visible';
  else  o.visibility='hidden';
}
var xvar,yvar
function text_size(){
  m=document.getElementById?document.getElementById('content_0'):document.all?document.all['content_0']:document.layers['content_0']
  xvar=parseInt(m.currentStyle.fontSize)
}
function textmod(c){
  text_size();
  switch(c){
	case 0:
	  xvar-=1;
	  break;
	case 1:
	  xvar+=1;
	  break;
	case 2:
	  xvar=9;
	  break;
	default:
	  break;
  }
  if(xvar>=1 && xvar<=20){
	for(i=0; i<ms.scrollables; i++){
	  m=document.getElementById?document.getElementById('content_'+i):document.all?document.all['content_'+i]:document.layers['content_'+i]
	  m.style.fontSize=xvar+"px";
	}
  }
}
function iLoad(e,n){
  iXLoad();
  o=document.getElementById?document.getElementById('t_'+e).style:document.all?document.all['t_'+e].style:document.layers['t_'+e]
  if(n)o.visibility='visible';
  else o.visibility='hidden';
}
function iL(e,n){
  o=document.getElementById?document.getElementById(e).style:document.all?document.all[e].style:document.layers[e]
  if(n)o.visibility='visible';
  else o.visibility='hidden';
}
function iXLoad(){
  for(i=0; i<=9; i++){
	o=document.getElementById?document.getElementById('t_'+i).style:document.all?document.all['t_'+i].style:document.layers['t_'+i]
	o.visibility='hidden';
  }
}
function hp(){
  this.style.behavior='url(#default#homepage)';this.setHomePage('http://macarius.net');
}
function mtype1(f,t,x){
  text_size();
  e=document.getElementById?document.getElementById(f):document.all?document.all[f]:document.layers[f]
  if(t=='')e.innerHTML=''
  else e.innerHTML=t+' | [content: '+xvar+'px] | hotkey \''+x+'\'' 
}
function mtype2(f,t){
  e=document.getElementById?document.getElementById(f):document.all?document.all[f]:document.layers[f]
  e.innerHTML=t
}
function mtype3(f,t,c){
  e=document.getElementById?document.getElementById(f):document.all?document.all[f]:document.layers[f]
  e.innerHTML=t
  e.style.color=c
}
var cnt_p;
pos=new Array(0,1,2,3,4,5,6,7,8,9);
function shift(n){
  if(n){
	if(cnt_p>=pos.length-1){xp(0)}
	else{xp(pos[cnt_p+1])}
  }
  else if(!n){
	if(cnt_p<=0){xp(pos[pos.length-1])}
	else{xp(pos[cnt_p-1])}
  }
}
function xp(t){
  s_h('content_3',0);
  e=document.getElementById?document.getElementById('content_title_3'):document.all?document.all['content_title_3']:document.layers['content_title_3']
  if(document.body.currentStyle.backgroundColor=='#ffffff'){
	parent.frames['c_frame'].location='html/blank.FFF.html';
  }
  else if(document.body.currentStyle.backgroundColor=='#000000'){
	parent.frames['c_frame'].location='html/blank.000.html';
  }
  switch(t){
	case 0:
	  cnt_p=0
	  now=new Date();
	  days=new Array('sunday','monday','tuesday','wednesday','thursday','friday','saturday');
	  months=new Array('01','02','03','04','05','06','07','08','09','10','11','12');
	  date=((now.getDate()<10)?'0':'')+now.getDate();
	  function digit(number){return (number<1000)?number+1900:number;}
	  today=days[now.getDay()]+' | '+months[now.getMonth()]+'.'+date+'.'+(digit(now.getYear()));
	  mtype2('content_title_0',today);
	  ms.swapTo(0);
	  break;
	case 1:
	  cnt_p=1
	  ms.swapTo(1);
	  break;
	case 2:
	  cnt_p=2
	  ms.swapTo(7);
	  break;
	case 3:
	  cnt_p=3
	  ms.swapTo(2);
	  break;
	case 4:
	  cnt_p=4
	  if(document.body.currentStyle.backgroundColor=='#ffffff'){parent.frames['c_frame'].location='ramblings.of/index.html';}
	  else if(document.body.currentStyle.backgroundColor=='#000000'){parent.frames['c_frame'].location='ramblings.of/index.html';}
	  e.style.color='#2a4d6f'
	  e.innerHTML='ramblings.of.macarius.net'
	  ms.swapTo(3);
	  s_h('content_3',1);
	  break;
	case 5:
	  cnt_p=5
	  if(document.body.currentStyle.backgroundColor=='#ffffff'){parent.frames['c_frame'].location='about:blank';e.style.color='#BBBBBB';}
	  else if(document.body.currentStyle.backgroundColor=='#000000'){parent.frames['c_frame'].location='about:blank';e.style.color='#999999';}
	  e.innerHTML='pictures::coming soon'
	  ms.swapTo(3);
	  s_h('content_3',1);
	  break;
	case 6:
	  cnt_p=6
	  ms.swapTo(5);
	  break;
	case 7:
	  cnt_p=7
	  ms.swapTo(6);
	  break;
	case 8:
	  cnt_p=8
	  ms.swapTo(4);
	  break;
	case 9:
	  cnt_p=9
	  if(document.body.currentStyle.backgroundColor=='#ffffff'){parent.frames['c_frame'].location='html/email.FFF.html';e.style.color='#BBBBBB';}
	  else if(document.body.currentStyle.backgroundColor=='#000000'){parent.frames['c_frame'].location='html/email.000.html';e.style.color='#999999';}
	  e.innerHTML='contact form'
	  ms.swapTo(3);
	  s_h('content_3',1);
	  break;
	default:
	  break;
  }
}
function getDocHeight(doc){
  var docHt = 0, sh, oh;
  if (doc.height) docHt=doc.height;
  else if (doc.body){
    if (doc.body.scrollHeight) docHt=sh=doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt=oh=doc.body.offsetHeight;
    if (sh && oh) docHt=Math.max(sh, oh);
  }
  return docHt;
}
function setIframeHeight(name){
  var wind = window.frames[name];
  var elmt = document.getElementById? document.getElementById(name): document.all? document.all[name]: null;
  if (elmt && wind){
    elmt.style.height = "auto";
    var docHt = getDocHeight(wind.document);
    if (docHt) elmt.style.height=docHt+"px";
    o=document.getElementById?document.getElementById('content_3'):document.all?document.all['content_3']:document.layers['content_3']
    o.style.height=docHt+"px";
    ms.rambFx();
  }
}
function loadIframe(x,y){
  if (window.frames[x]){
    window.frames[iframeName].location=y;
    return false;
  }
  else return true;
}
var win_top=(top==self);
if(!win_top) top.location.href='http://macarius.net';
var VBS=false;
function p_print(){
	if (window.print) window.print();
	else alert('Sorry, this function does not work in your browser.\n\nm a c a r i u s | b r o w n f i e l d');
}
function scroll_x(n){
	o=document.getElementById?document.getElementById('scroll_bar'):document.all?document.all['scroll_bar']:document.layers['scroll_bar']
	if(n) high(o);
	else low(o);
}
function high(e) {
  o=e
  light=setInterval("hit(o)",10)
}
function low(e) {
  clearInterval(light)
  e.filters.alpha.opacity=50
}
function hit(e) {
  if(e.filters.alpha.opacity<100)
	e.filters.alpha.opacity+=10
  else if(window.light)
	clearInterval(light)
}
function mod_cap(e,w){
  o=document.getElementById?document.getElementById(e):document.all?document.all[e]:document.layers[e]
  o.innerHTML=w;
}
function oops(){
  alert('From the "Release Notes for Internet Explorer 7":\n\n\tView Source--The view-source protocol no longer works in Internet Explorer 7.\n\nSorry, you have to revert to [Alt]-[V]-[C].');
}