// canManipulateImages - check if the browser we're using can do
// clever stuff with document images.
function canManipulateImages() {
	if (document.images)
		return true;
	else
		return false;
}
// loadPosterImage
function loadPosterImage(imageURL, imageURL2, imgtext) {
	if (gImageCapableBrowser) {
		document.imagePoster.src = imageURL;
		imagename = imageURL2;
		desctext = imgtext;
		return false;
	}
	else {
		return true;
	}
}

// gImageCapableBrowser - is this browser hip to images? Set up
// a global variable so that we don't have to keep calling a function
// (useful if the function becomes costly to compute).
gImageCapableBrowser = canManipulateImages();

// Copyright 1999 - 2002 by Ray Stott, Pop-up Images Script ver 2.0
// OK to use if this copyright is included
// Script is available at http://www.crays.com/jsc

var pic = null
var popImg = null  // use this when referring to pop-up image
var picTitle = null
var imgCount = 0
var imgWinName = "popImg"

function openPopImg(picName, windowTitle, windowWidth, windowHeight){
  closePopImg()
  picTitle = windowTitle
  imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
  popImg = window.open(picName, imgWinName,
           "toolbar=no,scrollbars=no,resizable=no,status=no,width=765"
           + (parseInt(windowWidth)+20)  + ",height=515"
           + (parseInt(windowHeight)+15))
  }
function closePopImg(){    // close pop-up window if it is open
  if (navigator.appName != "Microsoft Internet Explorer"
      || parseInt(navigator.appVersion) >=4) //do not close if early IE
    if(popImg != null) if(!popImg.closed) popImg.close()
  }
function setStatus(msg){
  status = msg
  return true
  }


// for Netscape 3+ and IE 4+
var priorPic = new Array()
var noPic = 0
var foundit = false

function openPopImg(picName, windowTitle, windowWidth, windowHeight){
  var i = 0
  if(pic == picName && winOpen()){
    popImg.focus()
    }
  else{
    foundit = false
    for(i=0; i<=noPic; i++){
      if (priorPic[i] == picName)
        foundit = true
      }
    pic = picName
    closePopImg()
    picTitle = windowTitle
    imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
    if(!foundit){
      priorPic[noPic++] = pic
      }
    popImg = openPopImgWin(imgWinName, windowWidth, windowHeight)
    }
  }
function openPopImgWin(imgWinName, windowWidth, windowHeight){
  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,status=no,width="
    + windowWidth + ",height=" + windowHeight
  return window.open("pimg.php", imgWinName, winFeatures)
  }
function winOpen(){
  if(popImg != null){
   if(popImg.closed != true) return true; else return false
   }
  else
    return false
  }

// Use this function to control placement of pop-up window
// in Netscape 4+ and Internet Explorer 4+
function openPopImgWin(imgWinName, windowWidth, windowHeight){
  var leftX = 20  // distance of window's left side from left of screen
  var topY = 20   // distance of window's top side from top of screen
  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,status=no,width="
    + windowWidth + ",height=" + windowHeight
  if (leftX>0){
    winFeatures += ",screenX=" + leftX + ",left=" + leftX
                + ",screenY=" + topY + ",top=" + topY
    }
  return window.open("pimg.php", imgWinName, winFeatures)
  }

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="materials.php">Materials</a>'
menu1[1]='<a href="greenbox.php">GreenBox</a>'
menu1[2]='<a href="optin.php">Opt&nbsp;In</a>'
menu1[3]='<a href="commercial.php">Commercial</a>'
menu1[4]='<a href="gardenwaste.php">GreenWaste</a>'
menu1[5]='<a href="furndonations.php">Donations</a>'
menu1[6]='<a href="vehicles.php">Vehicles</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="shabitat.php">Shabitat</a>'
menu2[1]='<a href="clothes.php">Clothes</a>'
//menu2[2]='<a href="biodiesel2.php">Biodiesel</a>'
menu2[2]='<a href="computers.php">Computers</a>'
		
//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<a href="about.php">About Us</a>'
menu3[1]='<a href="maps.php">Maps</a>'
menu3[2]='<a href="greentimes.php">GreenTimes</a>'
menu3[4]='<a href="newslist.php">News</a>'
menu3[5]='<a href="press.php">Press</a>'
menu3[6]='<a href="biodiesel.php">Biodiesel</a>'
menu3[7]='<a href="posterdl.php">Poster DLs</a>'

//Contents for menu 4, and so on
var menu4=new Array()
menu4[0]='<a href="northlaines.php">North Laines</a>'
menu4[1]='<a href="slick_schools.php">Slick&nbsp;Schools</a>'
menu4[2]='<a href="events.php">Events</a>'
menu4[3]='<a href="doorknocking.php">Door Knock</a>'
menu4[4]='<a href="gardening.php">Gardening</a>'
		
var menuwidth='125px' //default menu width
var menubgcolor='#518f5f'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")

dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

// end of func



function MakeArray(n) {
	this.length = n
	return this
}
monthNames = new MakeArray(12)
monthNames[1] = "Jan"
monthNames[2] = "Feb"
monthNames[3] = "Mar"
monthNames[4] = "Apr"
monthNames[5] = "May"
monthNames[6] = "June"
monthNames[7] = "July"
monthNames[8] = "Aug"
monthNames[9] = "Sept"
monthNames[10] = "Oct"
monthNames[11] = "Nov"
monthNames[12] = "Dec"
dayNames = new MakeArray(7)
dayNames[1] = "Sun"
dayNames[2] = "Mon"
dayNames[3] = "Tues"
dayNames[4] = "Weds"
dayNames[5] = "Thurs"
dayNames[6] = "Fri"
dayNames[7] = "Sat"

function customDateString() {
	currentDate = new Date()
	var theDay = dayNames[currentDate.getDay() + 1]
	var theMonth = monthNames[currentDate.getMonth() + 1]
	msie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));
	if (msie4) {
	    var theYear = currentDate.getYear()
	}
	else {
	     var theYear = currentDate.getYear() +1900
	}
	return theDay + "," + theMonth + "" + currentDate.getDate() + "," + theYear
}


function submitform(name)
{ 
// Other Javascript commands can be placed here
// If you need to "fail" the submit due to some error
// then use:
//
//  return false;
//
document.forms[name].submit(); 
   return true; 
}



