I am trying to define a function that would to that:

```
var photoWidth = $('#photo_preview').width();
var photoHeight = $('#photo_preview').height();

if (imgHeight > imgWidth){
    $('#photo_preview').css('width','100');
    }

```

My goal is to create a function that would be like:

```
resizePhoto(theselector);

```

... with the parameter "theselector" being $('#photo\_preview') or any other selector.

NOTE: I can't use classes for this one.

What should I do?