something like this is going to be hard since you have a different configuration than most peeps on here, and you are giving us a lot of code to look at and you never told us what doesn't work, you need to tell us what doesn't work, what sort of errors are you getting, etc....and then someone would be more apt to look