/* --------------------------------------------------------------
FILE: Skin.js
DESCRIPTION: ExtJS Javascript extension for LSMS Private Label.  
TEMPLATE VERSION: 2.0  - Includes defaulting of company name field, and initially making the content invisible before changing it.
CUSTOMER: Thompson CAT Machinery
LOCATION: /Content/skin/tmc
PROJECT: LMS Private Label Migration
CREATED: 5/1/10
AUTHOR: Cahow

Mod Date    Rev #   Author      Description
--------    ------  ----------- ---------------------------------
6/16/10     2.1     Caruso      TFS #23371 - Company name defaulting fix.

(c) Copyright 2010 PureSafety
----------------------------------------------------------------- */

(function() {

    /* perform the page manipulations ONLY IF this is the login page */
    if (Ext && Ext.getDom('View_root_Login_Index') ) {
        var el = Ext.getDom('CompanyName');

        if (((el && el.value) || "").match(/^\s*$/)) {           // is the value empty? (zero or more spaces; only comprised of spaces)
            el.value = 'Thompson';
        }

        /* Suppress the default PureSafety graphic on the login page */
        var pics= Ext.query('.graphicCol');
        if (pics && pics[0]) {
            pics[0].innerHTML = '&nbsp;'; // keeps the element from collapsing
            pics[0].style.visibility = 'visible';
	}

        /* Change the default PureSafety Title and Intro Copy on the login page */
        var elems= Ext.query('.bodyCol');       // Returns an array of matches
        if (elems && elems[0]) {
		elems[0].innerHTML = '&nbsp;'; // keeps the element from collapsing
		elems[0].style.visibility = "visible";
	}
    }
})();
