var NS4=(navigator.appName.indexOf("Netscape")>=0&&parseFloat(navigator.appVersion)>=4)?1:0
var IE4=(document.all)?1:0
var IE5=(IE4&&navigator.appVersion.indexOf("5.")>=0)?1:0
function hideLayer(lyr){if(NS4)lyr.visibility="hide";if(IE4)lyr.style.visibility="hidden";}
function showLayer(lyr){if(NS4)lyr.visibility="show";if(IE4)lyr.style.visibility="visible";}
function moveLayerTo(lyr,x,y){if(NS4)lyr.moveTo(x,y);if(IE4){lyr.style.left=x;lyr.style.top=y;}}
function moveFrameTo(fra,x,y){if(NS4)fra.moveTo(x,y);if(IE4){fra.style.pixelLeft=x;fra.style.pixelTop=y;}}
function getLeft(lyr){if(NS4)return lyr.left;if(IE4)return lyr.style.pixelLeft;return-1;}
function getTop(lyr){if(NS4)return lyr.top;if(IE4)return lyr.style.pixelTop;return-1;}
function getRight(lyr){if(NS4)return lyr.left+getWidth(lyr);if(IE4)return lyr.style.pixelLeft+getWidth(lyr);return-1;}
function getBottom(lyr){if(NS4)return lyr.top+getHeight(lyr);if(IE4)return lyr.style.pixelTop+getHeight(lyr);return-1;}
function getzIndex(lyr){if(NS4)return lyr.zIndex;if(IE4)return lyr.style.zIndex;return-1;}
function setzIndex(lyr,z){if(NS4)lyr.zIndex=z;if(IE4)lyr.style.zIndex=z;}
function setColor(lyr,color){if(NS4)lyr.color=color;if(IE4)lyr.style.color=color;}
function setBgColor(lyr,color){if(NS4)lyr.bgColor=color;if(IE4)lyr.style.backgroundColor=color;}
function getColor(lyr){if(NS4)return lyr.color;if(IE4)return lyr.style.color;}
function getBgColor(lyr){if(NS4)return lyr.bgColor;if(IE4)return lyr.style.backgroundColor;}
function getLayer(name){if(NS4)return findLayer(name,document);if(IE4)return eval('document.all.'+name);return null;}
function getWindowWidth(){if(NS4)return window.innerWidth;if(IE4)return document.body.clientWidth;return-1;}
function getWindowHeight(){if(NS4)return window.innerHeight;if(IE4)return document.body.clientHeight;return-1;}
function getPageWidth(){if(NS4)return document.width;if(IE4)return document.body.scrollWidth;return-1;}
function getPageHeight(){if(NS4)return document.height;if(IE4)return document.body.scrollHeight;return-1;}
function getObj(obj){
 var theObj,coll=""
 if (obj==null) return null
 coll=(IE4)?"all.":""
 if (typeof obj=="string") return eval('document.'+coll+obj);else return obj
}
function getStyleObj(obj){
 var theObj,coll="",styleObj=""
 if (obj==null)return null
 coll=(IE4)?"all.":""
 styleObj=(IE4)?".style":""
 if (typeof obj=="string") return eval('document.'+coll+obj+styleObj);else return obj
}
function getPageLeft(lyr){
 var x
 if(NS4)return lyr.pageX
 if(IE4){x=0;while(lyr.offsetParent!=null){x+=lyr.offsetLeft;lyr=lyr.offsetParent;}x+=lyr.offsetLeft;return x;}
 return-1
}
function getPageTop(lyr){
 var y
 if(NS4)return lyr.pageY
 if(IE4){y=0;while(lyr.offsetParent!=null){y+=lyr.offsetTop;lyr=lyr.offsetParent;}y+=lyr.offsetTop;return y;}
 return-1
}
function getWidth(lyr){
 if(NS4){if(lyr.document.width)return lyr.document.width;else return lyr.clip.right-lyr.clip.left;}
 if(IE4){if(lyr.style.pixelWidth)return lyr.style.pixelWidth;else return lyr.clientWidth;}
 return-1
}
function setFrameWH(fra,w,h){
 if(NS4){fra.document.width=w;fra.document.height=h;}
 if(IE4){fra.style.pixelWidth=w;fra.style.pixelHeight=h;}
 return-1
}
function getHeight(lyr){
 if(NS4){if(lyr.document.height)return lyr.document.height;else return lyr.clip.bottom-lyr.clip.top;}
 if(IE4){if(lyr.style.pixelHeight)return lyr.style.pixelHeight;else return lyr.clientHeight;}
 return-1
}
function findLayer(name,doc){
 var i,lyr
 for(i=0;i<doc.lyrs.length;i++){
  lyr=doc.lyrs[i]
  if(lyr.name==name)return lyr
  if(lyr.document.lyrs.length>0)
   if((lyr=findLayer(name,lyr.document))!=null)return lyr
 }
 return null
}
//window.onresize=winReload
function winReload(){
 if(NS4&&origWidth==window.innerWidth&&origHeight==window.innerHeight)return
 if(IE4)setTimeout('window.location.href = window.location.href',2000)
 else window.location.href=window.location.href
}
