var topAccordian;

function loadAccordions(theSection) {
	
	topAccordion = new accordion('horizontal_container', {
		classNames : {
			toggle : 'horizontal_accordion_toggle',
			toggleActive : 'horizontal_accordion_toggle_active',
			content : 'horizontal_accordion_content'
		},
		defaultSize : {
			width : 709
		},
		direction : 'horizontal'
	});
		
	topAccordion.activateInstant($$('#horizontal_container .horizontal_accordion_toggle')[theSection]);
	document.getElementById("content").style.visibility = "visible";
	
}

function showSection(theSection){
	topAccordion.activateOnly($$('#horizontal_container .horizontal_accordion_toggle')[theSection]);
}

function resultspage(pageNumber, direction){
	document.documentsearch.pagenumber.value = pageNumber;
	document.documentsearch.direction.value = direction;
	document.documentsearch.submit();
}

function gotopage(thePage){
	document.location.href = thePage;
}

function switchBox(theID){
	
	var curState = document.getElementById(theID).style.display;

	if (curState){
		if (curState == 'block'){
			document.getElementById(theID).style.display='none';
		}else{
			document.getElementById(theID).style.display='block';
		}
	}else{
		document.getElementById(theID).style.display='block';
	}

}

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function openContent(url, height, width, xpos, ypos, title) {
	winOptions = 'toolbar=0,location=1,directories=0,screenx=' +  xpos + ',screeny='+ ypos + ',top='+ ypos +',left=' + xpos + ',status=1,menubar=0,scrollbars=1,resizable=1,width=' + width + ',height=' + height;
	var temp = window.open(url, title, winOptions);
	temp.focus();
}

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function framebreakout()
{
  if (top.location != location) {
    top.location.href = document.location.href ;
  }
}

function clearText(field){

    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;

}


