* converted several js scripts to c#