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_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);


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 getFlashWidth(flashsrc) { // function to get flash's width
	var flashTag = document.getElementById(flashsrc);
	var iWidth = flashTag.width;
	return iWidth;
}

function getFlashHeight(flashsrc) { // function to get flash's height
	var flashTag = document.getElementById(flashsrc);
	var iHeight = flashTag.height;
	return iHeight;
}


/* THIS IS FOR THE CAPTION AREA */

function toggleCaption() {
    var expanded = document.getElementById("captionExpand");
	var expanded2 = document.getElementById("captionPanel");
    
    if(expanded.style.display == "none" || !expanded.style.display) {
        expanded.style.display = "block";
		expanded2.style.display = "none";
       <!-- document.getElementById().focus();
    }
    else if(expanded.style.display == "block") {
        expanded.style.display = "none";
		expanded2.style.display = "block";
    }

    return false;
}


/* END */



function getElementsBySelector(selector){
var i;
var s=[];
var selid="";
var selclass="";
var tag=selector;
var objlist=[];
if(selector.indexOf(" ")>0){  //descendant selector like "tag#id tag"
    s=selector.split(" ");
    var fs=s[0].split("#");
    if(fs.length==1) return(objlist);
    return(document.getElementById(fs[1]).getElementsByTagName(s[1]));
    }
if(selector.indexOf("#")>0){ //id selector like "tag#id"
    s=selector.split("#");
    tag=s[0];
    selid=s[1];
    }
if(selid!=""){
    objlist.push(document.getElementById(selid));
    return(objlist);
    }
if(selector.indexOf(".")>0){  //class selector like "tag.class"
    s=selector.split(".");
    tag=s[0];
    selclass=s[1];
    }
var v=document.getElementsByTagName(tag);  // tag selector like "tag"
if(selclass=="")
    return(v);
for(i=0;i<v.length;i++){
    var myid = v[i].id;
    if(v[i].className==selclass && myid.indexOf("gnav") != "-1"){
        objlist.push(v[i]);
        }
    }
return(objlist);
}



function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}



function noErrorMessages () { return true; }
//window.onerror = noErrorMessages;

var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_opera  = agt.indexOf("opera") > -1 ;
var is_safari = agt.indexOf("safari") > -1 ;

var isIE = ((document.all)? true  : false );
var isNS6 = ((document.getElementById && !document.all)? true: false );
var ie55up = (document.all && document.getElementById)?(true):(false);


if (!document.getElementById){
	document.getElementById = function (id){
							if (document.all){
								return document.all[id];
							}
						}
}


function loadSWF(url,id,pos,t,w,h,bgcolor){

	str = '<embed swLiveConnect="true" quality=best type="application/x-shockwave-flash" menu=false  ' +
		' name="' + id + '" id="' + id + '" ' +
		' src="' + url + '" ' +
		' wmode="opaque" ' +
		' bgcolor="' + bgcolor + '" ' +
		' position="' + pos + '" ' +
		' top=' + t + ' width=' + w + ' height=' + h +
		' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" ></embed>';

	document.write (str);
}



/*function loadSWF(url,id,pos,t,w,h,bgcolor){

	str = '<embed swLiveConnect="true" quality=best type="application/x-shockwave-flash" menu=false  ' +
		' name="' + id + '" id="' + id + '" ' +
		' src="' + url + '" ' +
		' wmode="opaque" ' +
		' bgcolor="' + bgcolor + '" ' +
		' position="' + pos + '" ' +
		' top=' + t + ' bottom=' + 0 + ' width=' + w + ' height=' + h +
		' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" ></embed>';

	document.write (str);
}
*/


/*var clickedSearch = false;
function catchSearch (evt){
	e = (isIE)? (window.event):(evt);

	if(e.keyCode==13){

		clickedSearch = true;
		if (document.forms[0]){document.forms[0].onsubmit = function(){return false};}
		result = validateSearch(false);
		/*
		if (e.cancelBubble) e.cancelBubble = true;
		if (e.stopPropagation) e.stopPropagation();
		if (e.returnValue) e.returnValue = false;
		if (e.cancel) e.cancel = false;
		
		return false;
	}
}
*/


function validateSearch(){
	if (document.getElementById('q')){
		if (document.getElementById('q').value.length>1 ){
			top.location.href = 'search.aspx?q='+escape(document.getElementById('q').value);
			return true;
		}else{
			alert ("To perfom search of this site, the query word must contain at least two characters ");
			document.getElementById('q').focus();
			return false;
		}
	}
}

function setValue(id,val){
	if (id=="")return;
	var o = document.getElementById(id);
	if (o)o.value = val;
}

function setHtml(id,html,toAppend,hideIfEmpty){
	if (id=="")return;
	var o = document.getElementById(id);
	if (o){
		html = html.replace(/\\r\\n/gi,"");
		o.innerHTML = (toAppend)?(o.innerHTML+html):(html);
		if (hideIfEmpty && html=="") o.className = "off";
	}
}

function setClass(id,val){
	if (id=="")return;
	var o = document.getElementById(id);
	if (o)o.className = val;
}
function replaceClass(id,str1,str2){
	if (id=="")return;
	var o = document.getElementById(id);
	if (o)o.className = o.className.replace (str1,str2);

}

function getParentId(id){
	var str = "";

	if (id=="")return;

	var o = document.getElementById(id);
	if (o)o=o.parentElement;

	if (o)str=o.id;

	return str;
}

function getSelValue(id){
	var retVal = "";
	if (id=="")return;
	var o = document.getElementById(id);
	if (o)retVal = o.value;
	return retVal;
}

function getIndex(id){
	var index = 0;
	if (id=="")return;
	var o = document.getElementById(id);
	if (o)index=o.selectedIndex ;
	return index;
}

function selectIndex(id, index){
	if (id=="")return;
	var o = document.getElementById(id);
	if (o)o.selectedIndex = index;
}
function selectValue(id, val){
	if (id=="")return;
	var o = document.getElementById(id);
	if (o){

		for (i=0;i<o.length; i++){
			if (o[i].value==val || val==-1){
				o[i].selected = true;
				if (val!=-1)break;
			}

		}
	}
}

var lastPrefix = "";
var lastId = 0;
function showItem(prefix,id){

	if (lastId>0){
		replaceClass(lastPrefix+lastId,"block","off");
		replaceClass("nav"+lastId,"sel","reg")
	}

	if (lastId!=id || prefix=="section" ){
		lastPrefix = prefix;
		lastId = id;
		replaceClass(lastPrefix+lastId,"off","block");
		replaceClass("nav"+lastId,"reg","sel")
	}else{
		lastId = 0;
		lastPrefix = "";
	}

}

var lastFilter = "";
var lastFilterType = "";
var lastPrevSibling = "";
function showFilter(filterType,id){
	var oPrev;
	var o;
	if (lastFilter!=""){
		setClass(lastFilter,"");
		if (lastFilterType!="all"){
			setClass(eval(lastFilterType+"DDL"),"");
		}else{
			setClass("filterBox","");
		}
	}
	if (lastPrevSibling!="")setClass(lastPrevSibling,"");

	lastFilterType = filterType;
	lastFilter = id;
	o = document.getElementById(id);
	if (o){
		oPrev = o.previousSibling;
		oPrev.className="side";
		lastPrevSibling=oPrev.id;
	}

	setClass(lastFilter,"sel");
	if (lastFilterType!="all"){
		setClass(eval(lastFilterType+"DDL"),"sel");
	}else{
		setClass("filterBox","closed");
	}
}

/*function callFilter(queryName){
	if (lastFilterType!=""){
		self.location = queryName+".aspx?" + lastFilterType + "="+ getSelValue(eval(lastFilterType+"DDL"));
	}
}
*/



