// Function to do prefetch
function preLoad(x)
{
        // Get images count
        var count = $(x).size();
        var htm ="";
        var i = 0;
        // IE 6+ browsers are not firing load event for the images that are already
        // used that is DIV background. So adjust the count
        var browserVer= parseFloat(navigator.appVersion.split("MSIE")[1]);
        if(browserVer >= 6)
        {
                i = 1;
        }
        // Load individual images
        $(x).each(
        function()
        {
                // Get image source
                var elem = $(this);
                var src = elem.attr("href");

                if( src != "")
                {
                        htm += "<li><img src=\"" + src + "\"></li>";
                        // Load the image
                        jQuery("<img>").attr("src",src)
                        .load(
                        function()
                        {
                                // This is load compelte call back
                                // Update completed count
                                i++;
                                // Hide this image
                                $(this).hide();
                                // Check for fader firing
                                if( i == count)
                                {
                                // set html
                                $('#homepage_feature').html(htm);
                                // Start fader
                                $('#homepage_feature').innerfade(
                                        {
                                        speed: 2000,
                                        timeout: 4000,
                                        type: 'sequence',
                                        containerheight: '350px'
                                        });

                                     $("#homepage_feature").css('background', 'transparent');          
                                }
                        });
                }
        });
}
