$( document ).ready ( function ( ) {
	dp.SyntaxHighlighter.ClipboardSwf = '/swf/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	$( 'a[@href*="youtube.com/watch"]' ).flash (
		{
			height: 	370,
			width: 		670
		},
		{
			version:	8
		},
		function ( htmlOptions )
		{
			$this = $ ( this );
			var url =  $this.attr ( "href" );
			url = url.replace ('watch?v=','v/');
			htmlOptions.src = url + '&ap=%2526fmt%3D22';
			$this.before ( $.fn.flash.transform ( htmlOptions ) );
		}
	);
	$ ( ".flashable" ).flash (
		{
			src: "../swf/code.swf",
			width: 		675,
			height: 	300,
		},
		{
			update: 		false,
			version: 		9
		},
		function ( htmlOptions )
		{
			$this = $ ( this );
			
			htmlOptions.flashvars.classfile = $this.attr ( "title" );
			
			$this.replaceWith ( $.fn.flash.transform ( htmlOptions ) );
		}
	);
});

function killCode ( )
{
	$.unblockUI ( );
}
function maxCode ( className )
{
	$.blockUI.defaults.css.width = '100%';
	$.blockUI.defaults.css.top = '15%';
	$.blockUI.defaults.css.left = '0';
	$.blockUI.defaults.css.height = '100%';
	
	$.blockUI.defaults.css.border = 'none';
	$.blockUI.defaults.css.backgroundColor = 'none';
    $.blockUI.defaults.css.cursor = 'default';
	
	$.blockUI({ message: "<div id='code' title='" + className + "'></div>" });
	$ ( "#code" ).flash (
		{
			src: "../swf/code.swf",
			width: 		"70%",
			height: 	"70%",
		},
		{
			update: 		false,
			version: 		9
		},
		function ( htmlOptions )
		{
			$this = $ ( this );
			
			htmlOptions.flashvars.classfile = $this.attr ( "title" );
			
			$this.replaceWith ( $.fn.flash.transform ( htmlOptions ) );
		}
	);
}