//		var nS1 = new noobSlide({
//			box: $('box1'),
//			items: [0,1,2],
//			//size: 204,
//			autoPlay: true
//		});
	
//	new Swiff('http://dev.dotweb.ro/uccjr/publiss/flash/video.swf', {
//    id: 'video',
//		container: 'video',
//    width: 350,
//    height: 280,
//    params: {
//        wmode: 'opaque',
//        bgcolor: '#CCCCCC'
//    },
//    vars: {
//				FLV: 'http://dev.dotweb.ro/uccjr/publiss/uploads/media/video/dogs.flv'
//    }
//	});
//
//	new Swiff('http://dev.dotweb.ro/uccjr/publiss/flash/video.swf', {
//    id: 'video2',
//		container: 'video2',
//    width: 350,
//    height: 280,
//    params: {
//        wmode: 'opaque',
//        bgcolor: '#CCCCCC'
//    },
//    vars: {
//				FLV: 'http://dev.dotweb.ro/uccjr/publiss/uploads/media/video/dogs.flv'
//    },
//    callBacks: {
//    }
//	});
//
//	new Swiff('http://dev.dotweb.ro/uccjr/publiss/flash/audio.swf', {
//    id: 'audio',
//		container: 'audio',
//    width: 300,
//    height: 20,
//    params: {
//        wmode: 'opaque',
//        bgcolor: '#CCCCCC'
//    },
//    vars: {
//				mp3: 'http://dev.dotweb.ro/uccjr/publiss/uploads/media/audio/ducks.mp3',
//				secs:'89'
//    },
//    callBacks: {
//    }
//	});
window.addEvent('load', function() {
	if ($$('#thumbnails img')) {
		$$('#thumbnails img').each(function(el){
			el.addEvent('click', function(){
				src = 'http://dev.dotweb.ro/uccjr/uploads/media/image/' + el.get('id');
				$('default_image').set('src', src);
			})
		})
	}

	if($('media_type')){
		type = $('media_type').get('value');
		
		if ($('file')) {
			var file = 'http://dev.dotweb.ro' + $('file').get('value');			
		}

		if (type == 'video') {
			new Swiff('http://dev.dotweb.ro/uccjr/flash/media_video.swf', {
				id: 'video',
				container: 'flash-player',
				width: 630,
				height: 505,
				params: {
					wmode: 'window',
					bgcolor: '#FFFFFF'
				},
				vars: {
					FLV: file
				}
			});
		}
		
		if (type == 'audio') {
			new Swiff('http://dev.dotweb.ro/uccjr/flash/media_audio.swf', {
				id: 'audio',
				container: 'flash-player',
				width: 630,
				height: 250,
				params: {
					wmode: 'window',
					bgcolor: '#FFFFFF'
				},
				vars: {
					FLV: file,
					txt: $('txt').value
				}
			});
		}
	}
	

//	$$('#media_videos .video_item').each(function(video_item){
//		new Swiff('http://dev.dotweb.ro/uccjr/publiss/flash/video.swf', {
//	    id: video_item.get('id'),
//			container: video_item.get('id'),
//	    width: 350,
//	    height: 280,
//	    params: {
//	        wmode: 'opaque',
//	        bgcolor: '#CCCCCC'
//	    },
//	    vars: {
//					FLV: video_item.getElement('input').get('value')
//	    }
//		});
//	});
//	
//	$$('#media_videos .audio_item').each(function(audio_item){
//		new Swiff('http://dev.dotweb.ro/uccjr/publiss/flash/audio.swf', {
//	    id: audio_item.get('id'),
//			container: audio_item.get('id'),
//	    width: 300,
//	    height: 20,
//	    params: {
//	        wmode: 'opaque',
//	        bgcolor: '#CCCCCC'
//	    },
//	    vars: {
//					mp3: audio_item.getElement('input.audio_file_name').get('value'),
//					secs: audio_item.getElement('input.audio_file_length').get('value')
//	    },
//	    callBacks: {
//	    }
//		})
//	})
})