var WidthMax = 1000
var WidthMin = 520
var WidthMargin = 0
var HeightMax = 1000-32
var HeightMin = 420+32
var HeightMargin = 32

if (document.body.clientWidth>WidthMax+WidthMargin) {
   var SetWidth=WidthMax
} else if (document.body.clientWidth<WidthMin+WidthMargin) {
   var SetWidth=WidthMin
} else {
   var SetWidth=document.body.clientWidth - WidthMargin
}
   
if (document.body.clientHeight>HeightMax+HeightMargin) {
   var SetHeight=HeightMax
} else if (document.body.clientHeight<HeightMin+HeightMargin) {
   var SetHeight=HeightMin
} else {
   var SetHeight=document.body.clientHeight - HeightMargin
}
document.write("<STYLE Type=\"text/css\" media=\"screen\">")
document.write("#realbody {")
document.write("  width="+Math.round(SetWidth)+"px;")
if (document.body.clientWidth<WidthMin) {
   document.write("  left=0px;")
} else {
   document.write("  left=" +Math.round((document.body.clientWidth-SetWidth-WidthMargin)/2)+ "px;")
}
document.write("  height="+Math.round(SetHeight)+"px;")
if (document.body.clientHeight<HeightMin) {
   document.write("  top=0px;")
} else {
   document.write("  top=" +Math.round((document.body.clientHeight-SetHeight-HeightMargin)/2) + "px;")
}
document.write("  }")
document.write("#content {")
document.write("  width="+Math.round(SetWidth-354)+"px;")
document.write("  height="+Math.round(SetHeight-106)+"px;")   
document.write("  }")
document.write("#content_bg1 {")
document.write("  height="+Math.round(SetHeight-203)+"px;")   
document.write("  }")
document.write("#content_bg2 {")
document.write("  top="+Math.round(SetHeight-80)+"px;")   
document.write("  }")
document.write("#copyright {")
document.write("  top="+SetHeight+"px;")   
document.write("  }")
document.write("#header {")
document.write("  width="+SetWidth+"px;")   
document.write("  }")
document.write("#contact {")
document.write("  top="+Math.round(SetHeight-160)+"px;")   
document.write("  }")
document.write("#contactbg {")
document.write("  top="+Math.round(SetHeight-160)+"px;")   
document.write("  }")
document.write("#line_vert {")
document.write("  height="+Math.round(SetHeight-245)+"px;")   
document.write("  }")
document.write("#line_hor {")
document.write("  width="+Math.round(SetWidth-224)+"px;")   
document.write("  }")   
document.write("#tiptop5 {")
document.write("  left="+Math.round(SetWidth-177)+"px;")   
document.write("  }")
document.write("</STYLE>")

window.onresize = restorePage
function restorePage() {
    history.go(0)
}

