//EDITORS NOTE:
//I dont really understand this file, but it makes other stuff work
//see http://www.felgall.com/javadom1.htm for more information

function findDOM(objectId, withStyle) {

   var DOMsupported = 0;
   var standardDOMsupported = 0;
   var ieDOMsupported = 0;
   var netscapeDOMsupported = 0;
   if (document.getElementById){
      standardDOMsupported = 1; DOMsupported = 1;
   }
   else {
      if (document.all) {
         ieDOMsupported = 1; DOMsupported = 1;
      }
      else if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion ==4)){
         netscapeDOMsupported = 1; DOMsupported = 1;
      }
   }

   if (withStyle) {
      if (standardDOMsupported) {
         return (document.getElementById(objectId).style);
      }
      if (ieDOMsupported) {
         return (document.all[objectId].style);
      }
      if (netscapeDOMsupported) {
         return (document.layers[objectId]);
      }
   } 
   else {
      if (standardDOMsupported) {
         return (document.getElementById(objectId));
      }
      if (ieDOMsupported) {
         return (document.all[objectId]);
         }
      if (netscapeDOMsupported) {
         return (document.layers[objectId]);
      }
   }
}


function foobar()
{
 alert("in foobar");
   document.getElementById("search").src="../images/background/search_on.gif"; 
    alert("out foobar");
}

function toggleField(field,vis) {
   //alert("in .js file");
   //alert(field);
   var d = findDOM(field,1);
   if (vis) {
        d.visibility = 'visible';
   } 
   else {
        d.visibility = 'hidden';
   }
   //alert(field + " is now " + vis);
   //alert(field);
}



function toggleRecipient(recipient_email){
	//alert("in toggleRecipient");
	
	document.form1.recipient.value=recipient_email;
	
	//alert(document.form1.recipient.value)
	//alert("out toggleRecipient");
}




function breadCrumbs(base,delStr,defp,cStyle,tStyle,dStyle,nl) 
{ // by Paul Davis - http://www.kaosweaver.com


	loc=window.location.toString();

		
		
		subs=loc.substr(loc.indexOf(base)+base.length+1).split("/");
		
		
		
	document.write('<a href="'+getLoc(subs.length-1)+defp+'" class="'+cStyle+'">Home</a>  '+'<span class="'+dStyle+'">'+delStr+'</span> ');
	a=(loc.indexOf(defp)==-1)?1:2;
	
	//alert("AaAaAaAAAAAA"+a)
	//alert ("*********subs.lengtha"+(subs.length-a));
	
	for (i=0;i<(subs.length-a);i++)    //NOTE SHOULD BE i=0 BUT MATT CHANGED IT!!!
	{
		//alert(i);
		subs[i]=makeCaps(unescape(subs[i]));
		document.write('<a href="'+getLoc(subs.length-i-2)+defp+'" class="'+cStyle+'">'+subs[i]+'</a>  '+'<span class="'+dStyle+'">'+delStr+'</span> ');
	}
	if (nl==1) document.write("<br>");
	 
	document.write('<span class="'+tStyle+'">'+document.title+'</span>');
}




function makeCaps(a)
{
	g=a.split(' ');for (l=0;l<g.length;l++) g[l]=g[l].toUpperCase().slice(0,1)+g[l].slice(1);
	return g.join(" ");
}




function getLoc(c) {
  var d="";if (c>0) for (k=0;k<c;k++) d=d+"../"; return d;
}
