loss of power.. inconsistant...

91 240sx…
soo when my car gets down to 1/4 tank its pretty much not drivable… loss of all power, for like a couple seconds… then i would gain it back and lose again… but anyways…
soo now i took it out on the high way yesterday and it did pretty much the exact same thing… except it wasnt at 1/4 tank… so what the fuck? it only does it when it gets hot… if i let it sit for like 30 mins i can drive again for a little bit…
but today i found this computer looking thing beside my battery that is hooked onto wires comming from the passanger side and it is fried… like really badly fucked up
and now my headlight on the passanger side is not working either… ( not burnt out)
i was thinking fuel pump intill i found this … but any ideas are great
thanks

Take some pictures of the fried thingee, and post up.

the digi is lost!! soo i cant take pics right now
but yea its like the size of a pack of smokes pretty mcuh… and the plastic around is like broken and you can see the electronic shit inside… and it was sitting right beside my battery…

Its a black box im guessing. Its for your DRL’s mine is also melted i dont know why it happens.

alright yea it is a black box…
could this be causing some of my problems you think?
and the DRL is???

Daytime running lights.

I doubt that would cause a problem, unless some wires are touching and causing power surges or some other wierd shit.

yea well it only does it when it heats up too much…
fuck i need to fix this asap.
it kinda looks like the battery acid was leaking on it and melted the fuck outa it
but one of my headlights does not work anymore
anyone thinking weak fuel pump?

could be that some wires are crossing and shorting affecting other systems?

its kinda getting worse…
might be because it is just hotter outside period… but i dunno
throw some ideas at me…
fuel pump relay maybe?
ugh god