
// Determine more/less options
function more(t) {

	// Tab
	var t = t;
	
	// Switch display
	rob.vis('more_' + t);
	
	// Get text
	var s = rob.id('showmore');
	
	// If now showing change
	if(s.value == 1) {
		s.value = 0;
		var msg = "Show more options";	
		var sign = "[+]";
	}
	
	// If showing change
	else {
		s.value = 1;
		var msg = "Show less options";
		var sign = "[-]";
	}
	
	//rob.push('tol_' + t, msg);;
	//rob.push('tos_' + t, sign);;
	
}

// Modify search box border colour
function border(c) {

	// Get div
	var t = rob.id('tabcontent');
	
	// Get current option
	var c = c;
	
	// Adjust colour accordingly
	if(c == 1) 			t.style.borderColor='#7589a6';
	else if(c == 2)	t.style.borderColor='#c73738';
	else if(c == 3)	t.style.borderColor='#fe6b31';

}

// Change the content of the tab
function tab(t) {

	// Get tab area
	var t = t;
	
	// Get tab to switch to
	var c = rob.id('tabid');
	
	// If same leave
	if(c.value == t) return;
	
	// Switch to tab 1
	if(t == 1) {
		rob.hide('tab2');
		rob.hide('tab3');
		rob.show('tab1');
		c.value = 1;
		border(1);
		return;
	}
	
	// Switch to tab 2
	if(t == 2) {
		rob.hide('tab1');
		rob.hide('tab3');
		rob.show('tab2');
		c.value = 2;
		border(2);
		return;
	}
	
	// Switch to tab 3
  rob.hide('tab1');
  rob.hide('tab2');
  rob.show('tab3');
	c.value = 3;
	border(3);

}

// Adjust hidden field so we know what form a submission comes from
function transferStatuses(t) {
	
	// Update status
	rob.push('holder_' + t, rob.grab('statuses'));
	
	// Adjust form name
	var fname = "tabform_" + t;
	
	// Submit
	document.forms[fname].submit();

}

