﻿// Attribute Control Include
function setImageState(img, iconName, hid, hasYesOption, hasNoOption) {
    var inputHidden = new $(hid);
    
    if (inputHidden.value == 0) {              
        if (hasYesOption == 'true')
        {
            img.src = '../images/attributes/' + iconName + '-yes.gif';
            inputHidden.value = 1
        }
        else if (hasNoOption == 'true')
        {
            img.src = '../images/attributes/' + iconName + '-no.gif';
            inputHidden.value = 2
        }
        else 
        {
	        img.src = '../images/attributes/' + iconName + '.gif';
            inputHidden.value = 0
        }  
    } else if (inputHidden.value == 1) { 
        if (hasNoOption == 'true')
        {
            img.src = '../images/attributes/' + iconName + '-no.gif';
            inputHidden.value = 2
        }
        else
        {
       	    img.src = '../images/attributes/' + iconName + '.gif';
            inputHidden.value = 0
        }
    } else {
	    img.src = '../images/attributes/' + iconName + '.gif';
        inputHidden.value = 0
    }
}
