//------------------------------------------------------------------------------
//        File:  common.js
//  Programmer:  common.js
//     Written:  08-11-2004
//     Revised:  04-29-2005
//------------------------------------------------------------------------------


//----- GLOBAL VARIABLES -------------------------------------------------------

var Default_image = 'blue_dot.gif'

var Main_first =    'index.htm'
var Main_last =     'main_disclaimer.htm'

var Current_first = 'ce_quiet1.htm'
var Current_last =  'ce_talk_radio.htm'

var Gory_first =    'gd_introduction.htm'
var Gory_last =     'gd_conclusion.htm'

var Misc_first =    'misc_agreement.htm'
var Misc_last =     'misc_complaint.htm'

var Jeffco_first =  'jeffco_failure.htm'
var Jeffco_last =   'jeffco_passing_the_buck.htm'

var Update_date = "11-19-2004"

var Button_bg_norm = "lightgrey";
var Button_bg_roll = "yellow";

var Mink_meeting_requests = 7;

var Screen_width = 1024

var Longest = "<B>The Gory Details</B>.";

var MainBgColor = "#ECEEED";

//----- CHECK_IF_FRAMED FUNCTION -----------------------------------------------
// This function checks if the top window is the same as the current window. 
// if it is, then this page was not arrived at from the index.htm frameset, 
// so force us there.  This function must be called from every htm page 
// except the one with with framesets - index.htm

function check_if_framed()
{

   if (top.location == location) 
   {
      top.location.href = "start.htm"
   }

   return
}
//----- GO FUNCTION ------------------------------------------------------------

function go(go_type, url) 
{
   var first_page = ''
   var last_page = ''
   var current_page = document.URL

   if(go_type == "Main")
   {
      first_page = Main_first;
      last_page = Main_last;
   }
   else if(go_type == "Current")
   {
      first_page = Current_first;
      last_page = Current_last;
   }
   else if(go_type == "Gory-Details")
   {
      first_page = Gory_first;
      last_page = Gory_last;
   }
   else if(go_type == "Misc")
   {
      first_page = Misc_first;
      last_page = Misc_last;
   }

   if(url.match("-- ") || current_page.match(url))
   {
      return
   }

   if(go_type == "Current" || go_type == "Gory-Details")
   {
      if(current_page.match(last_page) && url == first_page)
      {
         alert('You are currently viewing the LAST ' + go_type + ' page.' + '\n\n' + 'The FIRST ' + go_type + ' page will be dislayed.')
   
      }
      else if(current_page.match(first_page) && url == last_page)
      {
         alert('You are currently viewing the FIRST ' + go_type + ' page.' + '\n\n' + 'The LAST ' + go_type + ' page will be dislayed.')
      }
   }

   location=url

   return
}

//----- BUTTON_BAR FUNCTION ----------------------------------------------------
// <TD><IMG SRC="mm_fr.gif" BORDER=0></TD>
// <TD><IMG SRC="mm_play_r.gif" BORDER=0></TD>
// <TD><IMG SRC="mm_stop.gif" BORDER=0></TD>
// <TD><IMG SRC="mm_play_f.gif" BORDER=0></TD>
// <TD><IMG SRC="mm_ff.gif" BORDER=0></TD>

function button_bar(bar_type, first_url, prev_url, next_url, last_url, no_spin)
{

document.write("<TABLE class=std ALIGN=CENTER BORDER=0 CELLPADDING=2>")
document.write("<TR>")

//---------------------------------------------

if(no_spin == 1)
{
   document.write("<TD>")
   document.write("<A HREF=main_facts.htm><IMG SRC=no_spin_100.gif WIDTH=60 HEIGHT=60 BORDER=0></A>");
   document.write("</TD>")
}
else if(no_spin == 2)
{
   document.write("<TD>")
   document.write("<A HREF=main_facts.htm><IMG SRC=no_spin_100.gif WIDTH=100 HEIGHT=100 BORDER=0></A>");
   document.write("</TD>")
}

//---------------------------------------------

document.write("<TD>")
document.write("<FONT COLOR=lightslategray>");
document.write(bar_type);
document.write("</FONT>");
document.write("</TD>")

//---------------------------------------------

document.write("<TD>")
if(ie)
{
   document.write("<BR>");
}
document.write("<form onMouseover=\"change_button_color(event, '" + Button_bg_roll + "')\" onMouseout=\"change_button_color(event, '" + Button_bg_norm + "')\">");
//document.write("<form onMouseover=\"change_button_color(event, 'yellow')\" onMouseout=\"change_button_color(event, 'lime')\">");
document.write("<input class=initial2 type=button value='First' onclick=go('not_used','" + first_url + "')>")
document.write("</form>")
document.write("</TD>")

//---------------------------------------------

document.write("<TD>")
if(ie)
{
   document.write("<BR>");
}
document.write("<form onMouseover=\"change_button_color(event, '" + Button_bg_roll + "')\" onMouseout=\"change_button_color(event, '" + Button_bg_norm + "')\">");
document.write("<input class=initial2 type=button value='&#60;&#60;&nbsp;&nbsp;Prev' onclick=go('" + bar_type + "','" + prev_url + "')>")

document.write("</form>")
document.write("</TD>")

//---------------------------------------------

document.write("<TD>")
if(ie)
{
   document.write("<BR>");
}
document.write("<form onMouseover=\"change_button_color(event, '" + Button_bg_roll + "')\" onMouseout=\"change_button_color(event, '" + Button_bg_norm + "')\">");
document.write("<input class=initial2 type=button value='Home' onclick=go('" + bar_type + "','" + Main_first + "')>")
document.write("</form>")
document.write("</TD>")

//---------------------------------------------

document.write("<TD>")
if(ie)
{
   document.write("<BR>");
}
document.write("<form onMouseover=\"change_button_color(event, '" + Button_bg_roll + "')\" onMouseout=\"change_button_color(event, '" + Button_bg_norm + "')\">");
document.write("<input class=initial2 type=button value='Next&nbsp;&nbsp;&nbsp;&#62;&#62;' onclick=go('" + bar_type + "','" + next_url + "')>")
document.write("</form>")
document.write("</TD>")

//---------------------------------------------

document.write("<TD>")
if(ie)
{
   document.write("<BR>");
}
document.write("<form onMouseover=\"change_button_color(event, '" + Button_bg_roll + "')\" onMouseout=\"change_button_color(event, '" + Button_bg_norm + "')\">");
document.write("<input class=initial2 type=button value='Last' onclick=go('not_used','" + last_url + "')>")
document.write("</form>")
document.write("</TD>")

//---------------------------------------------

document.write("<TD>")
document.write("<FONT COLOR=lightslategray>");
document.write(bar_type);
document.write("</FONT>");
document.write("</TD>")

//---------------------------------------------

if(no_spin == 1)
{
   document.write("<TD>")
   document.write("<A HREF=main_facts.htm><IMG SRC=no_spin_100.gif WIDTH=60 HEIGHT=60 BORDER=0></A>");
   document.write("</TD>")
}
else if(no_spin == 2)
{
   document.write("<TD>")
   document.write("<A HREF=main_facts.htm><IMG SRC=no_spin_100.gif WIDTH=100 HEIGHT=100 BORDER=0></A>");
   document.write("</TD>")
}

//---------------------------------------------

document.write("</TR>")
document.write("</TABLE>")

return
}

//----- BUTTON_BAR FUNCTION ----------------------------------------------------
// <TD><IMG SRC="mm_fr.gif" BORDER=0></TD>
// <TD><IMG SRC="mm_play_r.gif" BORDER=0></TD>
// <TD><IMG SRC="mm_stop.gif" BORDER=0></TD>
// <TD><IMG SRC="mm_play_f.gif" BORDER=0></TD>
// <TD><IMG SRC="mm_ff.gif" BORDER=0></TD>

function XXX_button_bar(bar_type, first_url, prev_url, next_url, last_url)
{

document.write("<TABLE class=std ALIGN=CENTER BORDER=0 CELLPADDING=0>")
document.write("<TR>")

document.write("<TD>")
document.write("<FONT COLOR=lightslategray>");
document.write("&nbsp;" + bar_type + "&nbsp;");
document.write("</FONT>");
document.write("</TD>")

document.write("<TD>")

document.write("<TABLE class=std BGCOLOR=SILVER ALIGN=CENTER BORDER=1 CELLPADDING=0>")
document.write("<TR>")

document.write("<TD>")
document.write("<IMG src=mm_fr.gif onclick=go('not_used','" + first_url + "')>")
document.write("</TD>")

document.write("<TD>")
document.write("<IMG src=mm_play_r.gif onclick=go('" + bar_type + "','" + prev_url + "')>")
document.write("</TD>")

document.write("<TD>")
document.write("<IMG src=mm_stop.gif onclick=go('" + bar_type + "','" + Main_first + "')>")
document.write("</TD>")

document.write("<TD>")
document.write("<IMG src=mm_play_f.gif onclick=go('" + bar_type + "','" + next_url + "')>")
document.write("</TD>")

document.write("<TD>")
document.write("<IMG src=mm_ff.gif onclick=go('not_used','" + last_url + "')>")
document.write("</TD>")


document.write("</TR>")
document.write("</TABLE>")

document.write("</TD>")

document.write("<TD>")
document.write("<FONT COLOR=lightslategray>");
document.write("&nbsp;" + bar_type + "&nbsp;");
document.write("</FONT>");
document.write("</TD>")

document.write("</TR>")
document.write("</TABLE>")

return
}

//----- TOP_INTRO FUNCTION -----------------------------------------------------

function top_intro(
            left_image, left_width, left_height, left_border, jiggle_l,
            title_image, 
            right_image, right_width, right_height, right_border, jiggle_r)
{

//------------------

if(left_border == 0)
{
   left_class = ""
}
else
{
   left_class = "class=" + left_border;
}

//------------------

if(right_border == 0)
{
   right_class = ""
}
else
{
   right_class = "class=" + right_border;
}

//------------------

document.write("<TABLE class=std cellpadding=0 BORDER=0 WIDTH=90% ALIGN=CENTER>")
document.write("<TR>")

//------------------

document.write("<TD ALIGN=CENTER>")
document.write("<A HREF=index.htm>")
if(jiggle_l != -1)
{
   document.write("<span id='jiggle" + jiggle_l + "' class='jiggle'>");
}
document.write("<IMG BORDER=0 WIDTH=" + left_width + " HEIGHT=" + left_height + " SRC='" + left_image + "' " + left_class + ">");
if(jiggle_l != -1)
{
   document.write("</span>");
}
document.write("</A>")
document.write("</TD>")

//------------------

document.write("<TD ALIGN=CENTER>")
document.write("<TABLE class=std WIDTH=100%>")
var title_array = title_image.split(" ");
for(indx = 0 ; indx < title_array.length ; indx++)
{
   document.write("<TR><TD ALIGN=CENTER><A HREF=index.htm><IMG SRC='" + title_array[indx] + "' HSPACE=0 BORDER=0></A></TD></TR>")
}
document.write("</TABLE>")
document.write("</TD>")

//------------------

document.write("<TD ALIGN=CENTER>")
document.write("<A HREF=index.htm>");
if(jiggle_r != -1)
{
   document.write("<span id='jiggle" + jiggle_r + "' class='jiggle'>");
}
document.write("<IMG BORDER=0 WIDTH=" + right_width + " HEIGHT=" + right_height + " SRC='" + right_image + "' " + right_class + ">");
if(jiggle_r != -1)
{
   document.write("</span>");
}
document.write("</A>")
document.write("</TD>")

//------------------

document.write("</TR>")

document.write("<TR>")
document.write("<TD ALIGN=CENTER COLSPAN=3>")
motd()
document.write("</TD>")
document.write("</TR>")

//------------------

document.write("</TABLE>")

return
}

//----- WIDE_SCREEN FUNCTION ---------------------------------------------------

function wide_screen()
{
   if(screen.width > Screen_width)
   {
      return true;
   }

   return false;
}

//----- MOTD FUNCTION ----------------------------------------------------------

function motd()
{
   if(screen.width > Screen_width)
   {
      document.write("<IMG SRC='ft_good_neighbors_keep_their_noise_y25.gif' WIDTH=667 HEIGHT=53 BORDER=0>")
   }
   else
   {
      document.write("<IMG SRC='ft_good_neighbors_keep_their_noise_y20.gif' WIDTH=530 HEIGHT=49 BORDER=0>")
   }

   return
}

//----- CLASSIC_BATTLE FUNCTION ------------------------------------------------

function classic_battle()
{
   document.write("<H4 ALIGN=CENTER>The Classic Battle Between those who believe in Property Rights<BR>and those who act like The World is <U>THEIR</U> Playground</H4>")

   return
}

//----- COMPUTE_JD FUNCTION ----------------------------------------------------
// returns a julian day number for the passed year, month and day
// 12-18-2004

function compute_jd(c_year, c_month, c_day) 
{
   with (Math)
   {  
      GGG = 1;
      if (c_year <= 1585) GGG = 0;
      result = -1 * floor(7 * (floor((c_month + 9) / 12) + c_year) / 4);
      S = 1;
      if ((c_month - 9)<0) S=-1;
      A = abs(c_month - 9);
      J1 = floor(c_year + S * floor(A / 7));
      J1 = -1 * floor((floor(J1 / 100) + 1) * 3 / 4);
      result = result + floor(275 * c_month / 9) + c_day + (GGG * J1);
      result = floor(result + 1721027 + 2 * GGG + 367 * c_year - 0.5);
   }
   return result;
}

//----- DIFF_DAYS FUNCTION -----------------------------------------------------
// returns the number of days differece between the first set of day 
// elements and the seconds.  The first set is the lhs and the second set 
// is the rhs.
// 12-18-2004

function diff_days(start_year, start_month, start_day, 
                   prior_year, prior_month, prior_day)
{
   start_jd = compute_jd(start_year, start_month, start_day);
   prior_jd = compute_jd(prior_year, prior_month, prior_day);

   return(start_jd - prior_jd);
}

//----- DAYS_FROM_TODAY FUNCTION -----------------------------------------------
// returns the number of day from today, negative for days in the past.
// 12-18-2004
//
// Goofy, IE date year is actual 4 digit year, but Mozilla year is years 
// since 1900 (standard unix).
// 01-02-2005

function days_from_today(other_year, other_month, other_day)
{
   current = new Date();

   return(diff_days(
                    other_year, 
                    other_month, 
                    other_day,
                    current.getYear() < 1000 ? 
                       current.getYear() + 1900 : current.getYear(), 
                    current.getMonth() + 1, 
                    current.getDate()
                    ));
}


//----- UNCIVILIZED FUNCTION ---------------------------------------------------
// 2004-12-26

function uncivilized()
{

document.write("<TABLE class=std ALIGN=CENTER BORDER=0><TR>");

document.write("<TD><A HREF='main_cheating.htm'><IMG SRC='no_integrity_150t.gif' BORDER=0 WIDTH=150 HEIGHT=150></A></TD>");

document.write("<TD WIDTH=5></TD>");

document.write("<TD ALIGN=CENTER>");

document.write("<H4 ALIGN=CENTER>The entire human race is diminished by the Haskell's uncivilized behavior.</H4>");

document.write("<IMG SRC='worldmap.gif' BORDER=0 VSPACE=8 WIDTH=200 HEIGHT=106>");

document.write("<center>");
document.write("<B>Contributing to the population is not the same as contributing to society.</B>");
document.write("</center>");

document.write("</TD>");

document.write("<TD WIDTH=5></TD>");

document.write("<TD><A HREF='main_cheating.htm'><IMG SRC='no_integrity_150t.gif' BORDER=0 WIDTH=150 HEIGHT=150></A></TD>");

document.write("</TR></TABLE>");

return;

}

//----- RESPONSE_MINE FUNCTION -------------------------------------------------
// 2004-12-29

function response_mine()
{

document.write("<TABLE class=std BORDER=0 WIDTH=100%><TR><TD>");


document.write("<B>My response to the illegal <A class=main HREF=ce_illegal.htm>Excessive, Unnecessary and Unreasonable Noise</A> problem and loss of my backyard privacy has been:</B>");

document.write("<BR><BR>");

document.write("<UL>");
document.write("<LI>Publish this website.");
document.write("<LI>Measure the <A class=main HREF=ce_illegal.htm>playground noise levels</A> to determine if I had a valid complaint.");
document.write("</UL>");

document.write("</H4></TD>");

document.write("<TD WIDTH=5></TD>");

document.write("<TD><A HREF='gd_introduction.htm'><IMG SRC='snoopy_typing.jpg' class=silver WIDTH=90 HEIGHT=90></A></TD>");

document.write("</TR></TABLE>");

return;
}

//----- RESPONSE_YOURS FUNCTION ------------------------------------------------
// 2004-12-29

function response_yours()
{

document.write("<BR>");

document.write("<B>The 'other side' has resorted to threats, lies, distortions, theft, stalking, harassment and attempted destruction of property:</B>");

document.write("<BR><BR>");

document.write("<TABLE class=std BORDER=0 WIDTH=100%><TR>");

document.write("<TD>");

document.write("<UL>");

document.write("<TABLE class=std BORDER=0 ALIGN=RIGHT><TR><TD>");
document.write("<A HREF='ce_theory.htm'><IMG SRC='raid_bugs_250.gif' BORDER=0 HSPACE=5 WIDTH=250 HEIGHT=191></A>");
document.write("</TD></TR></TABLE>");

document.write("<LI><A class=main HREF=ce_attempted_arson.htm>Attacked my home</A>.");

document.write("<LI>Attempted Identity Theft.");

document.write("<LI>Made <A class=main HREF=gd_accusation.htm>false statements</A> to the police.");

document.write("<LI>Made <A class=main HREF=ce_web_of_lies.htm>false statements</A> under oath in County Court.");

document.write("<LI>Lied in a <A class=main HREF=ce_channel7.htm>Channel7 News</A> story,");

document.write("<LI>Sent me obscene material in the U.S. Mail.");

document.write("<LI>Emailed <A class=main HREF=ce_theory.htm>threatening messages</A> to my home and office.");

document.write("<LI>Threatened my immediate family.");

document.write("<LI>Emailed <A class=main HREF=ce_theory.htm>obscene messages</A> to my office (that id was never public)");

document.write("<LI>Placed flyers on cars with my name/number offering some type of sexual services.");

document.write("<LI><A class=main HREF=ce_trash.htm>Stolen items from my residential property</A> in broad daylight.");

document.write("</UL>");

document.write("</TD>");

document.write("</TR></TABLE>");

return;
}

//----- DISTURBING_THE_PEACE FUNCTION ------------------------------------------

function disturbing_the_peace()
{

document.write("<TABLE class=std BORDER=0 WIDTH=80% ALIGN=CENTER><TR>");

document.write("<TD ALIGN=RIGHT>");

document.write("<A HREF='main_faq.htm#SCREAMING_PROBLEM'><IMG SRC='lisa_150.jpg' class=silver WIDTH=150 HEIGHT=99></A>");

document.write("</TD>");

document.write("<TD ALIGN=CENTER>");

document.write("<A HREF='main_faq.htm#SCREAMING_PROBLEM'><IMG SRC='disturb_t.gif' BORDER=0 HSPACE=10 WIDTH=158 HEIGHT=67></A>");

document.write("</TD>");

document.write("<TD ALIGN=LEFT>");

document.write("<A HREF='main_faq.htm#SCREAMING_PROBLEM'><IMG SRC='lucy_150.jpg' class=silver WIDTH=150 HEIGHT=99></A>");

document.write("</TD>");

document.write("</TR></TABLE>");

}

//----- EVENT_DATE FUNCTION ----------------------------------------------------

function event_date(date_string)
{
   document.write("<TABLE class=std BORDER=0><TR>");

   document.write("<TD><IMG SRC=check_red.gif ALIGN=LEFT></TD>");

   document.write("<TD VALIGN=BOTTOM ><B><U>" + date_string + "</U></B></TD>");

   document.write("</TR></TABLE>");

   return;
}

//----- REFUSED FUNCTION -------------------------------------------------------

function refused()
{

document.write("<TABLE class=text_box CELLPADDING=10 BACKGROUND=fog.gif ALIGN=CENTER WIDTH=90%><TR><TD>");

document.write("<B>");

document.write("UPDATE:  The Jefferson County Sheriff's Department and the Jefferson County District Attorney have <A class=main HREF='jeffco_noise.htm'>refused to enforce</A> this clear and well written law on my behalf ???");

document.write("</B>");

document.write("</TD></TR></TABLE>");

   return;
}

//----- NOT_TRUE FUNCTION ------------------------------------------------------

function not_true(link_string)
{

document.write("<TABLE class=text_box WIDTH=175 BACKGROUND=fog.gif  CELLPADDING=0 BORDER=0>");

document.write("<TR><TD>");

document.write("<A HREF='" + link_string + "'><IMG SRC='strictly_enforced_175.jpg' BORDER=0 WIDTH=175 HEIGHT=138></A>");

document.write("</TD></TR>");

document.write("<TR><TD ALIGN=CENTER>");

document.write("<TABLE class=std BORDER=0 CELLPADDING=3><TR><TD ALIGN=CENTER>");
document.write("<B>Not True in Jefferson County, Colorado</B>");
document.write("</TD></TR></TABLE>");

document.write("</TD></TR>");

document.write("</TABLE>");

   return;
}

//----- IF_IE_ADD_BR FUNCTION --------------------------------------------------

function if_ie_add_br()
{
   if(ie)
   {
      document.write("<BR>");
   }

   return
}

//----- IF_NOT_IE_ADD_BR FUNCTION ----------------------------------------------

function if_not_ie_add_br()
{
   if(!ie)
   {
      document.write("<BR>");
   }

   return
}

//----- CHANGE_BUTTON_COLOR & JUMPTO2 FUNCTION ---------------------------------
// Specify optional button target: "_new" for new window, or name 
// of FRAME target (ie "myframe")   02-17-2005
//
// Rollover background-color button Script- © Dynamic Drive 
// (www.dynamicdrive.com)
// This notice must stay intact for use
// Visit http://www.dynamicdrive.com/ for full source code

var buttontarget=""

function change_button_color(e, color)
{
   var el = window.event ? event.srcElement : e.target
   if (el.tagName=="INPUT"&&el.type=="button")
   {
      el.style.backgroundColor=color
   }

   return;
}

function jumpto2(url)
{
   if (buttontarget=="")
   {
      window.location=url
   }
   else if (buttontarget=="_new")
   {
      window.open(url)
   }
   else
   {
      parent[buttontarget].location=url
   }

   return;
}

//----- SPACER_MENU FUNCTION ---------------------------------------------------

function spacer_menu()
{

   with(milonic=new menuname("tablespacer"))
   {
      style=tableSpacerStyle;
      alwaysvisible=1;
      top=0;
      left=0;
      position="relative";
      aI("text=" + Longest + ";type=header;");
   }
   drawMenus();		

   return;

}

//----- BOTTOM_MENU_IMAGE FUNCTION ---------------------------------------------

function bottom_menu_image()
{

document.write("<A TARGET='_blank' HREF='http://www.milonic.com/'><IMG SRC=gears1.gif BORDER=0 WIDTH=93 HEIGHT=70></A>");

return;
}

//----- BOTTOM_MENU_TABLE FUNCTION ---------------------------------------------

function bottom_menu_table(index_flag)
{

document.write("<TABLE BORDER=0 WIDTH=100%>");
document.write("<TR><TD ALIGN=CENTER>");

bottom_menu_image();

document.write("</TD></TR>");
document.write("<TR><TD ALIGN=CENTER>");

if(index_flag == true)
{
   counter_index();
}
else
{
   counter_pages();
}

document.write("</TD></TR>");
document.write("</TD></TR></TABLE>");

return;
}

//----- MENU_DIVIDER FUNCTION --------------------------------------------------

function menu_divider()
{

document.write("<TD ROWSPAN=2 WIDTH=1 BGCOLOR=LIGHTGREY></TD>");

return;
}

//----- IMAGE_EXPIRE FUNCTION --------------------------------------------------
// expiredate must be passed as mm/dd/yyyy

function image_expire(image_file, expiredate)
{
   var imagetag="<img src='" + image_file + "' BORDER=0>";
   var today=new Date()
   var expire=new Date(expiredate)
   if(today.getTime() <= expire.getTime())
   {
         document.write(imagetag)
   }
   return;
}


//------------------------------------------------------------------------------
