 function showwarning(passed_section) {
  form_mode = eval('document.getElementById("' + passed_section + '");');
  form_mode.style.display = '';
}

 //show and hide functionality
 function hideobject(object_id) {
 	var object = eval('document.getElementById("' + object_id + '")');
 	object.style.display = "none";
 }
 
 function showobject(object_id) {
 	var object = eval('document.getElementById("' + object_id + '")');
	object.style.display=""; 	
 }
 
 //restyle functionality
 function changeclass(object_id, class_id) {
 	var object = eval('document.getElementById("' + object_id + '")');
 	object.className = class_id;
 }

//simple container actions
function opencontainer(div_id,image_1_id,image_2_id) {
	hideobject(image_1_id);
	showobject(image_2_id);
	showobject(div_id);
}

function closecontainer(div_id,image_1_id,image_2_id){
	hideobject(div_id);
	hideobject(image_2_id);
	showobject(image_1_id);
}

function toggle_container(div_id) {
	var container = eval('document.getElementById("' + div_id + '")');
	if (container.style.display == "none") {
		showobject(div_id);
	} else {
		hideobject(div_id);
	}
}

  function hideallimages(class_id_fragment) {
	var elements = document.getElementsByTagName("img");
	var re = new RegExp(class_id_fragment);
	for (var i = 0; i < elements.length; i++) {
		element_id = elements[i].getAttribute('id');
		if (element_id == null) {
		} else {
		if (element_id.match(re)) {
			elements[i].style.display = "none";		
		}
		}
	}
 }

function toggle_container_and_labels(div_id, label_open, label_closed) {
	var container = eval('document.getElementById("' + div_id + '")');
	if (container.style.display == "none") {
		hideobject(label_closed);
		showobject(label_open);
		showobject(div_id);
	} else {
		hideobject(div_id);
		hideobject(label_open);
		showobject(label_closed);  
	}
}

function toggletab_bckQC(tab_1, tab_2, tab_click) {
	hideobject('div_' + tab_1);
	hideobject('div_' + tab_2);
	
	showobject('div_' + tab_click);
	
	changeclass('div_' + tab_1 + '_header', 'tab');
	changeclass('div_' + tab_2 + '_header', 'tab');
	changeclass('div_' + tab_click + '_header', 'active_tab');
}

function showRestriction(id)
{
	if($("#" + id + "_msg").length > 0) return;
	
	var message = $("<p>").html("The full-text of the selected article is only available to members of the PM Forum.");
	message.addClass("msg_restriction");
	message.attr("id", id + "_msg");
	message.click(function(){$(this).remove()});
	message.insertAfter($("#" + id));
	message.show("slow");
	message.click(function(){$(this).remove()});
}

function showRestriction2(id)
{
	if($("#" + id + "_msg").length > 0) return;
	
	var message = $("<p>").html("The full-text of the selected article is only available to members of the PM Forum.");
	message.addClass("msg_restriction2");
	message.attr("id", id + "_msg");
	message.css("padding-left", "0px");
	message.click(function(){$(this).remove()});
	message.insertAfter($("#" + id).next());
	message.show("slow");
	message.click(function(){$(this).remove()});
}
// tab toggle
function toggletabs(tab_1, tab_2, tab_3, tab_4, tab_5, tab_6, tab_7, tab_click) {
	hideobject('div_' + tab_1);
	hideobject('tabon_' + tab_1);
	showobject('taboff_' + tab_1);
 		
	hideobject('div_' + tab_2);
	hideobject('tabon_' + tab_2);
	showobject('taboff_' + tab_2);

	hideobject('div_' + tab_3);
	hideobject('tabon_' + tab_3);
	showobject('taboff_' + tab_3);

	hideobject('div_' + tab_4);
	hideobject('tabon_' + tab_4);
	showobject('taboff_' + tab_4);

	hideobject('div_' + tab_5);
	hideobject('tabon_' + tab_5);
	showobject('taboff_' + tab_5);

	hideobject('div_' + tab_6);
	hideobject('tabon_' + tab_6);
	showobject('taboff_' + tab_6);

	hideobject('div_' + tab_7);
	hideobject('tabon_' + tab_7);
	showobject('taboff_' + tab_7);			

	hideobject('taboff_' + tab_click);
	showobject('tabon_' + tab_click);
	showobject('div_' + tab_click);
}


