/**************************************************************************
** Contractible Headers script- © Dynamic Drive (www.dynamicdrive.com)
** This notice must stay intact for legal use. Last updated Oct 21st, 2003.
** Visit http://www.dynamicdrive.com/ for full source code
** Contractable vertical menu type
**************************************************************************/
//Enable saving state of content structure using session cookies? (on/off)
var enablepersist="on";
//Collapse previously open content when opening present? (yes/no)
var collapseprevious="yes";

if (document.getElementById)
{
	document.open();
   document.write('<style type="text/css">');
   document.write('.switchcontent{display:none;}');
   document.write('</style>');
   document.close();
}

function getElementbyClass(classname)
{
   ccollect=new Array();
   var inc=0;
   var alltags=document.all? document.all : document.getElementsByTagName("*");

   for (i=0; i<alltags.length; i++)
   {
      if (alltags[i].className==classname)
         ccollect[inc++]=alltags[i];
   }
}

function contractcontent(omit)
{
   var inc=0;

   while (ccollect[inc])
   {
      if (ccollect[inc].id!=omit)
         ccollect[inc].style.display="none";
      inc++;
   }
}

function expandcontent(cid)
{
   if (typeof ccollect!="undefined")
   {
      if (collapseprevious=="yes")
         contractcontent(cid);
      document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none";
   }
}

function revivecontent()
{
   contractcontent("omitnothing");
   selectedItem=getselectedItem();
   selectedComponents=selectedItem.split("|");

   for (i=0; i<selectedComponents.length-1; i++)
      document.getElementById(selectedComponents[i]).style.display="block";
}

function get_cookie(Name)
{
   var search = Name + "=";
   var returnvalue = "";

   if (document.cookie.length > 0)
   {
      offset = document.cookie.indexOf(search);

      if (offset != -1)
      {
         offset += search.length;
         end = document.cookie.indexOf(";", offset);

         if (end == -1)
            end = document.cookie.length;
         returnvalue=unescape(document.cookie.substring(offset, end));
      }
   }
   return returnvalue;
}

function getselectedItem()
{
   if (get_cookie(window.location.pathname) != "")
   {
      selectedItem=get_cookie(window.location.pathname);
      return selectedItem;
   }
   else
      return "";
}

function saveswitchstate()
{
   var inc=0, selectedItem="";

   while (ccollect[inc])
   {
      if (ccollect[inc].style.display=="block")
         selectedItem+=ccollect[inc].id+"|";
      inc++
   }

   document.cookie=window.location.pathname+"="+selectedItem;
}

function do_onload()
{
   getElementbyClass("switchcontent");

   if (enablepersist=="on" && typeof ccollect!="undefined")
      revivecontent();
}

if (window.addEventListener)
   window.addEventListener("load", do_onload, false);
else if (window.attachEvent)
   window.attachEvent("onload", do_onload);
else if (document.getElementById)
   window.onload=do_onload;

if (enablepersist=="on" && document.getElementById)
   window.onunload=saveswitchstate;


function openCannonsWindow(url, percentWidth, percentHeight, yAxis, xAxis)
{
	var windowHeight = screen.availHeight * percentHeight;
	var windowWidth = screen.availWidth * percentWidth;
	window.open(url,
	            "_blank",
	            "status=yes,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,width=" +
	            windowWidth +
	            ",height=" +
	            windowHeight +
	            ",left="+
	            xAxis +
	            ",top="+
	            yAxis);
}

function poweredBy()
{
   document.open();
   document.writeln('<p class="PWDbody_center">Powered by');
   document.writeln('<a href="javascript:openCannonsWindow(\'http://www.pintailwebdesigns.com\',0.8,0.5,10,10)" class="image">');
   document.writeln('<br><img src="images/pwdscript_transparent_11_logo2.gif" width="108" border="0" height="54" alt="Powered by Pintail Web Designs. Visit our site : http://www.pintailwebdesigns.com"></img></a>');
   document.writeln('<br>~Visit Us ~<br>~ Click Logo~<br>');
   document.writeln('<br>');
   document.writeln('<a href="mailto:handypc@gmail.com" title="Email link to Outdoor Web Designs" class="body1">~ Outdoor Web Designs ~<br>Email Link</a></p>');
   document.close();
}

function mossyoaklogo2A()
{
   // return "<a href=\"http://www.mossyoak.com/\" target=\"_blank\"><img border=\"0\" width=\"75\" height=\"50\" src=\"images/mossyoaklogo.gif\" valign=\"middle\" align=\"center\" alt=\"ShadowGrass&#174; is a registered camouflage pattern of the Mossy Oak Company and is used by permission here. Visit the Mossy Oak website by clicking their logo\"></img></a>";
   return "";
}

function convertMonth(mon)
{
	mon = mon.toLowerCase();
	if ( mon == "january" || mon == "jan" || mon == "1" )
	   return 0;
	else if ( mon == "february" || mon == "feb" || mon == "2" )
	   return 1;
	else if ( mon == "march" || mon == "mar" || mon == "3" )
	   return 2;
	else if ( mon == "april" || mon == "apr" || mon == "4" )
	   return 3;
	else if ( mon == "may" || mon == "may" || mon == "5" )
	   return 4;
	else if ( mon == "june" || mon == "jun" || mon == "6" )
	   return 5;
	else if ( mon == "july" || mon == "jul" || mon == "7" )
	   return 6;
	else if ( mon == "august" || mon == "aug" || mon == "8" )
	   return 7;
	else if ( mon == "september" || mon == "sep" || mon == "9" )
	   return 8;
	else if ( mon == "october" || mon == "oct" || mon == "10" )
	   return 9;
	else if ( mon == "november" || mon == "nov" || mon == "11" )
	   return 10;
	else if ( mon == "december" || mon == "dec" || mon == "12" )
	   return 11;
	/** must return something **/
	else
		return 0;
}

function getDayString(dy)
{
   switch (dy)
   {
      case 0: return "Sunday";
      case 1: return "Monday";
      case 2: return "Tuesday";
      case 3: return "Wednesday";
      case 4: return "Thursday";
      case 5: return "Friday";
      case 6: return "Saturday";
   }
}

/**********************************************/
/** Add last modification date from document **/
/**********************************************/
function pintailModified()
{
 	var substitute = modDateArray[1].toString();

	if ( substitute == undefined )
	   // supply some value or error occurs
	   substitute = "1";

	var modDate = new Date(modDateArray[0], convertMonth(substitute), modDateArray[2]);
	var yr = modDate.getFullYear();
	var mon = modDate.getMonth() + 1;
	var dy = modDate.getDate();
	document.write( '<p class="fsx03" align="center"><small>Page last modified: <br>');
	document.write(getDayString(modDate.getDay()) + ', ' + mon + '/' + dy + '/' + yr);
	document.write('</small></p>');
}

function writeOutdoorz()
{
	document.open();
	document.writeln('<p class="dfltt34ptB">OUTDOOR-Z.COM</p>');
	document.close();
}

var emailArray0 = new Array();
emailArray0[0] = "linkimages/emaillinktotomcannon.gif";
emailArray0[1] = "linkimages/emaillinktotomcannon_start.gif";
var menuImg0 = new Array();
for ( var cnt = 0; cnt < emailArray0.length; cnt++ )
{
   menuImg0[cnt] = new Image;
   menuImg0[cnt].src = emailArray0[cnt];
}

var emailArray1 = new Array();
emailArray1[0] = "linkimages/1tanpixel.gif";
emailArray1[1] = "linkimages/emaillinktotomcannon2.gif";
var menuImg1 = new Array();
for ( var cnt = 0; cnt < emailArray1.length; cnt++ )
{
   menuImg1[cnt] = new Image;
   menuImg1[cnt].src = emailArray1[cnt];
}
