From the code you posted it looks like oCurrentMainVideoList is not declared any where, so that might be why its saying its undefined...
If you have it defined as a global variable which it must be from the look of it, make sure you have sett a value to it. But you should not use a global variable, create a namespace for your functions, it helps with scope control.
If you want to learn some JS best practices you should watch this video from TekPub: JS_UpToSpeed
You should also take your time to look over your code and make it more readable before you post, the lack of indentations is making the code hard to read and theres multiple capital letters in buildMAinVideoList.