/* 
************ WRITES ***************
 */
function write_overview(url_read, url_write, domain_used, biov_domain, technologyInfo, name){
  	
  	var topic_domain = biov_domain+'technology_class';	
	var topic_id = technologyInfo.id;
	var property1 = biov_domain+'technology_class';

	// Create the button to sync the reads with any submitted writes
	createSyncButton(name);	


	// Overview text
	createBlurbElement(domain_used, name, topic_domain, topic_id, 500, "edit_overview");	
	
	// Companies Involved
	var company_options = {
		url_read: url_read,
		current_vals_q: '{"query":[{'+
				'"'+biov_domain+'technology_class/'+'company_involved":[{"*":null,"optional":true, "area_of_expertise":[{"name":null,"id":null}]}],'+
				'"type":"'+biov_domain+'technology_class",'+
				'"id" : "'+topic_id+'"'+
				'}]}',						
		topic_name: name,
		current_vals: technologyInfo.companies,
		property: biov_domain+'technology_class/'+'company_involved',
		property_type: [biov_domain+'science_or_technology_company'],
		topic_type: topic_domain,
		topic_id: topic_id		
	};		
	multiElement("span_company_involved", company_options, domain_used);
	
	// Parent Technologies
	var parent_options = {
		url_read: url_read,
		current_vals_q: '{"query":[{'+
				'"'+biov_domain+'technology_class/'+'parent_technology":[{"*":null,"optional":true}],'+
				'"type":"'+biov_domain+'technology_class",'+
				'"id" : "'+topic_id+'"'+
				'}]}',						
		topic_name: name,
		current_vals: technologyInfo.parent_technologies,
		property: biov_domain+'technology_class/'+'parent_technology',
		property_type: [biov_domain+'technology_class'],
		topic_type: topic_domain,
		topic_id: topic_id	
	};		
	multiElement("span_parent_technology", parent_options, domain_used);
	
	// Related Technologies
	var related_options = {
		url_read: url_read,
		current_vals_q: '{"query":[{'+
				'"'+biov_domain+'technology_class/'+'related_technology":[{"*":null,"optional":true}],'+
				'"type":"'+biov_domain+'technology_class",'+
				'"id" : "'+topic_id+'"'+
				'}]}',						
		topic_name: name,
		current_vals: technologyInfo.related_technologies,
		property: biov_domain+'technology_class/'+'related_technology',
		property_type: [biov_domain+'technology_class'],
		topic_type: topic_domain,
		topic_id: topic_id	
	};		
	multiElement("span_related_technology", related_options, domain_used);
 	
	// Included Technologies
	var sub_options = {
		url_read: url_read,
		current_vals_q: '{"query":[{'+
				'"'+biov_domain+'technology_class/'+'includes_technology":[{"*":null,"optional":true}],'+
				'"type":"'+biov_domain+'technology_class",'+
				'"id" : "'+topic_id+'"'+
				'}]}',						
		topic_name: name,
		current_vals: technologyInfo.included_technologies,
		property: biov_domain+'technology_class/'+'includes_technology',
		property_type: [biov_domain+'technology_class'],
		topic_type: topic_domain,
		topic_id: topic_id	
	};		
	multiElement("span_sub_technology", sub_options, domain_used);

	// Products	
	var product_options = {
		url_read: url_read,
		current_vals_q: '{"query":[{'+
				'"'+biov_domain+'technology_class/'+'products_involving_this_technology":[{"*":null,"optional":true}],'+
				'"type":"'+biov_domain+'technology_class",'+
				'"id" : "'+topic_id+'"'+
				'}]}',						
		topic_name: name,
		current_vals: technologyInfo.products,
		property: biov_domain+'technology_class/'+'products_involving_this_technology',
		property_type: [biov_domain+'product'],
		topic_type: topic_domain,
		topic_id: topic_id	
	};		
	multiElement("span_products_involving_this_technology", product_options, domain_used);

	// Research Groups - need to send this information	
	/* 
	var research_groups=new Array();
	var researchids = [];
	for (var i in technology.research_groups_involved) {
		research_groups[i] = technology.research_groups_involved[i].name;
		researchids[i] = technology.research_groups_involved[i].id;
	}
	var research_group_options = {
		topicName: name,
		currentVals: research_groups,
		property: 'research_groups_involved',
		propertyType: property1,
		propertyType2: '/base/bioventurist/bv_research_group',
		element_id: researchids,
		topic_id: topic_id

	};		
	multiElement("span_research_groups_involved", research_group_options);
	 */
	 
	// Patents - need to send this information
	/*  
	var patents=new Array();
	var patentids = [];
	for (var i in technology.patents) {
		patents[i] = technology.patents[i].name;
		patentids[i] = technology.patents[i].id;
	}
	var patent_options = {
		topicName: name,
		currentVals: patents,
		property: 'patents',
		propertyType: property1,
		propertyType2: '/base/bioventurist/patent',
		element_id: patentids,
		topic_id: topic_id

	};		
	multiElement("span_patents", patent_options);
	 */
	 
	// Edit page redirect:
	createFreebaseRedirect(technologyInfo.guid, 'freebase_redirect');
}