//crusel
jQuery(document).ready(function($) {
	//facebox settings
	$('a[rel*=facebox]').facebox()
  //vplayer settings
	flowplayer("a.vplayer",
		"flowplayer-3.1.5.swf",
		{ 
		clip: { 
			autoPlay: false,
			autoBuffering: true
		}
	});
	
	flowplayer("div.vplayer1",
		"flowplayer-3.1.5.swf",
		{ 
		plugins: { 
			controls:{
				mute:false,
				time:false,
				fullscreen:false
			}
		}		
	});
	

	//toogle
		var atrvalue = $('#myart').html();
		$('div.toggle').each(function(i){
			
			var mbox = $('div.toggle').eq(i).find('div.more_box').height();
			var ph = $('div.toggle').eq(i).find('div.more_box p:first-child').innerHeight();
			var chage_more = $('div.toggle').eq(i).find('div.more_box');

			if(atrvalue == i.toString()) show();
			
			//show more text
			function show(){
				chage_more.animate({
					height:mbox
				},2000,function(){
					$('div.toggle').eq(i).find('a.more').text('hide text');
				});
			}
			//hide more text
			function hide(){
				chage_more.animate({
					height:ph
				},2000,function(){
					$('div.toggle').eq(i).find('a.more').text('read more');
				});
			}

			//change "more_box" height to first "p" element
			$(this).find('div.more_box').height(ph);

			//onload chage settings
			
			//click chage settings
			$(this).find('a.more').click(function(){
				if (chage_more.height() == ph)	show()
				else hide();
				return false;
			}
			);
		});
})
	

