Well, if you’re willing to use jQuery you could easily do something along the lines of:
$.ajax({
url: 'https://api.twitch.tv/kraken/streams/normalice',
dataType: 'jsonp',
type: 'get',
success: function(data) {
if(typeof data.stream === 'object') {
document.getelementbyID('frame1').style.width = '160px';
} else {
document.getelementbyID('frame1').style.width = '0px';
}
}
});