if (document.getElementsByTagName && document.getElementsByClassName  ) {
	// Create a link to the Javascript-only stylesheet

	var $link_element1 = document.createElement('link');
	$link_element1.setAttribute("rel","stylesheet");
	$link_element1.setAttribute("href","/web/StyleSheets/javascript_only.css");
	$link_element1.setAttribute("media","screen");
	

	// Append this stylesheet link to the document
	var $head_element = document.getElementsByTagName('head')[0];
	$head_element.appendChild($link_element1);
}


var linkTitle=''

function init(){

	
	$$('#panels .panel div.panelTop').each( function(link) {
	
		
		linkTitle=link.getAttribute('title');
			link.onclick = function() {
						// hide all panels
						$$('.panel .panelBottom').each(Element.hide);
												
						//check status of panel
						panelStatus=this.hasClassName('open');
						
						if (panelStatus){				
							this.removeClassName('open');
							$$('.panel .panelBottom').each(Element.hide);
							// this.removeClassName('open');
							
						}else{
							$$('#panels div.panelTop').each(function (s) {s.removeClassName('open') }  
											);
							// show relevant content panel		
							linkTitle=this.getAttribute('rel');
							if ($(linkTitle + 'ContentPanel')) {	
								$(linkTitle + 'ContentPanel').style.display="block";
								// new Effect.slideDown($(linkTitle + 'ContentPanel'), {duration:.5});						 
							}

							
							this.addClassName('open');
							// show relevant inner panel
	//						if ($(linkTitle + 'SectionPanel')) {$(linkTitle + 'SectionPanel').style.display="block";}



						}
						return false;
			}
			
			link.onmouseout = function() {
//						this.removeClassName('on');
//						// hide all panels
//						$(linkTitle + 'ContentPanel').style.display="none";
			}

	
	});
	// replace page links with void links for dropdowns

			$$('.linkReplace').each( function(replaceLink) {
				replaceLink.setAttribute('href', 'javascript:void(0)');
				// add return false;
				replaceLink.onclick = function() {
					return false;
				}

			}
			);


}



Event.observe(window, 'load', init, false);
// addEvent(window,'load',init)