var accordion=function(){
	var tm=10; var sp=2.5;
	function slider(n){
		this.nm=n; this.arr=[]; this.sel=''
	}
	slider.prototype.init=function(t,c,k,rc){
		var a,h,s,l,i; a=document.getElementById(t);
		h=a.getElementsByTagName('dt'); s=a.getElementsByTagName('dd');
		l=h.length;
		if(Get_Cookie("dgp_accordion")){
		    for(i=0;i<l;i++){
	                if(rc==1 && Get_Cookie("dgp_accordion")){
			    if(h[i].id.toLowerCase().indexOf(Get_Cookie("dgp_accordion"))>-1){
			        c=i;
			    } 		    	    		    	    		    	        	    		    	    		    	 
			} 		
		    }
		} else{
		    c=0;	
		}								
		for(i=0;i<l;i++){
			var d=h[i]; this.arr[i]=d; d.onclick=new Function(this.nm+".process(this)");
			if(k!=null&&c==i){this.sel=d.className=k;}
		}	
		l=s.length;
		for(i=0;i<l;i++){
			var d=s[i]; d.maxh=d.offsetHeight;
			if(c!=i){d.style.height='0'; d.style.display='none'; d.style.overflow='hidden';}
		}
	}
	slider.prototype.process=function(d){
		var i,l; l=this.arr.length;
		for(i=0;i<l;i++){
			var h=this.arr[i]; var s=h.nextSibling;
			if(s.nodeType!=1){s=s.nextSibling}
			clearInterval(s.timer);
			if(h==d&&s.style.display=='none'){
			    var titleArr=h.id.split(" ");
			    var titleC=titleArr[titleArr.length-1].substring(0,4).toLowerCase();
			    document.cookie="dgp_accordion="+titleC+";path=/";
			    s.style.display=''; s.style.overflow='visible'; setup(s,1); h.className=this.sel; 
	                }
			else if(s.style.display==''){s.style.overflow='hidden'; setup(s,-1); h.className='';}
		}
	}
	function setup(c,f){c.timer=setInterval(function(){slide(c,f)},tm)}
	function slide(c,f){
		var h,m,d; h=c.offsetHeight; m=c.maxh; d=(f==1)?Math.ceil((m-h)/sp):Math.ceil(h/sp);
		c.style.height=h+(d*f)+'px'; c.style.opacity=h/m; c.style.filter='alpha(opacity='+h*100/m+')';
		if(f==1&&h>=m){clearInterval(c.timer)}
		else if(f!=1&&h==1){c.style.display='none'; c.style.overflow='hidden'; clearInterval(c.timer)}
	}
	return{slider:slider}
}();

function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}