function row_active(name, rownum)
{
	for (var i=1; i<=5; ++i)
	{
		document.getElementById(name+rownum+'_col'+i).className='col_active'+i; // active the rows
	}
	if (document.getElementById(name+rownum)) // check existing of sec1_row
	{
		document.getElementById(name+rownum).style.display='block'; // display it
	}
	return;
}
function row_inactive(name, rownum, totalsecrow)
{
	for (var i=1; i<=5; ++i)
	{
		document.getElementById(name+rownum+'_col'+i).className='col_inactive'+i; // inactive the rows
		if (name == "sec1_row" && totalsecrow) // for stage 1 only
		{
			for (var j=1; j<=totalsecrow; ++j)
			{
				if (document.getElementById('sec2_row'+j+'_col'+i).className == 'col_active'+i)
				{
					document.getElementById('sec2_row'+j+'_col'+i).className='col_inactive'+i;
				}
			}
		}
	}
	if (document.getElementById(name+rownum))
	{
		document.getElementById(name+rownum).style.display='none'; // hide it
	}
	return;
}
function label_show(section)
{
	document.getElementById(section).style.display='block';
}
function label_hide(section)
{
	document.getElementById(section).style.display='none';
}
function checkActive(name, rownum)
{
	if (document.getElementById(name+rownum+'_col1').className=='col_active1') return true;
	else return false;
}
function showinfo(name, rownum)
{
	if (document.getElementById(name+"info"+rownum))
	{
		document.getElementById(name+"info"+rownum).style.display='block'; // display it
	}
}
function hideinfo(name, rownum)
{
	if (document.getElementById(name+"info"+rownum))
	{
		document.getElementById(name+"info"+rownum).style.display='none'; // hide it
	}
}
// update data
function updateContent(section, id, act, randnum)
{
	document.body.className='loading';
	var t = new Date();
	var gettime = t.getTime();
	var randnum2= Math.floor(Math.random()*999999999); //  randnum is used for avoiding it to keep the history contents
	var scriptElem = document.createElement('script');
	scriptElem.setAttribute('src','/mod/persona_pricecalculator_ajax.php?section='+section+'&id='+id+'&act='+act+'&rand='+(randnum+randnum2)+'&timestamp='+gettime);
	document.getElementsByTagName('head')[0].appendChild(scriptElem);
}

function updateData(secname,id)
{
	document.body.className='loading';
	var t = new Date();
	var gettime = t.getTime();
	var randnum= Math.floor(Math.random()*999999999); //  randnum is used for avoiding it to keep the history contents
	var scriptElem = document.createElement('script');
	scriptElem.setAttribute('src','/mod/persona_pricecalculator2_ajax.php?id='+id+'&secname='+secname+'&amp;'+randnum+gettime);
	document.getElementsByTagName('head')[0].appendChild(scriptElem);
}