// Breadcrumbs
//--------------------------------------------------------------------------------
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;for (i=0;i<(subs.length-a);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;
}



// iFrames 
//--------------------------------------------------------------------------------
bool = true;
// function to show/hide an object
function showHide(obj) {
   obj.style.display = (bool) ? "none" : ""
   bool = !bool;
}
// function to show an object
function show(obj) {
   obj.style.display = "";
}
// function to hide an object
function Hide(obj) {
   obj.style.display = "none";
}
// function to set the initial visibility of the iframes
function setvis(name, loop) { //v2.0
  for(i=2; i<=loop; i++)
    document.getElementById(name + i).style.display = "none";
}
// function to resize an iframe base on the current height of the iframe's page
function iFRResize(name){ //v2.0
  var frame = name;
  var newHeight = document.body.scrollHeight + "px";
	parent.document.getElementById(frame).style.height = newHeight;
}
// function to change the page currently loaded in an iframe
function iFRRedirect (location, name, newpage) {
  if (!document.createElement) {return true};
  var IFrameObj; // our IFrame object
  var IFrameDoc;
  var frame = name;
  
	if (location == "parent") {
	  IFrameObj = parent.document.getElementById(frame);
	} else {
		IFrameObj = document.getElementById(frame);
	}
  
  if (navigator.userAgent.indexOf('Gecko') !=-1 && !IFrameObj.contentDocument) {
    // we have to give NS6 a fraction of a second
    // to recognize the new IFrame
    setTimeout('callToServer()',10);
    return false;
  }
  if (IFrameObj.contentDocument) {
    // For NS6
    IFrameDoc = IFrameObj.contentDocument; 
  } else if (IFrameObj.contentWindow) {
    // For IE5.5 and IE6
    IFrameDoc = IFrameObj.contentWindow.document;
  } else if (IFrameObj.document) {
    // For IE5
    IFrameDoc = IFrameObj.document;
  } else {
    return true;
  }
  
  IFrameDoc.location.replace(newpage);
  return false;
}

function buildQueryString(theForm) {
  var qs = '';
  for (e=0; e<theForm.elements.length; e++) {
    if (theForm.elements[e].name!='') {
      qs+=(qs=='')?'?':'&';
      qs+=theForm.elements[e].name+'='+escape(theForm.elements[e].value);
      }
    }
  return qs
}

