﻿// Ok, So Let's See If This .NET Coder Can Do Javascript Properly...


//
// Theoretically, I'm Going To Resize All The Big Images, And If There Is A Valid Class, I'll Add A Popup
//


function OnWindowLoad()
{ 

   // Check For Availability
    if( !document.getElementById ) { return; }

    // Get The Main Content Div
    var content = document.getElementById('RightContent');

    // Check For Availability
    if( ! content ) { return; }
    if( ! content.getElementsByTagName ) { return ; }

    // Get All The Images
    var imgs = content.getElementsByTagName('img');

    // Check For Availability
    if( ! imgs ) { return; }

    // Go Through Them All
    for (var i=0;i<imgs.length;i++)
    {

        // If They Have A Class, Then Ignore Them
        if (imgs[i].className)
        {
            continue;
        }

        // Is The Image Too Large?
        if (imgs[i].width > 400)
        {
            // NOTE: This Value Is The Same As The 'max-value' Used In CSS
            // However, Due To The IE Team's Incompetency, This Is How I Get Around Their Lack Of That Property
            // And Still Manage To Maintain Some Semblance Of Standards Validation..
            // Resize
            imgs[i].width = 400;     
          
        }
    }
}