
function prn_c(str_in){
	//var str_in = str_in.replace(/\|/gi,'<br />') ;
	document.getElementById("msg_c").innerHTML += str_in +"<br />" ;
}
function clear_c(str_in){
	//var str_in = str_in.replace(/\|/gi,'<br />') ;
	document.getElementById("msg_c").innerHTML = str_in +"<br />" ;
}
function get_radio_selected(radio_group,rtn) { //get_radio_selected(document.getElementsByName(""),"value") 
	if(!radio_group)	return "";
	//if(!radio_group.length)	return "";
		for (var i = 0; i < radio_group.length ; i++) {
	
		   if (radio_group[i].checked) {
				if(rtn=="value"){
					return radio_group[i].value ; // you are the chosen one! take the value and return it
				} else {
					return radio_group[i].id ; // you are the chosen one! take the value and return it
				}
		   }
		}
		return "" ; // nothing was checked so retunr empty

}
function set_pos(id,left,top) {
	document.getElementById(id).style.left = left ;
	document.getElementById(id).style.top = top ;
}
function show_hide(show,hide) {
var arr_show = show.split(",") ;
var arr_hide = hide.split(",");

	//document.getElementById("msg_c").innerHTML +="show_hidex<br />" ;//<br />show="+show +" len="+ show.length+" arr_show=" + arr_show.length + "<br />hide="+ hide+" len=" + hide.length+" arr_hide="+ arr_hide.length ;

	if(hide.length>0){
		for(var x=0; x<arr_hide.length ; x++) {

			if(document.getElementById(arr_hide[x])) {
				document.getElementById(arr_hide[x]).style.visibility = "hidden" ;/**/
				//document.getElementById(arr_hide[x]).style.display = "none";
				
			}
		} 
	}
	if(show.length>0){
		for(var i=0; i<arr_show.length ; i++) {
			if(document.getElementById(arr_show[i])) {
				document.getElementById(arr_show[i]).style.visibility="visible" ;/**/
				//document.getElementById(arr_hide[i]).style.display = "block";
			}
		}
	}
}
function disp_hide(show,hide) { // disp_hide('','') ;
var arr_show = show.split(",") ;
var arr_hide = hide.split(",");

	if(hide.length>0){
		for(var x=0; x<arr_hide.length ; x++) {

			if(document.getElementById(arr_hide[x])) {
				document.getElementById(arr_hide[x]).style.display = "none" ;/**/
			}
		} 
	}
	if(show.length>0){
		for(var i=0; i<arr_show.length ; i++) {
			if(document.getElementById(arr_show[i])) {
				document.getElementById(arr_show[i]).style.display="block" ;/**/

			}
		}
	}
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
