﻿function sfHover() 
{    
	var sfEls = document.getElementById("custNav").getElementsByTagName("LI");     
	for (var i=0; i<sfEls.length; i++) {         
		sfEls[i].onmouseover=function() {             
			this.className+=" sfhover";         
		}         
		sfEls[i].onmouseout=function() {             
			this.className=this.className.replace(new RegExp("sfhover\\b"), "");         
		}     
	} 
}
		
function EmbedIDrop()
{
    var divLayer = document.getElementsByTagName('div');
    
    //Get the div tag from the file
    var divLayer = document.getElementsByTagName('div');
    //Check the div tag's classname equal to idropcontent
    if (divLayer.length>0)
    {
        var myIDrop = new Array()
        for (i=0; i<divLayer.length; i++)
 
        {        
            if (divLayer[i].className == 'idropcontent')
            {
                myIDrop.push(divLayer[i].id)
            }
        }
        var so = new Array()
        for (j=0; j<myIDrop.length; j++)
 
        {
            //split the div tag based on ::
            tempParam = myIDrop[j].split('::');
            
            //Following method used to display the flash file, swfobject.embedSWF([URL],[div Id],[Height], [Width], [Flash Version], [Background Colour], [Alternative flash or image]);
            document.getElementById(tempParam[0]).innerHTML = '<object name="' + tempParam[0] + '" classid="clsid:21E0CB95-1198-4945-A3D2-4BF804295F78" width="' + tempParam[8] + '" height="' + tempParam[9] + '">'
                            + '<param name="Background" value="' + tempParam[1] + '" />'
                            + '<param name="proxyrect" value="' + tempParam[6] + ',' + tempParam[7] + ',' + tempParam[8] + ',' + tempParam[9] + '" />'
                            + '<param name="griprect" value="' + tempParam[6] + ',' + tempParam[7] + ',' + tempParam[8] + ',' + tempParam[9] + '" />'
                            + '<param name="package" value="' + tempParam[5] + '" />'
                            + '<param name="validate" value="1" />'
                            + '<img src="' + tempParam[1] + '" alt="'+ tempParam[2] +'" width="'+ tempParam[3] +'" height="'+ tempParam[4] +'" />'
                            + '</object>';

        }
    }
}

function EmbedFlash()
{
    //Get the div tag from the file
    var divLayer = document.getElementsByTagName('div');
    //Check the div tag's classname equal to flashcontent
    if (divLayer.length>0)
    {
        var myFlash = new Array()
        for (i=0; i<divLayer.length; i++)
 
        {        
            if (divLayer[i].className == 'flashcontent')
            {
                myFlash.push(divLayer[i].id)
            }
        }
        var so = new Array()
        for (j=0; j<myFlash.length; j++)
 
        {
            //split the div tag based on ::
            tempParam = myFlash[j].split('::');
            
            
            
            var flashvars = {};
            var params = { wmode: "opaque"};
            var attributes = {};
            
            //Following method used to display the flash file, swfobject.embedSWF([URL],[div Id],[Height], [Width], [Flash Version], [Background Colour], [Alternative flash or image]);
            swfobject.embedSWF(tempParam[0], tempParam[1], tempParam[2], tempParam[3], tempParam[4], false, flashvars, params, attributes);
        }
    }
}

if(window.addEventListener)
{
    window.addEventListener("load", EmbedFlash, false);
    window.addEventListener("load", EmbedIDrop, false);
}
else if(window.attachEvent)
{
    window.attachEvent("onload", sfHover);
    window.attachEvent("onload", EmbedFlash);
    window.attachEvent("onload", EmbedIDrop);
}