$(document).ready(function() {
	$('#file_upload').uploadify({
		'auto'					:	true,
		'buttonImg'			:	'img/button_select_photo.png',
		'cancelImg'			:	'uploadify/cancel.png',
		'fileDesc'			:	'Web Image Files (.GIF, .JPG, .PNG)',
		'fileExt'				:	'*.gif;*.jpg;*.png',
		'fileDataName'	:	'file',
		'height'				:	24,
		'multi'					:	true,
		'script'				:	'ajax/uploadify.php',
		'scriptData'		:	{'session_id': $('input#session_id').val(), 'token': $('input#token').val()},
		'uploader'			:	'uploadify/uploadify.swf',
		'width'					:	80,
		'wmode'					:	'transparent',
		'onAllComplete'	:	function(event, data) {
			var a = parseInt($("#uploadify_hidden").val());
			var t = (a + data.filesUploaded);
			$("#uploadify_hidden").val(t);
      $("#uploadify_message2").text($("#uploadify_hidden").val());
			$(".share_button2").fadeIn('slow');
			$(".uploadify_message").fadeIn('slow');
    },
		'onComplete'		:	function(event, ID, fileObj, response, data) {
			//alert(fileObj.filePath);
			$("#uploadify_upload_photo").fadeOut('slow');
		},
		'onSelectOnce'	:	function(event, data) {
			$("#uploadify_upload_photo").fadeIn('slow');
		}
	});

	$('#file_upload2').uploadify({
		'auto'					:	true,
		'buttonImg'			:	'img/button_select_file.png',
		'cancelImg'			:	'uploadify/cancel.png',
		'fileDesc'			:	'.7z, .doc, .docx, .mp3, .pdf, .ppt, .rar, .torrent, .txt, .xls, .xlsx, .zip',
		'fileExt'				:	'*.7z;*.doc;*.docx;*.mp3;*.pdf;*.ppt;*.rar;*.torrent;*.txt;*.xls;*.xlsx;*.zip',
		'fileDataName'	:	'file',
		'height'				:	24,
		'multi'					:	false,
		'queueSizeLimit':	1, 
		'script'				:	'ajax/uploadify2.php',
		'scriptData'		:	{'session_id': $('input#session_id').val(), 'token': $('input#token').val()},
		'sizeLimit'			:	8192000,
		'uploader'			:	'uploadify/uploadify.swf',
		'width'					:	80,
		'wmode'					:	'transparent',
		'onAllComplete'	:	function(event, data) {
			var a = parseInt($("#file_upload_hidden").val());
			var t = (a + data.filesUploaded);
			$("#file_upload_hidden").val(t);
      $("#file_upload_message2").text($("#file_upload_hidden").val());
			$(".share_button2").fadeIn('slow');
			$(".file_upload_message").fadeIn('slow');
    },
		'onComplete'		:	function(event, ID, fileObj, response, data) {
			//alert(fileObj.filePath);
			$("#uploadify_upload_file").fadeOut('slow');
		},
		'onSelectOnce'	:	function(event, data) {
			$("#uploadify_upload_file").fadeIn('slow');
		}
	});
});

