	ddaccordion.init({
		headerclass: "silverheader", //Shared CSS class name of headers group
		contentclass: "submenu", //Shared CSS class name of contents group
		revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
		mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
		collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
		defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
		onemustopen: true, //Specify whether at least one header should be open always (so never all headers closed)
		animatedefault: false, //Should contents open by default be animated into view?
		persiststate: true, //persist state of opened contents within browser session?
		toggleclass: ["", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
		togglehtml: ["", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
		animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
		oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
			//do nothing
		},
		onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
			//do nothing
		}
	})
	
	function change_corner_vid(video) {
		var so = new SWFObject("/files/flvPlayer.swf?videoPath=/vids/prod/"+video+"&autoStart=true&autoHide=false&autoHideTime=5&hideLogo=true&volAudio=60&newWidth=315&newHeight=256&disableMiddleButton=false&wmode=transparent&playSounds=true&soundBarColor=0x0066FF&barColor=0x0066FF&barShadowColor=0x91BBFB&subbarColor=0xffffff", "sotester", "310", "240", "9", "#efefef");
		so.addParam("allowFullScreen", "true");
		so.write("flashcontent");
	}
	
	function clear_main() {
		$j('#main_col').html('');
	}
	
	function fill_main(area, clear) {
		clear_main();
		
		$j('#'+area).find('.hiddencontent').each(function() {
			section 		= $j(this).next().next().next().next().next().next().text();
			id 				= area.replace(section, '');
			title 			= $j(this).prev().prev().text();
			link 			= $j(this).prev().html();
			content 		= $j(this).html();
			created 		= $j(this).next().text();
			modified 		= $j(this).next().next().text();
			userid 			= $j(this).next().next().next().text();
			fname			= $j(this).next().next().next().next().text();
			lname			= $j(this).next().next().next().next().next().text();

			mhtml = '<div class="story_wrap">';
			mhtml += '<div class="story_top"></div>';
			mhtml += '<div class="story_mid_cont">';
			mhtml += '<div class="story_title"><a href="'+link+'">'+title+'</a></div>';
			mhtml += '<div class="story_author">Written by: ';
			mhtml += '<a href="/users/profiles/'+userid+'">'+fname+' '+lname+'</a>';
			mhtml += '<br />';
			mhtml += 'Created: '+created;
			mhtml += '<br />Modified: '+modified;
			mhtml += '</div>';
			mhtml += content;
			mhtml += '<br /><br />Permanent Link: <a href="'+link+'">'+title+'</a>';
			mhtml += '</div>';
			mhtml += '<div class="story_btm"></div>';
			mhtml += '</div>';
			
			$j('#main_col').html(mhtml);
		});
	}

	function fillAccordian() {
		$j.ajax({
			type: "POST",
			url: '/thoughts/accordian',
			dataType: 'xml',
			success: function(msg) {
				videos = $j(msg).find('videos');
				beheard = $j(msg).find('beheard');
				beaware = $j(msg).find('beaware');
				$j(videos).find('link').each(function() {
					//alert($j(this).text());
					$j('#accordianvideos').append('<div class="applemenucontentitem"><div class="topvidlink" rel="'+$j(this).next().text()+'">'+$j(this).prev().text()+'</div></div>');
				});
				
				$j(beheard).find('link').each(function() {
					//alert($j(this).text());
					id 			= $j(this).prev().prev().text();
					title 		= $j(this).prev().text();
					link 		= $j(this).text();
					content 	= $j(this).next().text();
					created 	= $j(this).next().next().text();
					modified 	= $j(this).next().next().next().text();
					userid 		= $j(this).next().next().next().next().text();
					fname 		= $j(this).next().next().next().next().next().text();
					lname		= $j(this).next().next().next().next().next().next().text();					
					section 	= 'beheard';
					
					bhtml =  '<div id="beheard'+id+'" style="display:none;">';
					bhtml += '<div class="hiddentitle">'+title+'</div>';
					bhtml += '<div class="hiddenlink">'+link+'</div>';
					bhtml += '<div class="hiddencontent">'+content+'</div>';
					bhtml += '<div class="hiddencreated">'+created+'</div>';
					bhtml += '<div class="hiddenmodified">'+modified+'</div>';
					bhtml += '<div class="hiddenuserid">'+userid+'</div>';
					bhtml += '<div class="hiddenfname">'+fname+'</div>';
					bhtml += '<div class="hiddenlname">'+lname+'</div>';
					bhtml += '<div class="hiddensection">'+section+'</div>';
					bhtml += '</div>';
					
					$j('#hiddendata').append(bhtml);					
					$j('#accordianbeheard').append('<div class="applemenucontentitem"><div class="topbeheardlink" rel="'+id+'">'+title+'</div></div>');
				});
				
				
				$j(beaware).find('link').each(function() {
					//alert($j(this).text());
					id 			= $j(this).prev().prev().text();
					title 		= $j(this).prev().text();
					link 		= $j(this).text();
					content 	= $j(this).next().text();
					created 	= $j(this).next().next().text();
					modified 	= $j(this).next().next().next().text();
					userid 		= $j(this).next().next().next().next().text();
					fname 		= $j(this).next().next().next().next().next().text();
					lname		= $j(this).next().next().next().next().next().next().text();					
					section 	= 'beaware';
					
					bhtml =  '<div id="beaware'+id+'" style="display:none;">';
					bhtml += '<div class="hiddentitle">'+title+'</div>';
					bhtml += '<div class="hiddenlink">'+link+'</div>';
					bhtml += '<div class="hiddencontent">'+content+'</div>';
					bhtml += '<div class="hiddencreated">'+created+'</div>';
					bhtml += '<div class="hiddenmodified">'+modified+'</div>';
					bhtml += '<div class="hiddenuserid">'+userid+'</div>';
					bhtml += '<div class="hiddenfname">'+fname+'</div>';
					bhtml += '<div class="hiddenlname">'+lname+'</div>';
					bhtml += '<div class="hiddensection">'+section+'</div>';
					bhtml += '</div>';
					
					$j('#hiddendata').append(bhtml);	
					$j('#accordianbeaware').append('<div class="applemenucontentitem"><div class="topbeawarelink" rel="'+id+'">'+title+'</div></div>');
				});
				
				/*  start bind of the accordian links	*/
				$j('.topvidlink').bind('click', function(e) {
					change_corner_vid($j(this).attr('rel'));
				});
				
				$j('.topbeheardlink').bind('click', function(e) {
					fill_main('beheard'+$j(this).attr('rel'));
				});
				
				$j('.topbeawarelink').bind('click', function(e) {
					fill_main('beaware'+$j(this).attr('rel'));
				});
				/*  end bind of the accordian links	*/
			}
		});
	}
	
	$j(function() {
		fillAccordian();
	});