/**
 * fw_menu 24OCT2000 Version 4.0
 * John Ahlquist, October 2000
 * Copyright (c) 2000 Macromedia, Inc.
 *
 * based on menu.js
 * by gary smith, July 1997
 * Copyright (c) 1997-1999 Netscape Communications Corp.
 *
 * Netscape grants you a royalty free license to use or modify this
 * software provided that this copyright notice appears on all copies.
 * This software is provided "AS IS," without a warranty of any kind.
 */
 
function openWin(url, name) {
  popupWin = window.open(url, name, "resizable,width=500,height=350,left=0,top=0");
  windowIsOpen = "true";
  popupWin.focus()
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function modifyDate() {
	
var months = new Array();
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";

dateObj = new Date(document.lastModified);
lmonth = months[dateObj.getMonth() + 1];
date = dateObj.getDate();
year = dateObj.getYear();
if (year < 1000) year += 1900;

pagemod = document.write ("&nbsp;&nbsp;Last updated:" + " " + lmonth + " " + date + ", " + year);

return pagemod;
}

function checkEmail(myForm) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(feedback.email.value)) 
		{
		return (true)
		}
	alert("Invalid e-mail address! Please re-enter.")
	return (false)
	}

function protectAddress( name, account, domain )	{
	var tag1 = "mai"
	var tag2 = "lto:" 
	document.write("<a h" + "ref=" + tag1 + tag2 + account + "@" + domain + ">"+name +"</a>");
	}
	
// show/hide telephony RFP stuff starts here:

function addEvent(func){
  if (!document.getElementById | !document.getElementsByTagName) return
  var oldonload=window.onload
  if (typeof window.onload != 'function') {window.onload=func}
  else {window.onload=function() {oldonload(); func()}}
}

addEvent(hideAll)

function hideAll(){
  var obj,nextdiv,anchor,content

  // get all divs
  obj=document.getElementsByTagName('div')

  // run through them
  for (var i=0;i<obj.length;i++){

    // if it has a class of rfpLink
    if(/rfpLink/.test(obj[i].className)){

      // get the adjacent div
      nextdiv=obj[i].nextSibling
      while(nextdiv.nodeType!=1) nextdiv=nextdiv.nextSibling

      // hide it
      nextdiv.style.display='none'
    //create a link
      anchor=document.createElement('a')

      // copy original rfpLink text and add attributes
      content=document.createTextNode(obj[i].firstChild.nodeValue)
      anchor.appendChild(content)
      anchor.href='#rfp'
      anchor.title='Click to show RFI responses'
      anchor.className="rfpLink"
      anchor.nextdiv=nextdiv
      anchor.onclick= function(){
                        showHide(this.nextdiv);
                        changeTitle(this);
                        return false
                      }

      // replace div with created link
      obj[i].replaceChild(anchor,obj[i].firstChild)
    }
  }
}


function changeTitle(obj){
  if(obj)
    obj.title = obj.title=='Click to show RFI responses' ? 'Click to hide RFI responses' : 'Click to show RFI responses'
}

function showHide(obj){
  if(obj)
    obj.style.display = obj.style.display=='none' ? 'inline' : 'none'
}	