var applicationName = (navigator.appName);
var browserName = (navigator.appVersion);
var browserVer = parseInt (navigator.appVersion);
var browserNameInt = parseFloat (navigator.appVersion)
var codeName = (navigator.appCodeName);
var uSerAgent = (navigator.userAgent)
var uSerAgentInt = parseInt (navigator.userAgent)
var platformName = (navigator.platform)

var n6=(applicationName.indexOf("Netscape")!=-1 && browserVer>=5)?1:0
var nx = (document.layers) ? 1:0;
var msieBrowser=(!n6&&document.all)?1:0
var mac5 =(mac && browserName.indexOf("MSIE 5") != -1)?1:0
var mac502=(browserName.indexOf("5.0")!=-1)?1:0;

var mac=(navigator.platform.indexOf('Win')) ?1:0;
var lx = (browserName.indexOf("Linux") != -1)?1:0
var opera = (uSerAgent.indexOf("Opera") != -1)?1:0

var doDHTML=(document.getElementById || document.all || document.layers) ?1:0;
var ourFriend=(document.getElementById && document.createElement && document.createTextNode) ?1:0;



function showLayer(layerID){
    if(ourFriend){
      document.getElementById(layerID).style.visibility='visible'
    }
    else if(msieBrowser){
      document.all[layerID].style.visibility = 'visible';
    }
    else if(nx){
      document.layers[layerID].visibility = 'show';
    }
  }



function correctPNG(){                                      // correctly handle PNG transparency in Win IE 5.5 or higher.
    for(var i=0; i<document.images.length; i++){
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){
        var imgID = (img.id) ? "id='" + img.id + "' " : ""
        var imgClass = (img.className) ? "class='" + img.className + "' " : ""
        var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
        var imgStyle = "display:inline-block;" + img.style.cssText
        if (img.align == "left") imgStyle = "float:left;" + imgStyle
        if (img.align == "right") imgStyle = "float:right;" + imgStyle
        if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
        var strNewHTML = "<span " + imgID + imgClass + imgTitle
        + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
        + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
        + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
        img.outerHTML = strNewHTML
        i = i-1
      }
    }
  }

if (document.all){
  window.attachEvent("onload", correctPNG);
}

function correctNow(){
    if (document.all){
      correctPNG();
    }
    showLayer('andrew');
  }



function winPop(url) {
    new_Window = window.open
    (url,"newWindow","location=no,toolbar=no,directories=no,status=no,menubar=no,copyhistory=no,scrollbars=yes,resizable=no,width=450,height=300,left=50,top=50");
  }


function galleryPop(url) {
    gallery_Window = window.open
    (url,"galleryWindow","location=no,toolbar=no,directories=no,status=no,menubar=no,copyhistory=no,scrollbars=yes,resizable=no,width=700,height=580,left=0,top=0");
  }




if(!n6 && !window.saveInnerWidth) {
    window.onresize = resizeIt;
    window.saveInnerWidth = window.innerWidth;
    window.saveInnerHeight = window.innerHeight;
  }
function resizeIt() {
    if (saveInnerWidth < window.innerWidth || saveInnerWidth > window.innerWidth || saveInnerHeight > window.innerHeight || saveInnerHeight < window.innerHeight ){
      window.history.go(0);
    }
  }
