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

