home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 July
/
Chip_2004-07_cd1.bin
/
chplus
/
svethardware
/
shw.js
< prev
Wrap
Text File
|
2003-09-16
|
3KB
|
112 lines
window.onload = init
window.onresize = init
function init() {
objects()
width()
height()
}
function ahoj() {
alert("ahoj")
}
var MF,LB,MB,RB,LM,TLB,TMB,TRB,TLM,BT,SP,TB
function objects() {
MF = gEBI('mainframe')
LM = gEBI('wrapper')
LB = gEBI('left')
MB = gEBI('middle')
RB = gEBI('right')
TLM = gEBI('topwrapper')
TLB = gEBI('topleft')
TMB = gEBI('topmiddle')
TRB = gEBI('topright')
TB = gEBI('topbar')
FT = gEBI('footer')
SP = gEBI('spacing')
}
function gEBI(id) {
if(Boolean(document.getElementById)) {
return document.getElementById(id);
} else if(Boolean(document.all)) {
return eval('document.all.'+id);
}
}
function width() {
//alert(document.body.clientHeight)
var pw = SP.offsetWidth
//alert(document.styleSheets[0].rules)
if (pw > 930) {
MF.style.width='100%'
SP.style.width='100%'
}
else {
MF.style.width='930px'
SP.style.width='930px'
}
//alert(SP.offsetWidth)
//var total = MF.offsetWidth
var total = SP.offsetWidth
TLM.style.width = (total-256)+'px' // topwrapper
LM.style.width = TLM.style.width // wrapper
//TMB.style.width = (total-TLB.offsetWidth-TRB.offsetWidth)+'px'
TMB.style.width = (total-160-256)+'px' //topmiddle
//MB.style.width = (total-TLB.offsetWidth-TRB.offsetWidth)+'px'
MB.style.width = (total-160-256)+'px' //middle
TB.style.width = (total)+'px' //topbar
}
function topwidth() {
var msie = window.navigator.userAgent.match('MSIE') && !window.navigator.userAgent.match('Opera')
if (msie) {
var SP = gEBI('spacing')
var pw = SP.offsetWidth
if (pw > 930) {
document.styleSheets[0].addRule("DIV#mainframe", "width:100%");
SP.style.width='100%'
}
else {
document.styleSheets[0].addRule("DIV#mainframe", "width:930px");
SP.style.width='930px'
}
var total = SP.offsetWidth
document.styleSheets[0].addRule("DIV#topwrapper", "width:"+(total-256)+"px");
document.styleSheets[0].addRule("DIV#wrapper", "width:"+(total-256)+"px");
document.styleSheets[0].addRule("DIV#topmiddle", "width:"+(total-160-256)+"px");
document.styleSheets[0].addRule("DIV#middle", "width:"+(total-160-256)+"px");
document.styleSheets[0].addRule("DIV#topbar", "width:"+(total)+"px");
}
}
function height() {
var leftH = LB.offsetHeight
var middleH = MB.offsetHeight
var rightH = RB.offsetHeight
/*
alert(leftH)
alert(middleH)
alert(rightH)
*/
var m, maxi
// m = leftH
if (leftH > rightH) { m = leftH } else { m = rightH }
if (middleH > m) { m = middleH }
/*
if (!(Opera && leftH > contentH))
LB.style.height = (maxi)+'px'
*/
LB.style.height = (m)+'px'
MB.style.height = (m)+'px'
RB.style.height = (m)+'px'
}