//------------------------------------------------------------------------------
//        File:  common.js
//  Programmer:  common.js
//     Written:  08-11-2004
//     Revised:  12-30-2006
//------------------------------------------------------------------------------


//----- GLOBAL VARIABLES -------------------------------------------------------

var CheckFmpFlag = false;

var Default_image = 'blue_dot.gif'

var Main_first =    'index.php'
var Main_last =     'main_disclaimer.php'

var Current_first = 'ce_quiet1.php'
var Current_last =  'ce_wmd.php'

var Gory_first =    'gd_introduction.php'
var Gory_last =     'gd_conclusion.php'

var Misc_first =    'misc_navigate.php'
var Misc_last =     'misc_complaint.php'

var Jeffco_first =  'jeffco_failure.php'
var Jeffco_last =   'jeffco_passing_the_buck.php'

var Soapbox_first =  'soapbox_mha.php'
var Soapbox_last =   'soapbox_in_the_bag.php'

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";

//----- 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>
//
// removed no_spin input parm, but left code in place to use it again.

function button_bar(bar_type, first_url, prev_url, 
                    next_url, last_url, direction_flag)
{

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.php><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.php><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("<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>")

//---------------------------------------------
// this section toggles between the HideMenu and ShowMenu buttons.  
// Note that the onClick event is set to set the cookie AND to 
// set the window.location.  The SetCookie() function also does 
// the window.location setting too.  Don't remove it, for some 
// weird reason, it's needed in both places, else this will not work:  
// Be at the top of the page and select the bottom of the page from 
// the menu or the button.  Then toggle the menu Hide/Show, this 
// works, but does not work if the window.location= is set here 
// and in SetCookie().  gkerber 05018-2005
//---------------------------------------------

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 + "')\">");
var menu_setting = get_menu_setting();
if(menu_setting == 0)   // show menu
{
   document.write("<input class=initial2 type=button value='Show Menu' onClick=\"SetCookie('fmp_show_menu','1',exp);window.location=this_page\">");
   //document.write("<input class=initial2 type=button value='Show Menu' onClick=\"SetCookie('fmp_show_menu','1',exp);window.location.reload();\">");
}
else if(menu_setting == 1)
{
   document.write("<input class=initial2 type=button value='Hide Menu' onClick=\"SetCookie('fmp_show_menu','0',exp);window.location=this_page\">");
   //document.write("<input class=initial2 type=button value='Hide Menu' onClick=\"SetCookie('fmp_show_menu','0',exp);window.location.reload();\">");
}
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='Email' onclick='emailFMP()'>");
document.write("</form>")
document.write("</TD>")
*/

//---------------------------------------------

/*
if(screen.width >= 1024)  // !!! turned off
{
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 + "')\">");
if(direction_flag == 1)   // for the top button bar
{
document.write("<input class=initial2 type=button value='Bottom' onclick=go('" + bar_type + "','" + this_page + "#END_OF_PAGE')>")
}
else if(direction_flag == 2)   // for the bottom button bar
{
document.write("<input class=initial2 type=button value='Top' onclick=go('" + bar_type + "','" + this_page + "#TOP_OF_PAGE')>")
}

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.php><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.php><IMG SRC=no_spin_100.gif WIDTH=100 HEIGHT=100 BORDER=0></A>");
   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, 
            motd_flag, 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.php>")
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.php><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.php>");
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>")
if(motd_flag == "1")
{
   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.php'><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 Mercers 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 [over] 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.php'><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.php>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.php>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.php'><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.php'><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.php>Attacked my home</A>.");
document.write("<LI><A class=main HREF=gd_stoned1.php>Stoned my home twice</A>.");

document.write("<LI>Attempted Identity Theft.");

document.write("<LI>Made <A class=main HREF=gd_accusation.php>false statements</A> to the police.");

document.write("<LI>Made <A class=main HREF=ce_web_of_lies.php>false statements</A> under oath in County Court.");

document.write("<LI>Lied in a <A class=main HREF=ce_channel7.php>Channel7 News</A> story,");

document.write("<LI>Sent me obscene material in the U.S. Mail.");
document.write("<LI>Threw obscene material on my property.");

document.write("<LI>Emailed <A class=main HREF=ce_theory.php>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.php>obscene messages</A> to my private unpublished office email account.");

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.php>Stolen items from my residential property</A> in broad daylight.");
document.write("<LI><A class=main HREF=main_news.php#2006_05_21>Stolen items from my residential property</A> after midnight in full view of my security cameras.");

document.write("</UL>");

document.write("<H4>");
document.write("Threats, accusations and name-calling in a neighborhood conflict is the weapon of people with little defense for their selfish behaviors.");
document.write("</H4>");

document.write("</TD>");

document.write("</TR></TABLE>");

return;
}

//----- DISTURBING_THE_PEACE FUNCTION ------------------------------------------

function disturbing_the_peace(img_file, img_width, img_height)
{

document.write("<TABLE class=std BORDER=0 ALIGN=CENTER><TR>");

document.write("<TD ALIGN=RIGHT>");

document.write("<A HREF='main_faq.php#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.php#SCREAMING_PROBLEM'><IMG SRC='" + img_file + "' BORDER=0 HSPACE=25 WIDTH=" + img_width + " HEIGHT=" + img_height + "></A>");

document.write("</TD>");

document.write("<TD ALIGN=LEFT>");

document.write("<A HREF='main_faq.php#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.php'>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()
{

   if(get_menu_setting() == 1)
   {
      with(milonic=new menuname("tablespacer"))
      {
         style=tableSpacerStyle;
         alwaysvisible=1;
         top=0;
         left=0;
         position="relative";
         aI("text=" + Longest + ";type=header;");
      }
   }

   return;

}

//----- BOTTOM_MILONIC FUNCTION ------------------------------------------------

function bottom_milonic()
{

document.write("<CENTER>");
document.write("<FONT COLOR=WHITE>");
document.write("<A target=_blank class=white_link_color HREF='http://www.milonic.com'/>DHTML Menu by Milonic</A>");
document.write("</FONT>");
document.write("</CENTER>");

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()
{

if(get_menu_setting() == 1)
{
   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>");
   
   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;
}

//----- POPUP_IMAGE FUNCTION ---------------------------------------------------
// Notes:  This script and many more are available free online at
//         The JavaScript Source!! http://javascript.internet.com
//
//         2005-05-13  I had trouble combining all the functions back into 
//         one function where it would sometimes take more than one mouse 
//         click to make it open the window.
//
//  <A HREF="javascript:popup_image('large.jpg')">xxx</A>
//------------------------------------------------------------------------------

function popup_image(img)
{
   foto1= new Image();
   foto1.src=(img);
   Controlla(img);
}

function Controlla(img)
{
   if((foto1.width!=0)&&(foto1.height!=0))
   {
      viewFoto(img);
   }
   else
   {
      funzione="Controlla('"+img+"')";
      intervallo=setTimeout(funzione,20);
   }
}

function viewFoto(img)
{
   largh=foto1.width+20;
   altez=foto1.height+20;
   stringa="width="+largh+",height="+altez;
   finestra=window.open(img,"",stringa);
}

//----- MOUSEOVER_ARROW FUNCTIONS ----------------------------------------------
// Original:  (mrenner@rst.de) 
// 
// <img name="pic1" SRC="blank.gif" width=10 height=10 border=0>  
// <A HREF="http://altavista.digital.com" 
//    onMouseOver="imgover(pic1)" onMouseOut="imgout(pic1)">Altavista</A>

/*
function imgover(imgname){
imgname.src = "arrow_red.gif"
}
function imgout(imgname){
imgname.src = "blank.gif"
}
*/

//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
//        File:  fmp_cookie.js
//  Programmer:  George Kerber
//     Written:  05-06-2005
//     Revised:  08-05-2005
//    Original:  Mattias Sjoberg
//    This script and many more are available free online at
//    The JavaScript Source!! http://javascript.internet.com
//------------------------------------------------------------------------------


//----- GLOBAL VARIABLES -------------------------------------------------------

var expDays = 30;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

//----- CHECK_FMP FUNCTION -----------------------------------------------------

function check_fmp()
{
   //alert("CheckFmpFlag = [" + CheckFmpFlag + "]");

   if(CheckFmpFlag == true)
   {
      var fmp = GetCookie('T45gH54rR82.6');

      //alert("fmp = [" + fmp + "]");

      if(fmp == null) 
      {
         //alert("null");
         window.location = "http://www.sage.com/404"
      }

      if(fmp == "t45gH51gqp15tn4rR820")
      {
         //alert("bad ip");
         window.location = "http://www.sage.com/404"
      }

      if(fmp != "t45gH51gqpl5tn4rR82O")
      {
         //alert("!= good ip");
         window.location = "http://www.sage.com/404"
      }
   }

   return;
}

//----- GET_MENU_SETTING FUNCTION ----------------------------------------------

function get_menu_setting()
{
   var user_menu_setting = GetCookie('fmp_show_menu');
   if (user_menu_setting == null) 
   {
      if(screen.width > Screen_width)
      {
         user_menu_setting = 1;
      }
      else
      {
         user_menu_setting = 0;
      }
      SetCookie('fmp_show_menu', user_menu_setting, exp);
   }
   return user_menu_setting;
}

//----- GETCOOKIEVAL FUNCTION --------------------------------------------------

function getCookieVal (offset) 
{
   var endstr = document.cookie.indexOf (";", offset);  
   if (endstr == -1)    
   {
      endstr = document.cookie.length;  
   }
   return unescape(document.cookie.substring(offset, endstr));
}

//----- GETCOOKIE FUNCTION -----------------------------------------------------

function GetCookie (name) 
{
   var arg = name + "=";  
   var alen = arg.length;  
   var clen = document.cookie.length;  
   var i = 0;  
   while (i < clen) 
   {
      var j = i + alen;    
      if (document.cookie.substring(i, j) == arg)      
      {
         return getCookieVal (j);    
      }
      i = document.cookie.indexOf(" ", i) + 1;    
      if (i == 0) 
      {
         break;   
      }
   }  
   return null;
}

//----- SETCOOKIE FUNCTION -----------------------------------------------------

function SetCookie (name, value, expires) 
{
   var argv = SetCookie.arguments;  
   var argc = SetCookie.arguments.length;  
   var expires = (argc > 2) ? argv[2] : null;  
   var path = (argc > 3) ? argv[3] : null;  
   var domain = (argc > 4) ? argv[4] : null;  
   var secure = (argc > 5) ? argv[5] : false;  
   document.cookie = name + "=" + escape (value) + 
   ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
   ((path == null) ? "" : ("; path=" + path)) +  
   ((domain == null) ? "" : ("; domain=" + domain)) +    
   ((secure == true) ? "; secure" : "");
   window.location=this_page;   // see notes in button_bar for Show/Hide
   return;
}

//----- DELETECOOKIE FUNCTION --------------------------------------------------

function DeleteCookie (name) 
{
   var exp = new Date();  
   exp.setTime (exp.getTime() - 1);  
   var cval = GetCookie (name);  
   document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

//----- EMAILFMP FUNCTION ------------------------------------------------------
// 2005-05-18  from  http://redvip.homelinux.net/varios/mailto.html

function emailFMP() 
{
  var subject = "FeelMyPain.net - A Neighbor From Hell (NFH)";
  var body = 
  "\nHi,\n\nJust imagine, you move into your new house and then your new neighbors, Jeff and Donna Mercer put a HUGE God-awful eyesore trampoline and swing set only 8 feet from your house. The slide platform towers over the 6 foot privacy fence, facing directly into your new back yard.\n\n" +

  "Many days and evenings, their usually loud children scream and shriek only 8 feet from your bedroom wall. The high pitched ear-piercing, bone-jarring, blood-curdling, spine-tingling screaming and screeching reflects off their 2 story home directly into your home and backyard.  You can't use your backyard and you can't even have your windows open...\n\n" + 

  "Read the rest of the sad story @ http://www.feelmypain.net";

  var doc = "mailto:" + 
      "?subject=" + escape(subject) + 
      "&body=" + escape(body); 

  window.location = doc;    // POP UP EMAIL MESSAGE WINDOW
}

//------------------------------------------------------------------------------

