/*
 *	BrianR 5/02/2005
 *  File: MacOSXSupport.js
 *  BT1691 - File added for supporting Mac OSX IE 5.2
*/

/**************************************************************************************************
 * Array Support 
 * IE 5.2 Does not support array methods copy, concat, push, or splice
 * Below the properties are redifined with functions that will do the specified operation.
 *************************************************************************************************/

if(typeof Array.prototype.copy=='undefined')
{
    Array.prototype.copy=function(thisArray){
        var index    = 0;
        var newArray = Array();
        for( index; index<this.length; index++ )
            newArray[index]=(typeof this[index].copy!='undefined')?
                this[index].copy():
                this[index];
        return newArray;
    };
}

if(typeof Array.prototype.concat=='undefined')
{
    Array.prototype.concat=function(thisArray){
        var index    = 0;
        var newArray = this.copy();
        for( index; i<thisArray.length; index++ )
            newArray[newArray.length]=thisArray[index];
        return newArray;
    };
}
    
if(typeof Array.prototype.pop=='undefined')
{
    Array.prototype.pop=function(){
        var newArray = this[this.length-1];
        this.length--;
        return newArray;
    };
}

if(typeof Array.prototype.push=='undefined')
{
    Array.prototype.push=function(){
        var index    = 0;
        var arrayLen = this.length;
        var args     = arguments;
        for( index; index<args.length; index++ )
            this[arrayLen+index]=args[index];
        return this.length
    };
}

/* Returns true if the Browser is IE 5.2 on Mac */
function IsMacIE()
{
    if(browser && browser.isIE5x && browser.isMac)
        return true;
    return false;
}

function WriteMacStyleSheet()
{
    if(IsMacIE())
    {
        document.write("<style> @import url( ../css/MacOSIE.css ); </style>");
    }
}