function showmyinfo()
{
  document.getElementById('time').style.setAttribute("width","900px");
  document.getElementById('time').style.setAttribute("height","43px");
  document.getElementById('time').style.setAttribute("backgroundColor","#1770AD");
  if(loggedin==1)
  {
    var loggedinmsg="You are logged in";
  }
  else
  {
    var loggedinmsg="You are not logged in.";
  }
  var myinfo="<table cellspacing=0 cellpadding=0 width=100%><tr><td width=140 valign=top><a href='javascript:hidemyinfo();'><img border=0 src=images/myinfo.gif></img></a><br>"+speedinfo+"</td><td valign=top><table cellspacing=0 cellpadding=0 width=100% border=1 bordercolor=#FFFFFF><tr><td align=left><font size=2>IP:"+ip+"<br>Speed:"+kbs+"kbs</font></td><td>"+loggedinmsg+"</td></tr></table></td></tr></table>";
  document.getElementById('time').setAttribute("innerHTML",myinfo);
}
function hidemyinfo()
{
  document.getElementById('time').style.setAttribute("width","300px");
  document.getElementById('time').style.setAttribute("height","20px");
  document.getElementById('time').style.setAttribute("backgroundColor","");
  document.getElementById('time').setAttribute("innerHTML","<table cellspacing=0 cellpadding=0 width=100%><tr><td valign=top width=140><a href='javascript:showmyinfo();'><img border=0 src=images/myinfo.gif></img></a><br>"+speedinfo+"</td><td valign=top></td></tr></table>");

}
function printme()
{
  var generator=window.open('','_blank','toolbar=yes,height=600,width=800,resizable=yes,scrollbars=yes,menubar=yes');
  if(browser=="ie")
  {
    var gencontent=document.getElementById("content").getAttribute("innerHTML");
    gencontent=gencontent.replace('<IMG src="images/print.png" border=0><BR>Print','');
    generator.document.write("<link rel='stylesheet' type='text/css' href='style.css' /><font size=1.5>"+document.location.href+"</font><br><br>"+gencontent);
  }
  else
  {
    var gencontent=document.getElementById("content").innerHTML;
    gencontent=gencontent.replace('<IMG src="images/print.png" border=0><BR>Print','');
    generator.document.write("<link rel='stylesheet' type='text/css' href='style.css' /><font size=1.5>"+document.location.href+"</font><br><br>"+gencontent);
  }
}
function linkclick(url,name)
{
  ajax_url='functions.inc.php?ajax_link_hit=1&url='+url+'&name='+name;
  globalurl=url;
  var xmlhttp=false;
  try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (E) {
    xmlhttp = false;
   }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  xmlhttp.open("GET",ajax_url,true);
  xmlhttp.onreadystatechange = function() {
	if(xmlhttp.readyState == 4){
         // document.getElementById("debug").setAttribute("innerHTML",xmlhttp.responseText);
         window.open("http://"+globalurl);
       }
 }
  xmlhttp.send(null);
}

function cal_view()
{
  var month=document.getElementById("ajax_cal_select_month").getAttribute("value");
  var year=document.getElementById("ajax_cal_select_year").getAttribute("value");
  document.location.href="http://new.frankenmuth.org/index.php?show_calendar=1&page_id=23&month="+month+"&year="+year;
}

function cal_monthview()
{
  var month=document.getElementById("ajax_cal_select_month").getAttribute("value");
  var year=document.getElementById("ajax_cal_select_year").getAttribute("value");
  document.location.href="http://new.frankenmuth.org/index.php?show_calendar=1&page_id=6&month="+month+"&year="+year+"&monthview=1";
}

function scroll()
{
 //alert("scroll event detected! "+window.pageXOffset+" "+window.pageYOffset+" "+document.documentElement.scrollTop+" "+document.documentElement.scrollLeft+" "+document.body.scrollHeight+" "+document.body.scrollWidth+" "+document.body.clientHeight+" "+document.body.clientWidth);
 
 if(document.documentElement.scrollTop>233)
 {
   if(browser=="ie")
   {
     //document.getElementById("backtotop").style.setAttribute("top",(0));
     document.getElementById("backtotop").style.setAttribute("display","");
   }
   else
   {
     //document.getElementById("backtotop").style.setProperty("top",(0)+"px",null);
     document.getElementById("backtotop").style.setProperty("display","",null);
   }
 }
 else
 {
   if(browser=="ie")
   {
     //document.getElementById("backtotop").style.setAttribute("top",(0));
     document.getElementById("backtotop").style.setAttribute("display","none");
   }
   else
   {
     //document.getElementById("backtotop").style.setProperty("top",(0)+"px",null);
     document.getElementById("backtotop").style.setProperty("display","none",null);
   }
 }
 // note: you can use window.innerWidth and window.innerHeight to access the width and height of the viewing area
}
function replaceAll(text, strA, strB)
{
    while ( text.indexOf(strA) != -1)
    {
        text = text.replace(strA,strB);
    }
    return text;
}