def createStyleState(kmlDoc, scale, idtag):
    """
    Used to create a doucment wide style state with the LabelStyle internal field scale.
    Sets the Labelstyle scale field to value "scale" and names the field "idtag"
    """
    styleState = kmlDoc.createElement('Style')
    styleState.setAttribute('id', idtag)
    labels = kmlDoc.createElement('LabelStyle')
    lscale = kmlDoc.createElement('scale')
    lscale.appendChild(kmlDoc.createTextNode(str(scale)))
    labels.appendChild(lscale)
    styleState.appendChild(labels)
    return styleState
