no clearly defined succession laws. Instead the succession was based on customs with origins in old Germanic traditions: The situation followed loosely agnatic seniority and agnatic succession with some elements of elective monarchy. All patrilineal male descendants of Harald Hårdråde were entitled to share the kingship. This included sons born outside marriage and many kings had semi-official concubines. To formally become king the candidate had to be hailed at the thing – though he would naturally make sure to have the assembly's support before launching his candidacy. The sources do not record any instance of a candidate being turned down by a thing after demanding to be hailed. As kingship gradually took shape as an institution a few things, particularly Øreting in Trøndelag, received a special status as the places the new king was hailed. The result of these customs was that brothers and half-brothers would inherit the throne to rule jointly, but such arrangements rarely lasted. As a result, succession was generally a matter of conflict, intrigue, and at times minor civil war. From the 1130s, strifes escalated to a more or less continuous civil war until 1240. However, during the reign of the Hårdråde branch of the dynasty, it was generally agreed that only patrilineal male descendants of King Harald III, were entitled to the kingship. Many of the claims by later royal pretenders to belong to the Fairhair dynasty are obvious falsehoods (most notably that of Sverre Sigurdsson). 1163, Magnus V of Norway, the son of a daughter of a previous ruler, ascended to the throne. He was supported by the church, but despite initial success, and the first example of a codified law of succession (allowing his own cognatic heirship), he was overthrown by putative male-line members of the old royal dynasty. In the 13th century, the kingdom was officially declared hereditary by king Haakon Haakonsson, through a succession system that was based on primogeniture. It was also under Haakon Haakonsson, himself the illegitimate son of king Haakon Sverresson, that legitimacy of birth became a factor in the line of succession. Haakon's eldest son, Sigurd, was accordingly bypassed by Haakon's legitimate sons, Haakon and Magnus. In the tradition of the Germanic monarchy the king had to be elected by a representative assembly of noblemen. Men eligible for election had to be of royal blood; the eldest son of the previous king was not automatically chosen. During