Hi,
I am using window.onLoad function in my application for Style Switching functionality.

but If I use the below script, this function does not work., I know if there is some error in script, the onLoad function does not get call but,please tell me whats wrong with the below script

var AgntUsr2=navigator.userAgent.toLowerCase();
var AppVer2=navigator.appVersion.toLowerCase();
var DomYes2=document.getElementById?1:0;
var NavYes2=AgntUsr2.indexOf('mozilla')!=-1&&AgntUsr2.indexOf('compatible')==-1?1:0;
var ExpYes2=AgntUsr2.indexOf('msie')!=-1?1:0;
var Opr2=AgntUsr2.indexOf('opera')!=-1?1:0;
var Opr6orless2=window.opera && navigator.userAgent.search(/opera.[1-6]/i)!=-1 //DynamicDrive.com added code
if(Opr2){NavYes2=1;ExpYes2=0;}
var Par2=parent.frames[0]&&FirstLineFrame!=SecLineFrame?parent:window;
var Doc2=Par2.document;
var Bod2=Doc2.body;
var Trigger2=NavYes2&&!Opr2?Par2:Bod2;

if(Trigger2.onload)Dummy2=Trigger2.onload;
Trigger2.onload=CreateTagScript;


function loadContent(scriptID,FileName)
{
//alert("Entering loadContent"+ scriptID);
var scriptTag = document.getElementById(scriptID);
var head = document.getElementsByTagName('head').item(0)
if(scriptTag) head.removeChild(scriptTag);
script = document.createElement('script');
script.src = FileName;
script.type = 'text/javascript';
script.id = scriptID;
head.appendChild(script)
//alert("end of loadContent"+ scriptID);
}

function CreateTagScript()
{
loadContent("ScriptMenu","/AComponents/includes/menu_com.js");
loadContent("ScriptCalendar","/AComponents/includes/calendar.js");
loadContent("ScriptTreeView","/AComponents/includes/AtreeView.js");
}