
function init()
{
	setShowRelation();
}

function showRelation(tmptype)
{
	switch(tmptype)
	{
		case 1:
			document.getElementById('article_relation_1').style.display='';
			document.getElementById('article_relation_2').style.display='none';
			break;
		case 2:
			document.getElementById('article_relation_1').style.display='none';
			document.getElementById('article_relation_2').style.display='';
			break;
		default :
			document.getElementById('article_relation_1').style.display='none';
			document.getElementById('article_relation_2').style.display='none';
			break;
	}

}

function setShowRelation()
{
	var tagO = document.getElementsByTagName('input');

	for (var i=0;i<tagO.length;i++)
    {    
        if(tagO[i].name.toLowerCase()=="relation_type")
        {	
            if(tagO[i].checked == true)
            {
                document.getElementById('article_relation_'+tagO[i].value).style.display='';
            }
            else
            {
                document.getElementById('article_relation_'+tagO[i].value).style.display='none';
            }
            
        } 
    }
}

