//        Ripped off from Kien Caoxuan
//        www.caoxuan.com/kien/
//detecting browser to dynamically write appropriate DIVs/LAYERs
N=(navigator.appName.indexOf('Netscape')!=-1&&parseInt(navigator.appVersion)<5)
S=(navigator.appName.indexOf('Netscape')!=-1&&parseInt(navigator.appVersion)>4.9)
M=(navigator.appName.indexOf('Microsoft')!=-1)
Vis=new Array()
Vis[0]=(M||S) ? "hidden"  : "hide"
Vis[1]=(M||S) ? "visible" : "show"
// ------------
function GetDiv(divId,divY,divX,divW,divH,bCol,visb,zInd){
bkCol=(bCol!="")?((N)?" bgColor="+bCol:";background:"+bCol):""
var Styl = (M||S) ? "<DIV" : "<LAYER"
if(M||S){
   Styl+=" ID="+divId
   Styl+=" style='position:absolute;top:"+divY+";left:"+divX+";width:"+divW+";height:"+divH+bkCol
   Styl+=";visibility:"+Vis[visb]+";z-index:"+zInd
   Styl+="'>"
   }
if(N){
   Styl+=" ID="+divId
   Styl+=" top="+divY+" left="+divX+" width="+divW+" height="+divH+bkCol
   Styl+=" visibility="+Vis[visb]+" z-index="+zInd
   Styl+=">"
   }
document.writeln(Styl)
}
// -------------
function EndDiv(){
(M||S)? document.writeln("</DIV>"): document.writeln("</LAYER>")
}
// -------------
function Put_Img(divId,ImgSrc,divY,divX,IW,IH,visb,zInd) {
ImgW=(IW!="")? " width ="+IW+"px " :""
ImgH=(IH!="")? " height ="+IH+"px " :""
var Styl = (M||S) ? "<DIV" : "<LAYER"
if(M||S){
   Styl+=" ID="+divId
   Styl+=" style='position:absolute;top:"+divY+";left:"+divX
   Styl+=" ;visibility:"+Vis[visb]+";z-index:"+zInd
   Styl+="'>"
   }
if(N){
   Styl+=" ID="+divId
   Styl+=" top="+divY+" left="+divX
   Styl+=" visibility="+Vis[visb]+" z-index="+zInd
   Styl+=">"
   }
document.writeln(Styl)
ImgTg  = "<IMG SRC='"+ImgSrc
ImgTg += "' "+ ImgW+ImgH+ " >"
TagEnd =  (M||S)? "</DIV>": "</LAYER>"
document.writeln(ImgTg+TagEnd)
}
// ----------------
function Put_ImgS(divId,ImgSrc,divY,divX,IW,IH,visb,zInd) {
ImgW=(IW!="")? " width ="+IW+"px " :""
ImgH=(IH!="")? " height ="+IH+"px " :""
var Styl = (M||S) ? "<DIV" : "<LAYER"
if(M||S){
   Styl+=" style='position:absolute;top:"+divY+";left:"+divX
   Styl+=" ;visibility:"+Vis[visb]+";z-index:"+zInd
   Styl+="'>"
   }
if(N){
   Styl+=" top="+divY+" left="+divX
   Styl+=" visibility="+Vis[visb]+" z-index="+zInd
   Styl+=">"
   }
document.writeln(Styl)
ImgTg  = "<v:image ID="+divId+" SRC='"+ImgSrc
ImgTg += "' "+ ImgW+ImgH+ "style='rotation:0' >"
TagEnd =  (M||S)? "</DIV>": "</LAYER>"
document.writeln(ImgTg+TagEnd)
}
// ----------------
function Put_ImgN(Name,ImgSrc,divY,divX,IW,IH,visb,zInd) {
ImgTg = "<IMG SRC='"+ImgSrc
ImgTg+="' "
if(M||S){
   ImgTg+=" name= '"+Name
   ImgTg+="' "
   ImgTg+=" style='position:absolute;top:"+divY+"px ;left:"+divX+"px ;"
   ImgTg+=" width:"+IW+"px ; height:"+IH+"px ;"
   ImgTg+=" visibility:"+Vis[visb]+"; border-style:none ; z-index:"+zInd
   ImgTg+="'></A>"
   }
else if(N){
   ImgTg+=" name= '"+Name
   ImgTg+="' "
   ImgTg+=" top="+divY+"px  left="+divX+"px "
   ImgTg+=" width="+IW+"px height="+IH+"px "
   ImgTg+=" visibility="+Vis[visb]+" border=0 z-index="+zInd
   ImgTg+=">X/a>"
   }
document.writeln(ImgTg)
}
//-------------
function PutIt(ID,dX,dY){
if(N){
   document.layers[ID].left=dX
   document.layers[ID].top=dY
   }
if(M){
   document.all[ID].style.left=dX
   document.all[ID].style.top=dY
   }
if(S){
   document.getElementById(ID).style.left=dX
   document.getElementById(ID).style.top=dY
   }
}
// ------------
function ShowHide(ID,vs){
if(N){
   document.layers[ID].visibility=Vis[vs]
   }
if(M){
   document.all[ID].style.visibility=Vis[vs]
   }
if(S){
   document.getElementById(ID).style.visibility=Vis[vs]
   }
}
// ------------
function Xof(ID){
if(N){
   return document.layers[ID].left
   }
if(M){
   return document.all[ID].style.left
   }
if(S){
   return document.getElementById(ID).style.left
   }
}
// --------------
function Yof(ID){
if(N){
   return document.layers[ID].top
   }
if(M){
   return document.all[ID].style.top
   }
if(S){
   return document.getElementById(ID).style.top
   }
}
// -------------
function Zind(ID,zz){
if(N){
   document.layers[ID].zIndex=zz
   }
if(M){
   document.all[ID].style.zIndex=zz
   }
if(S){
   document.getElementById(ID).style.zIndex=zz
   }
}
// --------------
function ChangeCol(ID,colrx){
if(M)document.all[ID].style.background=colrx
if(N)document.layers[ID].bgColor=colrx
if(S)document.getElementById(ID).style.background=colrx
}
// --------------
function DivWrite(IdName,Str) {
if (N){
    document.layers[IdName].document.write(Str)
    document.layers[IdName].document.close()
    }
if(M) document.all[IdName].innerHTML=Str
if(S) document.getElementById(IdName).innerHTML=Str
}