jQuery(document).ready(function(){
	jQuery("#checkboxall").click(function() {
		var checked_status = this.checked;
		jQuery("input[id*=checklist]").each(function() {
			this.checked = checked_status;
		});
	});
	
	jQuery("#checkinvert").click(function() {
		jQuery("input[id*=checklist]").each(function() {
			var status = this.checked;
			
			if (status == true) {
				this.checked = false;
			} else {
				this.checked = true;
			}
		});
	});
});

function insert_quicktime(divid, file, width, height) {
	var html = '';
	html += '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="' + width + '" height="' + height + '">';
	html += '<param name="src" value="' + file + '" />';
	html += '<param name="autoplay" value="false" />';
	html += '<param name="loop" value="false" />';
	html += '<embed src="' + file + '" width="' + width + '" height="' + height + '" autoplay="false" loop="false"></embed>';
	html += '</object>';
	
	document.write(html);
}

function addfilebox() {
	var html = '<div id="wppod_filebox' + (filebox + 1) + '"></div>';
	new Insertion.After('wppod_filebox' + filebox + '', html);	
	
	new Ajax.Updater('wppod_filebox' + filebox + '', wppodBase + '?method=addfilebox&id=' + filebox + '', {
		evalScripts: true,
		asynchronous: true,
	});	
	
	filebox++;
}

function delfilebox(filebox, fileid) {
	if (confirm('Are you sure you wish to remove this file?')) {
		Element.remove('wppod_filebox' + filebox + '');
		
		if (fileid != "") {
			new Ajax.Request(wppodBase + '?method=file_delete&id=' + fileid + '');
		}
	}
	
	return false;
}