// Function to set a scrollable element's height to fit the screen
// leaving only a margin on top, and then scroll to the top. 
function changeIt(element, marginTop) 
 {
    var dims = new windowDims();
    document.getElementById(element).style.height = (dims.myHeight - marginTop) + 'px';                
    document.getElementById(element).scrollTop = 0;
 }


function windowDims()
{
    this.myWidth = 0; 
    this.myHeight = 0;

    if( typeof( window.innerWidth ) == 'number' ) 
    {
        //Non-IE
        this.myWidth = window.innerWidth;
        this.myHeight = window.innerHeight;
    } 
    else 
    {
           if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
           {
                //IE 6+ in 'standards compliant mode'
                this.myWidth = document.documentElement.clientWidth;
                this.myHeight = document.documentElement.clientHeight;
           } 
           else 
           {
                  if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
                  {
                       //IE 4 compatible
                        this.myWidth = document.body.clientWidth;
                        this.myHeight = document.body.clientHeight;
                  }
           }
     }
}   

// Function to toggle the display of an element between none and inline
function toggle(id)
{
    var item = document.getElementById(id);
                    
    if (item.style.display == 'none')
        item.style.display = 'inline';
    else item.style.display = 'none';
}    

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }
}
