You could check out what the PositionFog function does:
// Computes final clip space position and fog parameter
inline void PositionFog( in float4 v, out float4 pos, out float fog )
{
pos = mul( glstate.matrix.mvp, v );
fog = pos.z;
}
as well as that define you put into the vertexshaders output struct:
#define V2F_POS_FOG float4 pos : POSITION; float fog : FOGC
alternatively you can just deactivate it and fade it in yourself in pixel shader. I dont know what exactly you want to do, but this should basicly be all information needed?